Skip to content

Instantly share code, notes, and snippets.

@seogi1004
Created January 30, 2019 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seogi1004/3f908d9cb13b4bb27002c99957db7a8b to your computer and use it in GitHub Desktop.
Save seogi1004/3f908d9cb13b4bb27002c99957db7a8b to your computer and use it in GitHub Desktop.
Patch:
image: maven:3.3.9
only:
changes:
- "pom.xml"
stage: patch
before_script:
- POM_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
- echo $POM_VERSION
script:
- git config --global user.name "alvin.h"
- git config --global user.email "seogi777@gmail.com"
- git checkout $CI_COMMIT_REF_NAME
- git remote remove origin
- git remote add origin https://alvin.h:$GIT_TOKEN@gitlab.com/$CI_PROJECT_PATH.git
- git tag -a $POM_VERSION -m "Version created by gitlab-ci Build"
- git push origin --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment