-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
52 lines (48 loc) · 1.5 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
pipeline {
agent any
// tools {
// maven 'M3'
// }
stages {
stage('Pre') {
steps {
sh 'bash ./pre.sh'
}
}
stage('Build') {
steps {
// sh 'export A=$(lsof -t -i:8082)'
sh 'cp /home/ubuntu/.env /var/lib/jenkins/workspace/hep1-instance/.env'
sh 'npm install'
sh 'npm update'
sh 'whoami'
sh 'pwd'
sh 'ls -la'
sh 'yarn'
sh 'yarn build &'
sh 'sleep 200'
sh 'docker build -t frontend .'
sh 'docker container run -d -p 80:80 --name my-frontend frontend'
}
}
// stage('Deliver') {
// steps {
// // sh 'cd ./target'
// // sh 'pwd'
// // sh 'java -jar ./target/api-0.0.1-SNAPSHOT.jar'
// }
// }
}
post {
failure {
mail to: 'dinhlehoang35@gmail.com, hnamnguyen.hy@gmail.com, hoapnse05740@fpt.edu.vn, thaycacac@gmail.com',
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: "Something is wrong with ${env.BUILD_URL}"
}
success {
mail to: 'dinhlehoang35@gmail.com, hnamnguyen.hy@gmail.com, thaycacac@gmail.com, hoapnse05740@fpt.edu.vn',
subject: "Success notification from Jenkins!",
body: "FE Success!"
}
}
}