Skip to content

Instantly share code, notes, and snippets.

@seogi1004
Created January 30, 2019 15:13
Show Gist options
  • Save seogi1004/6bb0dc896679a9e5296cf2a68b3dec9a to your computer and use it in GitHub Desktop.
Save seogi1004/6bb0dc896679a9e5296cf2a68b3dec9a to your computer and use it in GitHub Desktop.
- stage: patch
language: java
jdk: openjdk8
before_script:
# pom.xml이 변경되지 않았다면 프로세스를 종료함
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep 'pom.xml'
then
echo "Not running CI since only docs were changed."
exit
fi
script:
- POM_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
- echo $POM_VERSION
after_success:
- git config --global user.name "alvin.h"
- git config --global user.email "[email protected]"
- git checkout $TRAVIS_BRANCH
- git remote remove origin
- git remote add origin https://seogi1004:[email protected]/$TRAVIS_REPO_SLUG.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