-
Notifications
You must be signed in to change notification settings - Fork 57
/
after_success.sh
executable file
·50 lines (46 loc) · 1.48 KB
/
after_success.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
#!/bin/bash
#
# Travis ci script for releasing gradle project
# Adapted from http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/
# Change this
REPO="permissions-dispatcher-plugin"
# Change if necessary
USER="permissions-dispatcher"
JDK="oraclejdk8"
BRANCH="master"
# Not handling errors
set -e
if [ "$TRAVIS_REPO_SLUG" != "$USER/$REPO" ]; then
# Check repo
echo "TRAVIS_REPO_SLUG: '$TRAVIS_REPO_SLUG' USER/REPO: '$USER/$REPO'"
elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then
# Check JDK
echo "TRAVIS_JDK_VERSION: '$TRAVIS_JDK_VERSION' JDK: '$JDK"
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
# Check how to run this script
echo "It's pull request!"
elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then
# Check branch
echo "TRAVIS_BRANCH: '$TRAVIS_BRANCH' BRANCH: '$BRANCH'"
elif [ "$IDEA_VERSION" != "LATEST-EAP-SNAPSHOT" ]; then
# Check IDEA version
echo "IDEA_VERSION: '$IDEA_VERSION'"
else
# Without snapshot
if [ -f .travis/release ]; then
echo "Start releasing..."
./gradlew publishPlugin
git checkout master
git config user.name "Travis CI"
git config user.email "isogai.shiraji@gmail.com"
git tag `cat VERSION`
git push git@github.com:${USER}/${REPO}.git `cat VERSION`
git rm .travis/release
./gradlew prepareForNextDevelopment
git add VERSION
git commit -m "[skip ci] prepare next development"
git push git@github.com:${USER}/${REPO}.git $BRANCH
else
echo "No .travis/release file"
fi
fi