Skip to content

Commit a8725ae

Browse files
committed
changed config to use different folders for update site
Signed-off-by: Lars Heinemann <[email protected]>
1 parent c5084ca commit a8725ae

File tree

2 files changed

+43
-7
lines changed

2 files changed

+43
-7
lines changed

.travis.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ env:
55
before_install:
66
- "export DISPLAY=:99.0"
77
- "sh -e /etc/init.d/xvfb start"
8+
- "export PLUGIN_VERSION=`grep '<version>' pom.xml -m 1 | cut -d'>' -f 2 | cut -d'<' -f 1`"
9+
- "export IS_SNAPSHOT=`grep '<version>' pom.xml -m 1 | cut -d'>' -f 2 | cut -d'<' -f 1 | cut -d'-' -f 2`"
810
script: mvn clean verify
911
jdk:
1012
- oraclejdk8
@@ -16,6 +18,14 @@ after_success:
1618
- if [[ $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_BRANCH == "master" ]]; then
1719
mvn sonar:sonar -Dsonar.login=${SONAR_TOKEN} -Dsonar.projectKey="camel-lsp-client-eclipse" -Dsonar.projectName="Eclipse Client for Apache Camel Language Server";
1820
fi
21+
- if [[ $IS_SNAPSHOT == "SNAPSHOT" ]]; then
22+
export DEPLOY_REPO_ROOT=nightly;
23+
else
24+
export DEPLOY_REPO_ROOT=stable;
25+
fi
26+
- mkdir com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite/
27+
- mkdir com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite/${DEPLOY_REPO_ROOT}/
28+
- mv com.github.camel-tooling.lsp.eclipse.updatesite/target/repository/* com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite/${DEPLOY_REPO_ROOT}/
1929
addons:
2030
sonarcloud:
2131
organization: "camel-tooling"
@@ -24,17 +34,15 @@ addons:
2434
deploy:
2535
- provider: releases
2636
api_key: ${DEPLOY_TOKEN}
27-
file: com.github.camel-tooling.lsp.eclipse.updatesite/target/com.github.camel-tooling.eclipse.updatesite-1.0.0-SNAPSHOT.zip
37+
file: com.github.camel-tooling.lsp.eclipse.updatesite/target/com.github.camel-tooling.eclipse.updatesite-${PLUGIN_VERSION}.zip
2838
skip_cleanup: true
2939
overwrite: true
3040
on:
3141
branch: master
32-
- provider: pages
42+
- provider: script
43+
script: bash .travis_publish
3344
skip_cleanup: true
34-
github_token: ${GITHUB_TOKEN}
35-
local_dir: com.github.camel-tooling.lsp.eclipse.updatesite/target/repository
36-
repo: camel-tooling/camel-lsp-client-eclipse-update-site
37-
target_branch: master
45+
overwrite: true
3846
on:
39-
branch: master
47+
all_branches: true
4048

.travis_publish

+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 deply)
12+
cd $HOME
13+
git config --global user.email "[email protected]"
14+
git config --global user.name "travis-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 to GitHub Pages: ${SHA} from travis build $TRAVIS_BUILD_NUMBER"
26+
git push -fq origin master > /dev/null
27+
# return to original path
28+
cd $REPO_PATH

0 commit comments

Comments
 (0)