Last active
December 2, 2016 20:38
-
-
Save Elix-x/f30b594362b94d55ca3c2e3233c9e4e1 to your computer and use it in GitHub Desktop.
Travis - Maven artifacts deployment to github pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER="<USERNAME>" | |
NAME="<NAME OF PROJECT>" | |
GROUP="<GROUP (WITH SLASHES '/' !!!)>" | |
git config --global user.email "$USER@users.noreply.github.com" | |
git config --global user.name "Travis-Maven" | |
git clone https://$USER:$GITACCESSTOKEN@github.com/$USER/$USER.github.io.git | |
mkdir -p "$USER.github.io/maven2/$GROUP/$NAME/$TRAVIS_BRANCH/" | |
cp -r "./build/libs/." "./$USER.github.io/maven2/$GROUP/$NAME/$TRAVIS_BRANCH/" | |
cd "$USER.github.io" | |
git add * | |
git commit -m "Uploading maven artifacts for $NAME for $TRAVIS_BRANCH" | |
git push | |
cd ./.. | |
rm -rf "$USER.github.io" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script allows automatic travis deployment of maven artifacts to maven repository hosted on github pages (under
maven2
).In the script, you must set
USER
,NAME
andGROUP
fields.USER
NAME
GROUP
pom
, but with slashes/
instead of dots.
With Travis, add to deployment custom script provider calling the script:
And obviously (at least i hope so), you must have a github pages repository already created on
username.github.io
.