This repository has been archived by the owner on Jul 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
/
travis-build.sh
executable file
·44 lines (38 loc) · 1.64 KB
/
travis-build.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
rm -rf *.zip
# TODO: Determine why this fails on Travis with an exit code of 137
#./gradlew acceptanceTest -P grailsVersions=3.0.17,3.1.7 --stacktrace --info
./gradlew clean spring-security-oauth2-provider:build
./gradlew spring-security-oauth2-provider:gdocs --stacktrace
cd spring-security-oauth2-provider/build/libs
filename=$(find . -name "*.jar" | grep -v javadoc | grep -v sources | head -1)
filename=$(basename $filename)
plugin=${filename/spring-security-oauth2-provider-/}
plugin=${plugin/.jar/}
plugin=${plugin/-SNAPSHOT/}
version="${plugin#*-}";
plugin=${plugin/"-$version"/}
cd ../../..
if [ $TRAVIS_PULL_REQUEST == 'false' ]; then
echo "Publishing plugin grails-spring-security-oauth2-provider with version $version"
if [[ $filename != *-SNAPSHOT* && $TRAVIS_REPO_SLUG == 'bluesliverx/grails-spring-security-oauth2-provider' ]]; then
git config --global user.name "$GIT_NAME"
git config --global user.email "$GIT_EMAIL"
git config --global credential.helper "store --file=~/.git-credentials"
echo "https://$GITHUB_TOKEN:@github.com" > ~/.git-credentials
git clone https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG.git -b gh-pages gh-pages --single-branch > /dev/null
cd gh-pages
git rm -rf v3/*
cp -rp ../spring-security-oauth2-provider/build/docs/. v3/
git add *
git commit -a -m "Updating 3.x docs for Travis build: https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID"
git push origin HEAD
cd ..
rm -rf gh-pages
# Publish plugin
./gradlew spring-security-oauth2-provider:bintrayUpload --stacktrace
else
echo "Not doing a release, so not publishing"
fi
fi