Skip to content

Commit

Permalink
Fix bintray deployment step
Browse files Browse the repository at this point in the history
  • Loading branch information
padamstx committed Feb 20, 2019
1 parent 488fd72 commit 585c5b6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
35 changes: 21 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ dist: trusty
jdk:
- oraclejdk8

notifications:
email: true

env:
global:
- BINTRAY_REPONAME=ibm-cloud-sdk-repo
- BINTRAY_PKGNAME=com.ibm.cloud:sdk-core

branches:
except:
- gh-pages
Expand All @@ -14,18 +22,18 @@ cache:

install: true

env:
global:
- BINTRAY_REPO=ibm-cloud-sdk-repo
- BINTRAY_PKGNAME=com.ibm.cloud:sdk-core

# For a tagged build, we'll set the maven artifact version #
# and resolve the variable references in the bintray config.
# For a tagged build, we'll set the maven artifact version #.
before_script:
- env
- echo "TRAVIS_TAG = '${TRAVIS_TAG}'"
- '[ "${TRAVIS_TAG}" != "" ] && mvn versions:set -DnewVersion=${TRAVIS_TAG} -DgenerateBackupPoms=false || true'
- cat build/bintray-config.template | envsubst >bintray-config.json
- '[ "${TRAVIS_TAG}" != "" ]
&& mvn versions:set -DnewVersion=${TRAVIS_TAG} -DgenerateBackupPoms=false
|| true'
- '[ "${TRAVIS_TAG}" != "" ]
&& cat build/bintray-config.template | envsubst >bintray-config.json
&& echo "Contents of bintray-config.json:"
&& cat bintray-config.json
|| true'

script:
- mvn clean package
Expand All @@ -42,13 +50,12 @@ deploy:
api_key: $GITHUB_OAUTH_TOKEN
file_glob: true
file:
- target/sdk-core-*.jar
- target/java-sdk-core-*.jar
skip_cleanup: true
on:
tags: true

# Ask bintray to sync the just-deployed artifact to maven central
after_script:
- build/sync2MC.sh $BINTRAY_USER $BINTRAY_APIKEY $BINTRAY_REPONAME $BINTRAY_PKGNAME $TRAVIS_TAG

notifications:
email: true
- '[ "${TRAVIS_TAG}" != "" ]
&& build/sync2MC.sh $BINTRAY_USER $BINTRAY_APIKEY $BINTRAY_REPONAME $BINTRAY_PKGNAME $TRAVIS_TAG'
2 changes: 1 addition & 1 deletion build/bintray-config.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"vcs_url": "https://github.com/IBM/java-sdk-core.git",
"repo": "${BINTRAY_REPONAME}",
"issue_tracker_url": "https://github.com/IBM/java-sdk-core/issues",
"subject": "${BINTRAY_USER}",
"subject": "padamstx",
"website_url": "https://github.com/IBM/java-sdk-core",
"name": "${BINTRAY_PKGNAME}"
},
Expand Down

0 comments on commit 585c5b6

Please sign in to comment.