diff --git a/Dockerfile b/Dockerfile index f1a9c39..a29af0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/playwright:v1.34.0-jammy as build +FROM node:18-alpine as build ENV DUMP_CHROME_OUT=true ENV TEST_CHROME_ARGS='--no-sandbox --disable-dev-shm-usage --disable-gpu --disable-gpu-compositing --disable-gpu-rasterization' @@ -15,6 +15,11 @@ RUN npm run build:server ARG PROJECTS_FILE='' RUN [ -e "$PROJECTS_FILE" ] && cp -f "$PROJECTS_FILE" build/projects.json || true +FROM mcr.microsoft.com/playwright:v1.37.0-jammy as e2e + +WORKDIR /app +COPY --from=build /app /app + FROM node:18-alpine WORKDIR /app diff --git a/Jenkinsfile b/Jenkinsfile index 7fd2ac7..5a889d8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,7 @@ pipeline { GOOGLE_CLIENT_ID = credentials('GOOGLE_CLIENT_ID') GOOGLE_CLIENT_SECRET = credentials('GOOGLE_CLIENT_SECRET') COOKIE_SECRET = credentials('COOKIE_SECRET') + PROJECT_GITHUB = credentials('PROJECT_GITHUB') } stages { @@ -21,7 +22,8 @@ pipeline { } stage('E2E Test') { steps { - sh 'docker run ${REPO_NAME}_build e2e/run.sh' + sh 'docker build --target e2e -t ${REPO_NAME}_e2e .' + sh 'docker run ${REPO_NAME}_e2e e2e/run.sh' } } stage('Build final') { diff --git a/e2e/run.sh b/e2e/run.sh index 6f89abc..e1e49a7 100755 --- a/e2e/run.sh +++ b/e2e/run.sh @@ -2,8 +2,7 @@ cd `dirname $0` -npm ci -npx playwright install-deps +# npx playwright install-deps cp -r i18n ../build cd ../build