@@ -31,48 +31,55 @@ node('node') {
31
31
32
32
try {
33
33
34
- stage ' Checkout'
34
+ stage( ' Checkout' ){
35
35
36
- checkout scm
36
+ checkout scm
37
+ }
37
38
38
- stage ' Test'
39
+ stage( ' Test' ){
39
40
40
- env. NODE_ENV = " test"
41
+ env. NODE_ENV = " test"
41
42
42
- print " Environment will be : ${ env.NODE_ENV} "
43
+ print " Environment will be : ${ env.NODE_ENV} "
43
44
44
- sh ' node -v'
45
- sh ' npm prune'
46
- sh ' npm install'
47
- sh ' npm test'
45
+ sh ' node -v'
46
+ sh ' npm prune'
47
+ sh ' npm install'
48
+ sh ' npm test'
48
49
49
- stage ' Build Docker'
50
+ }
51
+
52
+ stage(' Build Docker' ){
50
53
51
54
sh ' ./dockerBuild.sh'
55
+ }
56
+
57
+ stage(' Deploy' ){
52
58
53
- stage ' Deploy'
59
+ echo ' Push to Repo'
60
+ sh ' ./dockerPushToRepo.sh'
54
61
55
- echo ' Push to Repo '
56
- sh ' ./dockerPushToRepo .sh'
62
+ echo ' ssh to web server and tell it to pull new image '
63
+ sh
' ssh [email protected] running/xxxxxxx/dockerRun .sh'
57
64
58
- echo ' ssh to web server and tell it to pull new image'
59
- sh
' ssh [email protected] running/xxxxxxx/dockerRun.sh'
65
+ }
60
66
61
- stage ' Cleanup'
67
+ stage( ' Cleanup' ){
62
68
63
- echo ' prune and cleanup'
64
- sh ' npm prune'
65
- sh ' rm node_modules -rf'
69
+ echo ' prune and cleanup'
70
+ sh ' npm prune'
71
+ sh ' rm node_modules -rf'
66
72
67
- mail body : ' project build successful' ,
68
-
69
-
70
- subject : ' project build successful' ,
71
-
73
+ mail body : ' project build successful' ,
74
+
75
+
76
+ subject : ' project build successful' ,
77
+
78
+ }
72
79
73
- }
74
80
75
81
82
+ }
76
83
catch (err) {
77
84
78
85
currentBuild. result = " FAILURE"
0 commit comments