-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis_build.sh
executable file
·32 lines (23 loc) · 1 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
#!/bin/bash
function moan(){
echo -e "$1" 1>&2
exit 1
}
cd "$( dirname "$0" )"
./jcompilo.sh
repo=https://api.bintray.com/content/raymanoz/repo
version_url=${repo}/com/raymanoz/careless/careless/${BUILD_NUMBER}
artifact="careless-"${BUILD_NUMBER}
cd build/artifacts
function publish_to_bintray() {
curl --fail -T "{"${artifact}".jar,"${artifact}".pom,"${artifact}"-sources.jar}" -uraymanoz:${BINTRAY_API_KEY} -H "X-Bintray-Package:careless" -H "X-Bintray-Version:"${BUILD_NUMBER} ${version_url}/ || moan "Failed to push distribution to ${version_url}/"
echo "Pushed distro to bintray $version_url"
curl --fail -X POST -uraymanoz:${BINTRAY_API_KEY} ${repo}/careless/${BUILD_NUMBER}/publish || moan "Failed to publish distribution with ${version_url}/publish"
echo "Published careless $BUILD_NUMBER"
mkdir s3
cp *.jar s3
cp *.pom s3
}
if [[ "${TRAVIS_BRANCH}" == 'master' && "${TRAVIS_PULL_REQUEST}" == 'false' ]]; then
publish_to_bintray || moan 'Failed to publish to bintray'
fi