From cefbed217e1c7f264c1262852b07ebcb1b0da768 Mon Sep 17 00:00:00 2001 From: Daniel_I_Am Date: Thu, 20 Aug 2020 15:00:22 +0200 Subject: [PATCH] Enable automatic tagging in the CI pipeline #patch --- .gitlab-ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64a8605..397bb11 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,7 +41,14 @@ version: - docker - hawkeye script: - - 'apk add git' + - 'apk add git grep npm' + - 'npm install -g semver' + - 'mkdir -p ~/.ssh/' + - 'echo $GITLAB_DEPLOY_KEY > ~/.ssh/id_rsa' + - 'chmod 600 ~/.ssh/id_rsa' + - 'ssh-keyscan -p 2302 git.chaoticlogic.us >> ~/.ssh/known_hosts' + - 'git tag $(semver -i $( (git log -1 --pretty=%B | grep -oP "(?<=#)(patch|minor|major)" || echo "patch") | head -1) $(git tag --list | sort -rV | head -1))' + - 'git push --tags' - 'git describe --tags | tr -d "\n" > version' artifacts: paths: