stages: - test - cover - release - sync test:node:12: image: node:12 stage: test except: variables: - $CI_COMMIT_MESSAGE =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TAG =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TITLE =~ /^\d+.\d+.\d+$/ cache: key: node_modules policy: pull paths: - node_modules script: - npm install - npm test tags: - docker artifacts: paths: - coverage test:node:11: image: node:11 stage: test except: variables: - $CI_COMMIT_MESSAGE =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TAG =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TITLE =~ /^\d+.\d+.\d+$/ cache: key: node_modules policy: pull paths: - node_modules script: - npm install - npm test tags: - docker artifacts: paths: - coverage test:node:10: image: node:10 stage: test except: variables: - $CI_COMMIT_MESSAGE =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TAG =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TITLE =~ /^\d+.\d+.\d+$/ cache: key: node_modules policy: pull paths: - node_modules script: - npm install - npm test tags: - docker artifacts: paths: - coverage test:node:9: image: node:9 stage: test except: variables: - $CI_COMMIT_MESSAGE =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TAG =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TITLE =~ /^\d+.\d+.\d+$/ cache: key: node_modules policy: pull paths: - node_modules script: - npm install - npm test tags: - docker test:node:8: image: node:8 stage: test except: variables: - $CI_COMMIT_MESSAGE =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TAG =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TITLE =~ /^\d+.\d+.\d+$/ cache: key: node_modules policy: pull paths: - node_modules script: - npm install - npm test tags: - docker coveralls: image: node:10 dependencies: - test:node:10 - test:node:9 - test:node:8 stage: cover except: variables: - $CI_COMMIT_MESSAGE =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TAG =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TITLE =~ /^\d+.\d+.\d+$/ only: - master cache: key: node_modules policy: pull paths: - node_modules script: - npm install - npm run coveralls tags: - docker artifacts: paths: - coverage release: image: node:10 dependencies: - coveralls stage: release except: variables: - $CI_COMMIT_MESSAGE =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_BEFORE_SHA =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TAG =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TITLE =~ /^\d+.\d+.\d+$/ only: - master cache: key: node_modules policy: pull paths: - node_modules script: - npm install - git checkout . - git remote add upstream "$UPSTREAM" - git config user.email "$GITLAB_USER_EMAIL" - git config user.name "$GITLAB_USER_NAME" - npm run bump - git push upstream HEAD:master - git push upstream --tags - mv .npmrc-deploy .npmrc - npm publish tags: - docker sync: stage: sync only: refs: - master variables: - $CI_COMMIT_MESSAGE =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_BEFORE_SHA =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TAG =~ /^\d+.\d+.\d+$/ - $CI_COMMIT_TITLE =~ /^\d+.\d+.\d+$/ script: - git remote add upstream "$UPSTREAM" - git config user.email "$GITLAB_USER_EMAIL" - git config user.name "$GITLAB_USER_NAME" - git checkout dev - git pull --rebase upstream dev - git merge origin/master - git push upstream dev