@@ -9,54 +9,54 @@ pipeline {
9
9
}
10
10
}
11
11
}
12
- stage(" Build Application" ){
13
- steps {
14
- nodejs(nodeJSInstallationName : ' nodejs' ) {
15
- bat ' npm install'
16
- bat ' npm run build'
17
- }
18
- }
19
- }
20
- stage(" Dockerize Application" ){
21
- steps {
22
- bat ' docker build -t webapp .'
23
- bat ' docker images'
24
- }
25
- }
26
- stage(" Push To DockerHub" ){
27
- steps {
28
- withCredentials ([
29
- usernamePassword(credentialsId : ' docker-cred' ,
30
- usernameVariable : " USERNAME" ,
31
- passwordVariable : " PASSWORD"
32
- )]) {
33
- bat ' docker login --username $USERNAME -- password PASSWORD'
34
- bat ' docker push webapp:dev'
35
- }
36
- }
37
- }
38
- stage(" Push To Github" ){
39
- steps {
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
- withCredentials([gitUsernamePassword(credentialsId : ' gh-cred' , gitToolName : ' Default' )]) {
46
- bat " git push -u origin HEAD:jenkins"
47
- }
48
- }
49
- }
50
- stage(" Push To EC2" ){
51
- steps {
12
+ // stage("Build Application"){
13
+ // steps {
14
+ // nodejs(nodeJSInstallationName: 'nodejs') {
15
+ // bat 'npm install'
16
+ // bat 'npm run build'
17
+ // }
18
+ // }
19
+ // }
20
+ // stage("Dockerize Application"){
21
+ // steps {
22
+ // bat 'docker build -t webapp .'
23
+ // bat 'docker images'
24
+ // }
25
+ // }
26
+ // stage("Push To DockerHub"){
27
+ // steps {
28
+ // withCredentials ([
29
+ // usernamePassword(credentialsId: 'docker-cred',
30
+ // usernameVariable: "USERNAME",
31
+ // passwordVariable: "PASSWORD"
32
+ // )]) {
33
+ // bat 'docker login --username $USERNAME -- password PASSWORD'
34
+ // bat 'docker push webapp:dev'
35
+ // }
36
+ // }
37
+ // }
38
+ // stage("Push To Github"){
39
+ // steps {
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
+ // withCredentials([gitUsernamePassword(credentialsId: 'gh-cred', gitToolName: 'Default')]) {
46
+ // bat "git push -u origin HEAD:jenkins"
47
+ // }
48
+ // }
49
+ // }
50
+ // stage("Push To EC2"){
51
+ // steps {
52
52
53
- }
54
- }
55
- stage(" Restart Application (PM2, Deployments)" ){
56
- steps {
53
+ // }
54
+ // }
55
+ // stage("Restart Application (PM2, Deployments)"){
56
+ // steps {
57
57
58
- }
59
- }
58
+ // }
59
+ // }
60
60
61
61
}
62
62
0 commit comments