This repository has been archived by the owner on Nov 23, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
travis.sh
executable file
·52 lines (46 loc) · 1.73 KB
/
travis.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
45
46
47
48
49
50
51
52
#!/bin/bash
set -e
rm -rf *.zip
./bowerize.sh
./gradlew build grails2:gdocs
filename=$(find . -name "grails-*.zip" | head -1)
filename=$(basename $filename)
echo "Publishing plugin 'swaggydoc' version $version"
if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_REPO_SLUG == "rahulsom/swaggydoc" \
&& $TRAVIS_PULL_REQUEST == 'false' ]]; 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://$GH_TOKEN:@github.com" > ~/.git-credentials
if [[ $filename != *-SNAPSHOT* ]]; then
git clone https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG.git -b gh-pages \
gh-pages --single-branch > /dev/null
cd gh-pages
git rm -rf *
cp -r ../grails2/build/docs/manual/* .
git add *
git commit -a -m "Updating docs for Travis build: https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID"
git push origin HEAD
cd ..
rm -rf gh-pages
else
echo "SNAPSHOT version, not publishing docs"
fi
cat >> ~/.grails/settings.groovy << EOF
grails.project.repos.grailsCentral.username='${GRAILS_CENTRAL_USERNAME}'
grails.project.repos.grailsCentral.password='${GRAILS_CENTRAL_PASSWORD}'
EOF
./gradlew \
swaggydoc-commons:bintrayUpload \
swaggydoc-grails3:bintrayUpload \
--info || echo "Bintray upload failed"
./gradlew \
-PgrailsArgs='--no-scm --allow-overwrite --non-interactive' \
grails2:grails-publish-plugin \
--info || echo "Grails2 upload failed"
else
echo "Not on master branch, so not publishing"
echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
echo "TRAVIS_REPO_SLUG: $TRAVIS_REPO_SLUG"
echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST"
fi