forked from grails/gorm-hibernate4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-publish.sh
executable file
·36 lines (26 loc) · 1.51 KB
/
travis-publish.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
#!/bin/bash
echo "Publishing..."
EXIT_STATUS=0
if [[ $TRAVIS_REPO_SLUG == "grails/gorm-hibernate4" && $TRAVIS_PULL_REQUEST == 'false' && $EXIT_STATUS -eq 0 ]]; then
echo "Publishing archives"
export GRADLE_OPTS="-Xmx1500m -Dfile.encoding=UTF-8"
openssl aes-256-cbc -pass pass:$SIGNING_PASSPHRASE -in secring.gpg.enc -out secring.gpg -d
gpg --keyserver keyserver.ubuntu.com --recv-key $SIGNING_KEY
if [[ $TRAVIS_TAG =~ ^v[[:digit:]] ]]; then
# for releases we upload to Bintray and Sonatype OSS
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/secring.gpg" uploadArchives --no-daemon || EXIT_STATUS=$?
if [[ $EXIT_STATUS -eq 0 ]]; then
./gradlew -Psigning.keyId="$SIGNING_KEY" -Dgrails2.plugin.enabled=true -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/secring.gpg" publish --no-daemon || EXIT_STATUS=$?
fi
if [[ $EXIT_STATUS -eq 0 ]]; then
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/secring.gpg" bintrayUpload --no-daemon || EXIT_STATUS=$?
fi
else
# for snapshots only to repo.grails.org
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/secring.gpg" publish || EXIT_STATUS=$?
fi
if [[ $EXIT_STATUS -eq 0 ]]; then
echo "Publishing Successful."
fi
fi
exit $EXIT_STATUS