File tree 2 files changed +43
-7
lines changed
2 files changed +43
-7
lines changed Original file line number Diff line number Diff line change 5
5
before_install :
6
6
- " export DISPLAY=:99.0"
7
7
- " 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`"
8
10
script : mvn clean verify
9
11
jdk :
10
12
- oraclejdk8
@@ -16,6 +18,14 @@ after_success:
16
18
- if [[ $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_BRANCH == "master" ]]; then
17
19
mvn sonar:sonar -Dsonar.login=${SONAR_TOKEN} -Dsonar.projectKey="camel-lsp-client-eclipse" -Dsonar.projectName="Eclipse Client for Apache Camel Language Server";
18
20
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}/
19
29
addons :
20
30
sonarcloud :
21
31
organization : " camel-tooling"
@@ -24,17 +34,15 @@ addons:
24
34
deploy :
25
35
- provider : releases
26
36
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
28
38
skip_cleanup : true
29
39
overwrite : true
30
40
on :
31
41
branch : master
32
- - provider : pages
42
+ - provider : script
43
+ script : bash .travis_publish
33
44
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
38
46
on :
39
- branch : master
47
+ all_branches : true
40
48
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments