Commit 66456451 authored by Sam Galson's avatar Sam Galson

add cd pipeline

parent 2a2a5c19
Pipeline #3840 failed with stages
in 16 seconds
**/_build
**/node_modules
**/coverage
image: tamlyn/headless-nodejs
variables:
IMAGE_ORG: pubsweet
IMAGE_NAME: starter
BASE_DOMAIN: gateway.ps.semioticsquares.com
CONFIGURATION_REPOSITORY: https://gitlab.coko.foundation/pubsweet/deployment-config.git
before_script:
- yarn
stages:
- build
- test
- review
- staging
- demo
test-chrome:
build:
image: docker:latest
stage: build
script:
- npx testcafe 'chrome:headless --no-sandbox' test/**/*.test.js
- docker version
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- echo "Ignore warning! Cannot perform an interactive login from a non TTY device"
- docker build -t $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA .
- docker push $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
test:chrome:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: test
variables:
GIT_STRATEGY: none
NODE_ENV: test
test-firefox:
script:
- npx testcafe firefox:headless test/**/*.test.js
- cd ${HOME}
- npx testcafe 'chrome:headless --no-sandbox' test/**/*.test.js
test:firefox:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: test
variables:
GIT_STRATEGY: none
NODE_ENV: test
script:
- cd ${HOME}
- npx testcafe firefox:headless test/**/*.test.js
lint:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: test
variables:
GIT_STRATEGY: none
script:
- cd ${HOME}
- npm run lint
review:
image: xpub/deployer:latest
stage: review
variables:
PACKAGE_NAME: starter
environment:
name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME
# !! kube-lego will fail if domain > 63 chars
url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
on_stop: stop_review
except:
- master
script:
- source deploy.sh
- create_deployment
stop_review:
image: xpub/deployer:latest
stage: review
variables:
PACKAGE_NAME: starter
GIT_STRATEGY: none
environment:
name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME
action: stop
when: manual
except:
- master
script:
- source deploy.sh
- delete_deployment
staging:
image: xpub/deployer:latest
stage: staging
variables:
PACKAGE_NAME: starter
environment:
name: $PACKAGE_NAME/staging
url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
only:
- master
script:
- source deploy.sh
- create_deployment
demo:
image: xpub/deployer:latest
stage: demo
variables:
PACKAGE_NAME: starter
environment:
name: $PACKAGE_NAME/demo
url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
when: manual
script:
- source deploy.sh
- create_deployment
FROM pubsweet/pubsweet:base
# For e2e tests with testcafe
RUN apt-get install -y firefox google-chrome-stable
COPY package.json yarn.lock ./
COPY lerna.json .eslintignore .eslintrc .prettierrc .stylelintignore .stylelintrc ./
COPY packages packages
ENV NODE_ENV "production"
RUN [ "yarn", "install", "--frozen-lockfile" ]
# Remove cache and offline mirror
RUN [ "yarn", "cache", "clean"]
RUN [ "rm", "-rf", "/npm-packages-offline-cache"]
RUN [ "npx", "pubsweet", "build"]
EXPOSE 3000
CMD []
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment