Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
publish to bintray
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinmm80 committed May 30, 2015
1 parent df745c0 commit c6ca159
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
51 changes: 51 additions & 0 deletions publish.sh
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
1 change: 1 addition & 0 deletions secrets_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BINTRAY_API_KEY: !var bintray/api-key

0 comments on commit c6ca159

Please sign in to comment.