Skip to content

Commit 488fd72

Browse files
authored
Fix post-deploy step in travis build (#5)
* Fix post-deploy step in travis build * Use correct travis build stages to avoid duplicate steps
1 parent e09afa1 commit 488fd72

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

.travis.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@ cache:
1414

1515
install: true
1616

17-
# For a tagged build, we'll set the maven artifact version #.
17+
env:
18+
global:
19+
- BINTRAY_REPO=ibm-cloud-sdk-repo
20+
- BINTRAY_PKGNAME=com.ibm.cloud:sdk-core
21+
22+
# For a tagged build, we'll set the maven artifact version #
23+
# and resolve the variable references in the bintray config.
1824
before_script:
1925
- env
2026
- echo "TRAVIS_TAG = '${TRAVIS_TAG}'"
2127
- '[ "${TRAVIS_TAG}" != "" ] && mvn versions:set -DnewVersion=${TRAVIS_TAG} -DgenerateBackupPoms=false || true'
28+
- cat build/bintray-config.template | envsubst >bintray-config.json
2229

2330
script:
2431
- mvn clean package
2532

26-
# If we're going to deploy, we first resolve variables in our bintray config.
27-
before_deploy:
28-
- cat build/bintray-config.template | envsubst >bintray-config.json
29-
- cat bintray-config.json
30-
3133
deploy:
3234
- provider: bintray
3335
file: bintray-config.json
@@ -40,13 +42,13 @@ deploy:
4042
api_key: $GITHUB_OAUTH_TOKEN
4143
file_glob: true
4244
file:
43-
- target/java-sdk-core-*.jar
45+
- target/sdk-core-*.jar
4446
skip_cleanup: true
4547
on:
4648
tags: true
4749

48-
after_deploy:
49-
- build/sync2MC.sh $BINTRAY_USER $BINTRAY_APIKEY sdk-maven-repo com.ibm.cloud.sdk:java-sdk-core $TRAVIS_TAG
50+
after_script:
51+
- build/sync2MC.sh $BINTRAY_USER $BINTRAY_APIKEY $BINTRAY_REPONAME $BINTRAY_PKGNAME $TRAVIS_TAG
5052

5153
notifications:
5254
email: true

build/bintray-config.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"package": {
33
"vcs_url": "https://github.com/IBM/java-sdk-core.git",
4-
"repo": "ibm-cloud-sdk-repo",
4+
"repo": "${BINTRAY_REPONAME}",
55
"issue_tracker_url": "https://github.com/IBM/java-sdk-core/issues",
6-
"subject": "padamstx",
6+
"subject": "${BINTRAY_USER}",
77
"website_url": "https://github.com/IBM/java-sdk-core",
8-
"name": "com.ibm.cloud:sdk-core"
8+
"name": "${BINTRAY_PKGNAME}"
99
},
1010

1111
"version": {

0 commit comments

Comments
 (0)