image: d.sphd.io/act/island-node-build:10.13.0 stages: - test - publish .npmrc: before_script: - echo "_auth=${NPM_TOKEN}" >> ~/.npmrc && \ - echo "email=${NPM_EMAIL}" >> ~/.npmrc && \ - echo "@island:registry=https://artifactory.ea.com/artifactory/api/npm/act-npm-local/" >> ~/.npmrc - echo "//artifactory.ea.com/artifactory/api/npm/act-npm-local/:_password=$ARTIFACTORY_PASSWORD" >> ~/.npmrc - echo "//artifactory.ea.com/artifactory/api/npm/act-npm-local/:username=$ARTIFACTORY_USERNAME" >> ~/.npmrc - echo "//artifactory.ea.com/artifactory/api/npm/act-npm-local/:email=$ARTIFACTORY_USERNAME" >> ~/.npmrc - echo "//artifactory.ea.com/artifactory/api/npm/act-npm-local/:always-auth=true" >> ~/.npmrc job-test: stage: test services: - rabbitmq extends: .npmrc variables: RABBITMQ_HOST: amqp://rabbitmq:5672 ISLAND_LOGGER_LEVEL: crit script: - npm install - npm run coverage - export PROJECT_NAME=$(grep "name" package.json | head -1 | awk -F':' '{ print $2 }' | sed 's/[",]//g' | sed -e 's/^[[:space:]]*//' | cut -d"/" -f2) - sonar-scanner -Dsonar.projectKey=${PROJECT_NAME} -Dsonar.projectName=${PROJECT_NAME} -Dsonar.sources=src -Dsonar.language=ts -Dsonar.sourceEncoding=UTF-8 -Dsonar.exclusions=src/spec/** -Dsonar.host.url=http://apseo-qe-sonar.aaa.ad.ea.com -Dsonar.login=15374756ca89cb72deab160e4fa4fd4e33daa134 -Dsonar.typescript.lcov.reportPaths=$(pwd)/coverage/lcov-remap.info -Dsonar.projectVersion=$(grep "version" package.json | grep -Eo '"[0-9]+.*"' | grep -Eo '[^"]+') coverage: '/Branches\s+:\s+\d+.\d+\%/' .publish: stage: publish when: manual extends: .npmrc publish:schedule: extends: .publish when: always only: refs: - schedules changes: - package.json - src/**/* script: - curl -o- https://gist.githubusercontent.com/heycalmdown/01be82234785265302d8cc49c913bee8/raw | node - npm i - npm run build - npm publish --tag next publish:edge-lts: extends: .publish only: refs: - /.*edge-lts$/ script: - npm i - npm run build - npm publish --tag edge-lts publish:test: extends: .publish except: refs: - master - /^release-.*$/ script: - npm i - npm run build - npm publish --tag test publish:dev: extends: .publish except: refs: - master - /^release-.*$/ script: - npm i - npm run build - npm publish --tag dev publish:rc: extends: .publish only: refs: - /^release-.*$/ script: - npm i - npm run build - npm publish --tag rc publish:latest: extends: .publish only: refs: - /^release-.*$/ script: - npm i - npm run build - npm publish --tag latest publish:next: extends: .publish only: refs: - master script: - curl -o- https://gist.githubusercontent.com/heycalmdown/01be82234785265302d8cc49c913bee8/raw | node - npm i - npm run build - npm publish --tag next