stages: - install - test - build - deploy - deploy-beta cache: key: ${CI_COMMIT_REF_SLUG} paths: - node_modules/ install_node_modules: stage: install tags: - nodejs script: - npm install ts_lint: stage: test tags: - nodejs script: - npm install - node_modules/tslint/bin/tslint -c tslint.json -p tsconfig.json npm_test: stage: test allow_failure: true tags: - nodejs script: - npm install - export NODE_ENV='test' - node_modules/nyc/bin/nyc.js --reporter=text node_modules/mocha/bin/mocha --opts src/tests/mocha.opts build: stage: build only: - master - beta tags: - nodejs script: - npm install - export NODE_ENV='production' - export ARSNOVA_CLICK_BACKEND_PORT_INTERNAL='3000' - export ARSNOVA_CLICK_BACKEND_ROUTE_PREFIX='/backend' - export LEADERBOARD_ALGORITHM='PointBased' - npm run build:PROD - cp package.json dist artifacts: paths: - dist deploy: stage: deploy only: - master tags: - rsync dependencies: - build script: - chmod -R a+rX,ug+w . - eval $(ssh-agent -s) - mkdir ~/.ssh - ssh-keyscan "$STAGING_BACKEND_URL" >> ~/.ssh/known_hosts - ssh-add <(echo "$STAGING_SSH_PRIVATE_KEY") - rsync -rltgoDqv --delete -e "ssh" dist/* "$STAGING_BACKEND_SSH_URL" - ssh $NEW_PRODUCTION_SSH 'touch /home/arsnova/arsnova.click-v2/backend/deploy.touch' deploy-beta: stage: deploy-beta only: - beta tags: - rsync dependencies: - build script: - chmod -R a+rX,ug+w . - eval $(ssh-agent -s) - mkdir ~/.ssh - ssh-keyscan "$STAGING_BACKEND_URL" >> ~/.ssh/known_hosts - ssh-add <(echo "$STAGING_SSH_PRIVATE_KEY") - rsync -rltgoDqv --delete -e "ssh" dist/* "$BETA_BACKEND_SSH_URL" - ssh $NEW_PRODUCTION_SSH 'touch /home/arsnova/arsnova.click-v2-beta/backend/deploy.touch'