Example include:
include:
- remote: 'https://raw.githubusercontent.com/miquido/gitlab-templates/1.3.54/workflow-default.yml'
- remote: 'https://raw.githubusercontent.com/miquido/gitlab-templates/1.3.54/terraform-toolkit.yml'
- remote: 'https://raw.githubusercontent.com/miquido/gitlab-templates/1.3.54/git-toolkit.yml'
- remote: 'https://raw.githubusercontent.com/miquido/gitlab-templates/1.3.54/html-dynamic-env.yml'
Pay attention that include files points to public github repository not private gitlab repository.
Writes commit messages that are present from the previous build. (using CI_COMMIT_BEFORE_SHA
variable)
include:
- remote: 'https://raw.githubusercontent.com/miquido/gitlab-templates/1.3.54/git-toolkit.yml
changelog:
extends: .simple_changelog
read-changelog:
stage: .post
script:
- cat changelog.txt
tags:
- miquido
- docker
Using git-chglog Will generate rich changelog with grouped commits. It provides also jira integration
To take advantage of changelog features, commit headers must match:
feat(core)[XD-42]: Added feature
where
feat
is type of commitcore
is a scope of commitXD-42
is a jira issue idAdded feature
is a subject of the commit.
Every element can be ommited so commit message could have no jira issue or scope attached. For example:
fix: Fixed bug
Usage:
To provide what should be included into changelog, please provide TAG_QUERY
format
latest-changelog:
extends: .changelog
variables:
# Changelog filepath. Will be exposed as artifact. Defaults: CHANGELOG.md
CHANGELOG_FILE: "CHANGELOG.md"
# Set for what commits should the changelog be generated. Defaults: empty
TAG_QUERY: $CI_COMMIT_TAG
# For jira integration
JIRA_URL: https://miquido.atlassian.net
JIRA_USERNAME: [email protected]
JIRA_TOKEN: <jira_access_token>
If CHANGELOG.md
is modified and present in job artifacts, it can be automatically push on the main branch.
it produces commit message ending with [skip-ci]
To prevent running gitlab CI for this commit, plese add such workfow to your .gitlab-ci.yml
workflow:
rules:
- if: $CI_COMMIT_MESSAGE =~ /^.*\[skip-ci\]$/
when: never
Usage:
push-changelog:
extends: .push-changelog
It takes file RELEASE_DESCRIPTION_FILE
and creates A release from CI_COMMIT_TAG
. It runs only on tags by default
Usage:
gitlab-release:
extends: .gitlab-release
variables:
# Optional. Adds link entry into release
LINK_NAME: "Pypi"
LINK_URL: "https://pypi.org/project/miquido-gitlab-releaser/$CI_COMMIT_TAG/"
# File that has a release description. Defaults to CHANGELOG.md
RELEASE_DESCRIPTION_FILE: CHANGELOG.md