stages: - deploy - package deploy: stage: deploy only: - dev script: - 'git remote set-url origin $CI_PROJECT_URL.git' - 'git fetch' - 'git checkout -b tmp-b' - 'git checkout master' - 'git merge tmp-b' - 'git push https://gitlab-ci-token:$GIT_CI_TOKEN@gitlab.soft-artel.com/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME.git master' # - 'git push -u origin master' - 'git branch -d tmp-b' - 'git branch' tags: - sp2-dev package: stage: package only: - master script: - 'git remote set-url origin $CI_PROJECT_URL.git' - 'git fetch' - 'npm publish' - "PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')" - 'git tag "v$PACKAGE_VERSION"' - 'git push https://gitlab-ci-token:$GIT_CI_TOKEN@gitlab.soft-artel.com/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME.git --tags' # - 'git push --tags' - 'sp2-node --update' - 'sp2-bot "+ sp2-node@v$PACKAGE_VERSION"' tags: - sp2-dev