UNPKG

@dbp-topics/dualdelivery

Version:

[GitLab Repository](https://gitlab.tugraz.at/dbp/dual-delivery/dualdelivery) | [npmjs package](https://www.npmjs.com/package/@dbp-topics/dualdelivery) | [Unpkg CDN](https://unpkg.com/browse/@dbp-topics/dualdelivery/) | [Dual Delivery Bundle](https://gitla

108 lines (96 loc) 2.39 kB
image: registry.gitlab.tugraz.at/dbp/dual-delivery/dualdelivery/main:v1 cache: key: $CI_PROJECT_PATH paths: - _yarn_cache before_script: - 'git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.tugraz.at/".insteadOf "git@gitlab.tugraz.at:"' - git submodule sync - git submodule update --init - yarn config set cache-folder "$CI_PROJECT_DIR/_yarn_cache" stages: - test - deploy - e2e test: stage: test script: - yarn install - APP_ENV=development yarn run build - yarn run test-full linting: stage: test allow_failure: true script: - yarn install - yarn run lint publish: stage: deploy only: refs: - master script: # https://www.npmjs.com/settings/dbp-deploy/tokens # NPM_TOKEN needs to be a "Publish" token with 2FA disabled! - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc - yarn install - yarn run build - yarn run publish .deploy_defaults: &deploy_defaults except: - schedules stage: deploy script: # Add ssh key - mkdir -p ~/.ssh - echo "${DEPLOY_KEY}" | tr -d '\r' > ~/.ssh/id_rsa - chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa - ssh-keyscan -t rsa "${DEPLOY_HOST}" >> ~/.ssh/known_hosts # Deploy - dep deploy "${CI_ENVIRONMENT_NAME}" - echo "Deployed to ${CI_ENVIRONMENT_URL}" # Simple health check - curl --max-time 10 --retry 3 --output /dev/null --silent --show-error --fail --location "${CI_ENVIRONMENT_URL}" deploy_demo: only: refs: - demo environment: name: demo url: https://dbp-demo.tugraz.at/apps/dualdelivery variables: DEPLOY_HOST: vpu01-demo.tugraz.at DEPLOY_KEY: "$DEPLOY_SSH_KEY" <<: *deploy_defaults deploy_development: only: refs: - master environment: name: development url: https://dbp-dev.tugraz.at/apps/dualdelivery variables: DEPLOY_HOST: mw01-dev.tugraz.at DEPLOY_KEY: "$DEPLOY_SSH_KEY" <<: *deploy_defaults deploy_production: only: refs: - production environment: name: production url: https://dualdelivery.tugraz.at variables: DEPLOY_HOST: mw01-prod.tugraz.at DEPLOY_KEY: "$DEPLOY_SSH_KEY" <<: *deploy_defaults e2e_tests: only: refs: - master variables: E2E_PROJECT: dual-delivery stage: e2e trigger: project: dbp/e2e-tests strategy: depend