@@ -5,22 +5,22 @@ pipeline {
5
5
stage(" Test Application" ){
6
6
steps {
7
7
nodejs(nodeJSInstallationName : ' nodejs' ) {
8
- sh ' npm run test'
8
+ bat ' npm run test'
9
9
}
10
10
}
11
11
}
12
12
stage(" Build Application" ){
13
13
steps {
14
14
nodejs(nodeJSInstallationName : ' nodejs' ) {
15
- sh ' npm install'
16
- sh ' npm run build'
15
+ bat ' npm install'
16
+ bat ' npm run build'
17
17
}
18
18
}
19
19
}
20
20
stage(" Dockerize Application" ){
21
21
steps {
22
- sh ' docker build -t webapp .'
23
- sh ' docker images'
22
+ bat ' docker build -t webapp .'
23
+ bat ' docker images'
24
24
}
25
25
}
26
26
stage(" Push To DockerHub" ){
@@ -30,20 +30,20 @@ pipeline {
30
30
usernameVariable : " USERNAME" ,
31
31
passwordVariable : " PASSWORD"
32
32
)]) {
33
- sh ' docker login --username $USERNAME -- password PASSWORD'
34
- sh ' docker push webapp:dev'
33
+ bat ' docker login --username $USERNAME -- password PASSWORD'
34
+ bat ' docker push webapp:dev'
35
35
}
36
36
}
37
37
}
38
38
stage(" Push To Github" ){
39
39
steps {
40
- sh ' git config --global user.email "auto@jenkins.com"'
41
- sh ' git config --global user.name "Jenkins"'
42
- sh ' git remote add jenkins https://github.com/lenn0n/jenkins-post-build.git'
43
- sh ' git add .'
44
- sh " git commit -m 'Commit from Jenkins'"
40
+ bat ' git config --global user.email "auto@jenkins.com"'
41
+ bat ' git config --global user.name "Jenkins"'
42
+ bat ' git remote add jenkins https://github.com/lenn0n/jenkins-post-build.git'
43
+ bat ' git add .'
44
+ bat " git commit -m 'Commit from Jenkins'"
45
45
withCredentials([gitUsernamePassword(credentialsId : ' gh-cred' , gitToolName : ' Default' )]) {
46
- sh " git push -u origin HEAD:jenkins"
46
+ bat " git push -u origin HEAD:jenkins"
47
47
}
48
48
}
49
49
}
0 commit comments