-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsync-version-artifacts-to-maven-central.sh
executable file
·44 lines (36 loc) · 1.47 KB
/
sync-version-artifacts-to-maven-central.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
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
if [ -z "$RELEASE_VERSION" ]
then
echo "ERROR: No release version supplied"
exit 1
fi
if [ -z "$BINTRAY_USER" ]
then
echo "ERROR: No Bintray user supplied"
exit 1
fi
if [ -z "$BINTRAY_API_KEY" ]
then
echo "ERROR: No Bintray API key supplied"
exit 1
fi
################################################################################################
## By default the staging repository is closed and artifacts are released to Maven Central. ##
## You can optionally turn this behaviour off and release the version manually. ##
## This is achieved by passing 0 in the 'close' field of the JSON passed to the call. ##
################################################################################################
if [ -z "$CLOSE_SONATYPE_STAGING" ]
then
CLOSE_SONATYPE_STAGING="1"
fi
BODY='{
"close": "'"$CLOSE_SONATYPE_STAGING"'"
}'
BINTRAY_REST_API_URL="https://api.bintray.com/maven_central_sync/ajurge/com.bipinet.pointsdistance/point-distance-calculator/versions/$RELEASE_VERSION"
echo "**************************************************************************"
echo "INFO: Syncing version $RELEASE_VERSION with Sonatype OSS and Maven Central"
echo "**************************************************************************"
echo $(curl --user $BINTRAY_USER:$BINTRAY_API_KEY -s -X POST \
-d "$BODY" \
"$BINTRAY_REST_API_URL")
echo "**************************************************************************"