This repository was archived by the owner on Jan 2, 2025. It is now read-only.
forked from cyberark/summon
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df745c0
commit c6ca159
Showing
2 changed files
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Get the version from the command line | ||
if [ -z $VERSION ]; then | ||
echo "Please set a version in the VERSION env var." | ||
exit 1 | ||
fi | ||
|
||
# Make sure we have a bintray API key | ||
if [ -z $BINTRAY_API_KEY ]; then | ||
echo "Please set your bintray API key in the BINTRAY_API_KEY env var." | ||
exit 1 | ||
fi | ||
|
||
app="cauldron" | ||
|
||
# Zip and copy to the dist dir | ||
echo "==> Packaging..." | ||
rm -rf ./pkg/dist | ||
mkdir -p ./pkg/dist | ||
|
||
for PLATFORM in $(find ./pkg -mindepth 1 -maxdepth 1 -type d); do | ||
OSARCH=$(basename ${PLATFORM}) | ||
|
||
if [ $OSARCH = "dist" ]; then | ||
continue | ||
fi | ||
|
||
echo "--> ${OSARCH}" | ||
pushd $PLATFORM >/dev/null 2>&1 | ||
zip ../dist/${app}_${VERSION}_${OSARCH}.zip ./* | ||
popd >/dev/null 2>&1 | ||
done | ||
|
||
# Make the checksums | ||
echo "==> Checksumming..." | ||
pushd ./pkg/dist >/dev/null 2>&1 | ||
shasum -a256 * > ./${app}_${VERSION}_SHA256SUMS | ||
popd >/dev/null 2>&1 | ||
|
||
echo "==> Uploading..." | ||
for ARCHIVE in ./pkg/dist/*; do | ||
ARCHIVE_NAME=$(basename ${ARCHIVE}) | ||
|
||
echo Uploading: $ARCHIVE_NAME | ||
curl \ | ||
-T ${ARCHIVE} \ | ||
-u conjur:${BINTRAY_API_KEY} \ | ||
"https://api.bintray.com/content/conjur/cauldron/cauldron/${VERSION}/${ARCHIVE_NAME}" | ||
done |
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 @@ | ||
BINTRAY_API_KEY: !var bintray/api-key |