Skip to content

Commit c3825ed

Browse files
committed
ci: Add Sonatype authentication for syncing to Maven Central
1 parent ec31634 commit c3825ed

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ deploy:
5959
# Ask bintray to sync the just-deployed artifact to maven central
6060
after_script:
6161
- '[ "${TRAVIS_TAG}" != "" ]
62-
&& build/sync2MC.sh $BINTRAY_USER $BINTRAY_APIKEY $BINTRAY_REPO_OWNER $BINTRAY_REPO_NAME $BINTRAY_PKG_NAME $TRAVIS_TAG'
62+
&& build/sync2MC.sh $BINTRAY_USER $BINTRAY_APIKEY $BINTRAY_REPO_OWNER $BINTRAY_REPO_NAME $BINTRAY_PKG_NAME $TRAVIS_TAG $SONATYPE_USER $SONATYPE_PASSWORD'

build/sync2MC.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ if [ $# -lt 5 ]
44
then
55
echo "
66
Syntax:
7-
$0 <bintray-user> <bintray-apikey> <bintray-repo-owner> <bintray-reponame> <bintray-packagename> <bintray-packageversion>>
7+
$0 <bintray-user> <bintray-apikey> <bintray-repo-owner> <bintray-reponame> <bintray-packagename> <bintray-packageversion> <sontatype-user> <sonatype-password>
88
Example:
9-
$0 user1 A1098765 my-bintray-org my-bintray-repo1 my-bintray-package 0.0.1
9+
$0 user1 A1098765 my-bintray-org my-bintray-repo1 my-bintray-package 0.0.1 sonatype-user-1 abcd1234
1010
"
1111

1212
exit 1
@@ -18,6 +18,8 @@ subject=$3
1818
reponame=$4
1919
pkgname=$5
2020
pkgversion=$6
21+
sonatypeuser=$7
22+
sonatypepassword=$8
2123

2224
#set -x
2325

@@ -27,4 +29,4 @@ basicauth="${user}:${apikey}"
2729

2830
echo "
2931
Executing curl command..."
30-
curl -X POST --data '{ "close": "1" }' -H "Content-Type: application/json" -L -k --user ${basicauth} ${urlstring}
32+
curl -X POST --data '{ "username": "'${sonatypeuser}'", "password": "'${sonatypepassword}'", "close": "1" }' -H "Content-Type: application/json" -L -k --user ${basicauth} ${urlstring}

0 commit comments

Comments
 (0)