1
- #! groovy
1
+ currentBuild . description = " Image Tag: ${ DOCKER_IMAGE_TAG } "
2
2
3
- timestamps {
4
- ansiColor(' xterm' ) {
5
- node(' node-small' ) {
6
- stage(' SETUP' ) {
3
+ pipeline {
4
+ agent {
5
+ label ' node-small'
6
+ }
7
+
8
+ stages {
9
+ stage(' SETUP' ) {
10
+ steps {
7
11
deleteDir()
8
12
dir(' scm' ){
9
13
checkout scm
@@ -12,7 +16,9 @@ timestamps {
12
16
git branch : SOLR_HOME_BRANCH , url : SOLR_HOME_GIT_URL
13
17
}
14
18
}
15
- stage(' BUILD' ) {
19
+ }
20
+ stage(' BUILD' ) {
21
+ steps {
16
22
dir(' scm' ) {
17
23
// Build the docker image, push to aws
18
24
sh """
@@ -26,7 +32,9 @@ timestamps {
26
32
"""
27
33
}
28
34
}
29
- stage(' UNDEPLOY_EXISTING' ) {
35
+ }
36
+ stage(' UNDEPLOY_EXISTING' ) {
37
+ steps {
30
38
// Remove if exists: working directory, docker containers, and images
31
39
sh """
32
40
ssh -i ${ EC2_INSTANCE_SSH_KEY} ${ EC2_INSTANCE_USER} @${ EC2_INSTANCE_HOST} \"\"\"
@@ -43,7 +51,9 @@ timestamps {
43
51
\"\"\"
44
52
"""
45
53
}
46
- stage(' DEPLOY' ) {
54
+ }
55
+ stage(' DEPLOY' ) {
56
+ steps {
47
57
// Create the working directory
48
58
sh """
49
59
ssh -i ${ EC2_INSTANCE_SSH_KEY} ${ EC2_INSTANCE_USER} @${ EC2_INSTANCE_HOST} "mkdir -p ref-store-service"
@@ -73,17 +83,17 @@ timestamps {
73
83
docker-compose up -d
74
84
\"\"\"
75
85
"""
76
-
77
- currentBuild. description = " Image Tag: ${ DOCKER_IMAGE_TAG} "
78
86
}
79
- stage(' TEST' ) {
87
+ }
88
+ stage(' TEST' ) {
89
+ steps {
80
90
// Run unit & Puppeteer tests
81
91
timeout(time : 10 , unit : ' MINUTES' ) {
82
- sh """
83
- ssh -i ${ EC2_INSTANCE_SSH_KEY} ${ EC2_INSTANCE_USER} @${ EC2_INSTANCE_HOST} \"\"\"
84
- sleep 35 && docker exec -t store sh -c 'export TEST_HOST=http://${ EC2_INSTANCE_HOST} :8080 && CI=true npm test'
92
+ sh """
93
+ ssh -i ${ EC2_INSTANCE_SSH_KEY} ${ EC2_INSTANCE_USER} @${ EC2_INSTANCE_HOST} \"\"\"
94
+ sleep 35 && docker exec -t store sh -c 'export TEST_HOST=http://${ EC2_INSTANCE_HOST} :8080 && CI=true npm test'
85
95
\"\"\"
86
- """
96
+ """
87
97
}
88
98
}
89
99
}
0 commit comments