1- #! groovy
1+ currentBuild . description = " Image Tag: ${ DOCKER_IMAGE_TAG } "
22
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 {
711 deleteDir()
812 dir(' scm' ){
913 checkout scm
@@ -12,7 +16,9 @@ timestamps {
1216 git branch : SOLR_HOME_BRANCH , url : SOLR_HOME_GIT_URL
1317 }
1418 }
15- stage(' BUILD' ) {
19+ }
20+ stage(' BUILD' ) {
21+ steps {
1622 dir(' scm' ) {
1723 // Build the docker image, push to aws
1824 sh """
@@ -26,7 +32,9 @@ timestamps {
2632 """
2733 }
2834 }
29- stage(' UNDEPLOY_EXISTING' ) {
35+ }
36+ stage(' UNDEPLOY_EXISTING' ) {
37+ steps {
3038 // Remove if exists: working directory, docker containers, and images
3139 sh """
3240 ssh -i ${ EC2_INSTANCE_SSH_KEY} ${ EC2_INSTANCE_USER} @${ EC2_INSTANCE_HOST} \"\"\"
@@ -43,7 +51,9 @@ timestamps {
4351 \"\"\"
4452 """
4553 }
46- stage(' DEPLOY' ) {
54+ }
55+ stage(' DEPLOY' ) {
56+ steps {
4757 // Create the working directory
4858 sh """
4959 ssh -i ${ EC2_INSTANCE_SSH_KEY} ${ EC2_INSTANCE_USER} @${ EC2_INSTANCE_HOST} "mkdir -p ref-store-service"
@@ -73,17 +83,17 @@ timestamps {
7383 docker-compose up -d
7484 \"\"\"
7585 """
76-
77- currentBuild. description = " Image Tag: ${ DOCKER_IMAGE_TAG} "
7886 }
79- stage(' TEST' ) {
87+ }
88+ stage(' TEST' ) {
89+ steps {
8090 // Run unit & Puppeteer tests
8191 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'
8595 \"\"\"
86- """
96+ """
8797 }
8898 }
8999 }
0 commit comments