From 0ce434e348435b3a9896e2324c6df110d1d95bd3 Mon Sep 17 00:00:00 2001 From: razvanMiu Date: Thu, 7 Jan 2021 11:37:20 +0200 Subject: [PATCH] Updated Jenkinsfile --- Jenkinsfile | 2 +- entrypoint-prod.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f1b4f5c..f011a336 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,7 +61,7 @@ pipeline { sh '''docker pull eeacms/eprtr-frontend; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/eprtr-frontend cypress''' } finally { sh '''mkdir -p cypress-reports''' - sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/cypress/videos cypress-reports/''' + sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/cypress/videos cypress-reports/''' stash name: "cypress-reports", includes: "cypress-reports/**/*" archiveArtifacts artifacts: 'cypress-reports/videos/*.mp4', fingerprint: true sh '''echo "$(docker stop $BUILD_TAG-plone; docker rm -v $BUILD_TAG-plone; docker rm -v $BUILD_TAG-cypress)" ''' diff --git a/entrypoint-prod.sh b/entrypoint-prod.sh index 8455748c..f19e342c 100755 --- a/entrypoint-prod.sh +++ b/entrypoint-prod.sh @@ -23,4 +23,12 @@ function apply_path { test -n "$API_PATH" && apply_path echo "Starting Volto" + +if [[ "$1" == "cypress"* ]]; then + RAZZLE_API_PATH=$RAZZLE_API_PATH yarn start & + + cd /opt/frontend + exec bash -c "wait-on -t $TIMEOUT http://localhost:3000 && CYPRESS_API_PATH=$CYPRESS_API_PATH ./node_modules/cypress/bin/cypress run" +fi + exec "$@"