Skip to content

Commit 1e2b2b7

Browse files
authored
Jenkins declarative pipeline (#659)
* Jenkins declarative pipeline - test declarative pipeline * - update jenkinsfile * - update wishlist test check * - fix wishlist navigation
1 parent 9e07ff5 commit 1e2b2b7

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

Jenkinsfile

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
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
}

src/tests/e2e/wishlist.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe('Wishlist', () => {
125125
// When I remove the wishlist item
126126
await page.waitForSelector(REMOVE_FROM_WISHLIST_BUTTON);
127127
await page.click(REMOVE_FROM_WISHLIST_BUTTON);
128-
await page.waitForNavigation({ waitUntil: 'domcontentloaded' });
128+
await page.waitForSelector(WISHLIST_CONTAINER);
129129

130130
// Then Lineitem is no longer in the wishlist
131131
await page.waitForSelector(LOGGED_IN_BUTTON);

0 commit comments

Comments
 (0)