Commit 45deb10 1 parent 24e0d8e commit 45deb10 Copy full SHA for 45deb10
File tree 1 file changed +11
-10
lines changed
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change 8
8
checkout scm
9
9
sh ' ./jenkins/scripts/test.sh'
10
10
}
11
- stage(' Build image' ) {
12
- checkout scm
13
- docker. image(' ubuntu:alpine' ) {
14
- withCredentials([usernamePassword(credentialsId : ' docker-hub-creds' , usernameVariable : ' USER' , passwordVariable : ' PASS' )]) {
15
- sh ' docker build -t slehmadi/react-app-cicd-dicoding .'
16
- sh ' docker login -u $USER -p $PASS'
17
- sh ' docker push slehmadi/react-app-cicd-dicoding'
18
- }
19
- }
20
- }
21
11
stage(' Manual Approval' ) {
22
12
checkout scm
23
13
input message : ' Lanjutkan ke tahap Deploy?'
@@ -29,4 +19,15 @@ node {
29
19
sh ' ./jenkins/scripts/kill.sh'
30
20
}
31
21
}
22
+ docker. image(' ubuntu:alpine' ). inside(' -p 3000:3000' ) {
23
+ stage(' Build Image' ) {
24
+ checkout scm
25
+ sh ' apt update && apt install docker.io -y'
26
+ withCredentials([usernamePassword(credentialsId : ' docker-hub-creds' , usernameVariable : ' USER' , passwordVariable : ' PASS' )]) {
27
+ sh ' docker build -t slehmadi/react-app-cicd-dicoding .'
28
+ sh ' docker login -u $USER -p $PASS'
29
+ sh ' docker push slehmadi/react-app-cicd-dicoding'
30
+ }
31
+ }
32
+ }
32
33
}
You can’t perform that action at this time.
0 commit comments