Add format-url.sh

This commit is contained in:
Michael Vines 2018-12-15 10:10:18 -08:00
parent 0659971ecf
commit 50e8666a14
2 changed files with 38 additions and 18 deletions

20
ci/format-url.sh Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# Formats a URL to be clickable from a Buildkite log
#
if [[ $# -eq 0 ]]; then
echo "Usage: $0 url"
exit 1
fi
if [[ -z $BUILDKITE ]]; then
echo "$1"
else
# shellcheck disable=SC2001
URL="$(echo "$1" | sed 's/;/%3b/g')" # Escape ;
printf '\033]1339;url='
echo -n "$URL"
printf '\a\n'
fi

View File

@ -62,23 +62,23 @@ echo --- Saving build artifacts
source ci/upload-ci-artifact.sh
upload-ci-artifact solana-release.tar.bz2
if [[ -z $DO_NOT_PUBLISH_TAR ]]; then
echo --- AWS S3 Store
if [[ -z $DRYRUN ]]; then
(
set -x
if [[ ! -r s3cmd-2.0.1/s3cmd ]]; then
rm -rf s3cmd-2.0.1.tar.gz s3cmd-2.0.1
$DRYRUN wget https://github.com/s3tools/s3cmd/releases/download/v2.0.1/s3cmd-2.0.1.tar.gz
$DRYRUN tar zxf s3cmd-2.0.1.tar.gz
fi
$DRYRUN python ./s3cmd-2.0.1/s3cmd --acl-public put solana-release.tar.bz2 \
s3://solana-release/"$CHANNEL_OR_TAG"/solana-release.tar.bz2
)
else
echo Skipped due to DRYRUN
fi
if [[ -n $DO_NOT_PUBLISH_TAR ]]; then
echo Skipped due to DO_NOT_PUBLISH_TAR
exit 0
fi
exit 0
echo --- AWS S3 Store
(
set -x
if [[ ! -r s3cmd-2.0.1/s3cmd ]]; then
rm -rf s3cmd-2.0.1.tar.gz s3cmd-2.0.1
$DRYRUN wget https://github.com/s3tools/s3cmd/releases/download/v2.0.1/s3cmd-2.0.1.tar.gz
$DRYRUN tar zxf s3cmd-2.0.1.tar.gz
fi
$DRYRUN python ./s3cmd-2.0.1/s3cmd --acl-public put solana-release.tar.bz2 \
s3://solana-release/"$CHANNEL_OR_TAG"/solana-release.tar.bz2
echo Published to:
$DRYRUN ci/format-url.sh http://solana-release.s3.amazonaws.com/"$CHANNEL_OR_TAG"/solana-release.tar.bz2
)