-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtravis.sh
27 lines (26 loc) · 1.04 KB
/
travis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
echo $GPG_KEYID | cut -c 1-2 ; echo ...; echo $GPG_KEYID | cut -c 3-
if [[ ${TRAVIS_BRANCH} == 'master' ]]
then
echo "Building Maven Site and deploying to GitHub pages"
mvn site:site
# mvn site used to do this, but now API rate limiting makes it a non starter
cd target/site
git config --global user.email "Travis CI"
git config --global user.name "[email protected]"
echo "Creating repo"
git init
echo "Adding remote"
git remote add origin "[email protected]:${TRAVIS_REPO_SLUG}"
echo "Adding all the files"
git add .
echo "Committing"
git commit -m "Update GitHub Pages"
echo "Extracting Keys"
mkdir -p .ssh
echo ${GPG_KEY} > tmp.txt && gpg --batch --passphrase-fd 3 3<tmp.txt --output .ssh/java-powerpoint-report-deploy-key --decrypt ../../java-powerpoint-report-deploy-key.gpg
chmod go-rw -R .ssh
echo 'ssh -i '${PWD}'/.ssh/java-powerpoint-report-deploy-key "$@"' > git-ssh-wrapper
chmod +x git-ssh-wrapper
echo "Pushing"
GIT_SSH="${PWD}/git-ssh-wrapper" git push --force origin master:gh-pages
fi