-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DX-7329: release cli binaries to jfrog (#854)
* DX-7329: release cli binaries to jfrog * remove snoozing
- Loading branch information
1 parent
73a641d
commit 6a83b84
Showing
3 changed files
with
69 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# Adapted from https://github.com/leopardslab/dunner/blob/master/release/publish_deb_to_bintray.sh | ||
|
||
set -e | ||
|
||
FILENAME=$1 | ||
VERSION=$2 | ||
ARCH=$3 | ||
FORMAT=$4 | ||
|
||
REPO="stripe-cli-$FORMAT" | ||
PACKAGE="stripe" | ||
DISTRIBUTIONS="stable" | ||
COMPONENTS="main" | ||
DEBIAN_META="" | ||
UPLOAD_URL="" | ||
|
||
if [ -z "$ARTIFACTORY_SECRET" ]; then | ||
echo "ARTIFACTORY_SECRET is not set" | ||
exit 1 | ||
fi | ||
|
||
artifactoryUpload () { | ||
if [ "$ARCH" == "386" ]; then | ||
ARCH="i386" | ||
fi | ||
|
||
if [ "$FORMAT" == "debian" ]; then | ||
DEBIAN_META="deb.distribution=$DISTRIBUTIONS;deb.component=$COMPONENTS;deb.architecture=$ARCH" | ||
UPLOAD_URL="https://stripe.jfrog.io/artifactory/$REPO-local/pool/$PACKAGE/$VERSION/$PACKAGE$DEBIAN_META" | ||
elif [ "$FORMAT" == "rpm" ]; then | ||
UPLOAD_URL="https://stripe.jfrog.io/artifactory/$REPO-local/$PACKAGE/$VERSION/$ARCH/$PACKAGE" | ||
else | ||
echo "unrecognised package format" | ||
exit 1 | ||
fi | ||
|
||
echo "Uploading $UPLOAD_URL" | ||
|
||
RESPONSE_CODE=$(curl -X PUT -T "$FILENAME" -H "Authorization: Bearer $ARTIFACTORY_SECRET" "$UPLOAD_URL" -I -s -w "%{http_code}" -o /dev/null); | ||
if [[ "$(echo "$RESPONSE_CODE" | head -c2)" != "20" ]]; then | ||
echo "Unable to upload, HTTP response code: $RESPONSE_CODE" | ||
exit 1 | ||
fi | ||
echo "HTTP response code: $RESPONSE_CODE" | ||
} | ||
|
||
printMeta () { | ||
echo "Publishing: $PACKAGE" | ||
echo "Version to be uploaded: $VERSION" | ||
} | ||
|
||
printMeta | ||
artifactoryUpload |