From 9bf2d1d7b4ddf603ef11af07439e55eb4ebce3da Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 14 Nov 2018 09:23:35 -0800 Subject: [PATCH] Publish BPF SDK to a channel-specific URL to ease downstream pickup --- ci/publish-bpf-sdk.sh | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/ci/publish-bpf-sdk.sh b/ci/publish-bpf-sdk.sh index 960a30ee11..3ef465ecc5 100755 --- a/ci/publish-bpf-sdk.sh +++ b/ci/publish-bpf-sdk.sh @@ -4,6 +4,15 @@ set -e cd "$(dirname "$0")/.." version=$(./ci/crate-version.sh) +eval "$(ci/channel-info.sh)" + +if [[ $BUILDKITE_BRANCH = "$STABLE_CHANNEL" ]]; then + CHANNEL=stable +elif [[ $BUILDKITE_BRANCH = "$EDGE_CHANNEL" ]]; then + CHANNEL=edge +elif [[ $BUILDKITE_BRANCH = "$BETA_CHANNEL" ]]; then + CHANNEL=beta +fi echo --- Creating tarball ( @@ -22,16 +31,21 @@ echo --- Creating tarball echo --- AWS S3 Store +if [[ -z $CHANNEL ]]; then + echo Skipped +else + ( + set -x + if [[ ! -r s3cmd-2.0.1/s3cmd ]]; then + rm -rf s3cmd-2.0.1.tar.gz s3cmd-2.0.1 + wget https://github.com/s3tools/s3cmd/releases/download/v2.0.1/s3cmd-2.0.1.tar.gz + tar zxf s3cmd-2.0.1.tar.gz + fi -set -x -if [[ ! -r s3cmd-2.0.1/s3cmd ]]; then - rm -rf s3cmd-2.0.1.tar.gz s3cmd-2.0.1 - wget https://github.com/s3tools/s3cmd/releases/download/v2.0.1/s3cmd-2.0.1.tar.gz - tar zxf s3cmd-2.0.1.tar.gz + python ./s3cmd-2.0.1/s3cmd --acl-public put bpf-sdk.tar.bz2 \ + s3://solana-sdk/"$CHANNEL"/bpf-sdk.tar.bz2 + ) fi -python ./s3cmd-2.0.1/s3cmd --acl-public put bpf-sdk.tar.bz2 \ - s3://solana-sdk/"$version"/bpf-sdk.tar.bz2 - exit 0