Skip to content

Commit

Permalink
add variables and comments in publish.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jchampemont committed Dec 4, 2016
1 parent 87f7af4 commit 6d89a97
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/bin/bash

if [ "$TRAVIS_REPO_SLUG" == "jchampemont/jabba-framework" ] && [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
# This script is used by travis-ci to publish javadoc and versions artifacts

REPO_SLUG="jchampemont/jabba-framework"
MVN_REPO_SLUG="jchampemont/maven-repository"
JAVADOC_REPO_SLUG="jchampemont/javadoc"

if [ "$TRAVIS_REPO_SLUG" == "$REPO_SLUG" ] && [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
git config --global user.email "travis@travis-ci.org"
git config --global user.name "travis-ci"

if [ -n "$TRAVIS_TAG" ]; then
echo -e "Publishing maven artifacts...\n"
./gradlew -PghToken=$GH_TOKEN publish
cd $HOME/.gitRepos/jchampemont/maven-repository
cd $HOME/.gitRepos/$MVN_REPO_SLUG
git add .
git commit -m "Publish artifacts of $1 $TRAVIS_TAG on sucessful travis build $TRAVIS_BUILD_NUMBER"
git push
cd -
fi

Expand All @@ -18,7 +25,7 @@ if [ "$TRAVIS_REPO_SLUG" == "jchampemont/jabba-framework" ] && [ "$TRAVIS_JDK_VE
cp -R $1/build/docs/javadoc $HOME/$1-javadoc-latest

cd $HOME
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/jchampemont/javadoc gh-pages > /dev/null
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/$JAVADOC_REPO_SLUG gh-pages > /dev/null

mkdir -p gh-pages/$1
cd gh-pages/$1
Expand Down

0 comments on commit 6d89a97

Please sign in to comment.