Skip to content

Instantly share code, notes, and snippets.

@seogi1004
Created January 8, 2019 10:53
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/a50c779e9ffdf7dd4f3d236b97213ea9 to your computer and use it in GitHub Desktop.
Save seogi1004/a50c779e9ffdf7dd4f3d236b97213ea9 to your computer and use it in GitHub Desktop.
...
Patch:
image: maven:3.3.9
only:
changes:
- "pom.xml"
refs:
- merge_requests
stage: patch
before_script:
- POM_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
- echo $POM_VERSION
- git config --global user.name "alvin.h"
- git config --global user.email "seogi777@gmail.com"
script:
- git checkout $CI_COMMIT_REF_NAME
- git remote remove origin
- git remote add origin $CI_REPOSITORY_URL
- 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