Skip to content

Commit fc2efa8

Browse files
committed
FUSETOOLS2-880 - publish update site
Signed-off-by: Aurélien Pupier <[email protected]>
1 parent c2bb95c commit fc2efa8

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.circleci/config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
find website/* -name 'index.html' | xargs perl -pi -e "s/##VERSION##/${PLUGIN_VERSION}/g"
3838
find website/* -name 'index.html' | xargs perl -pi -e "s/##TYPE##/${DEPLOY_REPO_ROOT}/g"
3939
cp -v website/index.html com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite/${DEPLOY_REPO_ROOT}/
40+
- run:
41+
name: Publish update site
42+
command: bash .circleci/publish.sh
4043
- store_artifacts:
4144
name: Store update site
4245
path: com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite/

.circleci/publish.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
set -e # Exit with nonzero exit code if anything fails
3+
4+
# save current path
5+
REPO_PATH=$PWD
6+
7+
# Save some useful information
8+
SHA=`git rev-parse --verify HEAD`
9+
10+
# Clone the existing gh-pages for this repo into $HOME/gh-pages/
11+
# Create a new empty branch if gh-pages doesn't exist yet (should only happen on first deploy)
12+
cd $HOME
13+
git config --global user.email "[email protected]"
14+
git config --global user.name "circle-ci"
15+
git clone --quiet --branch=master https://${GH_PAGES_DEPLOY}@github.com/camel-tooling/camel-lsp-client-eclipse-update-site.git gh-pages > /dev/null
16+
cd gh-pages
17+
18+
# delete existing data
19+
rm -Rf updatesite/${DEPLOY_REPO_ROOT}/
20+
# copy new data
21+
cp -r $REPO_PATH/com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite .
22+
# Commit and Push the Changes
23+
git add -f .
24+
git status
25+
git commit -m "Deploy ${DEPLOY_REPO_ROOT} update site to GitHub Pages: ${CIRCLE_SHA1} from Circle CI build $CIRCLE_BUILD_NUM"
26+
git push -fq origin master > /dev/null
27+
# return to original path
28+
cd $REPO_PATH

0 commit comments

Comments
 (0)