Skip to content

Instantly share code, notes, and snippets.

@jtbonhomme
Last active July 22, 2019 11:34
Show Gist options
  • Save jtbonhomme/eeb3808369698da0203fe83259c212ef to your computer and use it in GitHub Desktop.
Save jtbonhomme/eeb3808369698da0203fe83259c212ef to your computer and use it in GitHub Desktop.
Gitlab-CI release job
.release-script: &release-script
- # this part allow the script to push tags on gitlab repos
- git remote set-url origin "https://${REGISTRY_USER}:${REGISTRY_TOKEN}@${GITLAB_URL}/${CI_PROJECT_PATH}.git"
- git config --global user.email '${REGISTRY_USER}@${DOMAIN}'
- git config --global user.name '${REGISTRY_USER}'
- # this part uses commit messages and semantic versioning to define a version number
- DEBUG=* semantic-release
- git push --tags || true
release:
image: ${REGISTRY_URL}/release:latest
stage: release
only:
- master
tags:
- docker
script: *release-script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment