stages: - release .init_git_bot_template: &init_git_bot # Install ssh-agent if not already installed, it is required by Docker. - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' # Run ssh-agent (inside the build environment) - eval $(ssh-agent -s) # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store - echo "${BOT_SSH_PRIVATE_KEY}" | ssh-add - # For Docker builds disable host key checking. Be aware that by adding that # you are suspectible to man-in-the-middle attacks. # WARNING: Use this only with the Docker executor, if you use it with shell # you will overwrite your user's SSH config. - mkdir -p ~/.ssh - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - git config --global user.name "${BOT_GIT_NAME}" - git config --global user.email "${BOT_GIT_EMAIL}" - git clone git@gitlab.com:lowl-notify/api-client-js.git - cd api-client-js major-release: stage: release image: registry.gitlab.com/lowl/node-testing:latest before_script: *init_git_bot script: - npm version major # - git push origin master - git push origin --tags only: - master when: manual tags: - docker minor-release: stage: release image: registry.gitlab.com/lowl/node-testing:latest before_script: *init_git_bot script: - npm version minor # - git push origin master - git push origin --tags only: - master when: manual tags: - docker patch-release: stage: release image: registry.gitlab.com/lowl/node-testing:latest before_script: *init_git_bot script: - npm version patch # - git push origin master - git push origin --tags only: - master when: manual tags: - docker npm-release: stage: release image: registry.gitlab.com/lowl/node-testing:latest before_script: *init_git_bot script: - echo '//registry.npmjs.org/:_authToken=${BOT_NPM_TOKEN}'>.npmrc - npm publish --access public only: - tags tags: - docker