-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.travis_publish
28 lines (24 loc) · 1011 Bytes
/
.travis_publish
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
28
#!/bin/bash
set -e # Exit with nonzero exit code if anything fails
# save current path
REPO_PATH=$PWD
# Save some useful information
SHA=`git rev-parse --verify HEAD`
# Clone the existing gh-pages for this repo into $HOME/gh-pages/
# Create a new empty branch if gh-pages doesn't exist yet (should only happen on first deploy)
cd $HOME
git config --global user.email "[email protected]"
git config --global user.name "travis-ci"
git clone --quiet --branch=master https://${GH_PAGES_DEPLOY}@github.com/camel-tooling/camel-lsp-client-eclipse-update-site.git gh-pages > /dev/null
cd gh-pages
# delete existing data
rm -Rf updatesite/${DEPLOY_REPO_ROOT}/
# copy new data
cp -r $REPO_PATH/com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite .
# Commit and Push the Changes
git add -f .
git status
git commit -m "Deploy ${DEPLOY_REPO_ROOT} update site to GitHub Pages: ${SHA} from travis build $TRAVIS_BUILD_NUMBER"
git push -fq origin master > /dev/null
# return to original path
cd $REPO_PATH