From e4216c3ff89eca45c36c725b8781a9c9ee748548 Mon Sep 17 00:00:00 2001 From: sakridge Date: Fri, 20 Nov 2020 08:27:34 -0800 Subject: [PATCH] Check for DO_NOT_PUBLISH_TAR before uploading to CI (#13700) --- ci/publish-bpf-sdk.sh | 13 ++----------- ci/publish-tarball.sh | 35 +++++++++-------------------------- ci/upload-ci-artifact.sh | 13 +++++++++++++ 3 files changed, 24 insertions(+), 37 deletions(-) diff --git a/ci/publish-bpf-sdk.sh b/ci/publish-bpf-sdk.sh index 515eb69516..73a61a9ddf 100755 --- a/ci/publish-bpf-sdk.sh +++ b/ci/publish-bpf-sdk.sh @@ -16,21 +16,12 @@ fi [[ -f bpf-sdk.tar.bz2 ]] ) +source ci/upload-ci-artifact.sh echo --- AWS S3 Store if [[ -z $CHANNEL_OR_TAG ]]; then echo Skipped else - ( - set -x - docker run \ - --rm \ - --env AWS_ACCESS_KEY_ID \ - --env AWS_SECRET_ACCESS_KEY \ - --volume "$PWD:/solana" \ - eremite/aws-cli:2018.12.18 \ - /usr/bin/s3cmd --acl-public put /solana/bpf-sdk.tar.bz2 \ - s3://solana-sdk/"$CHANNEL_OR_TAG"/bpf-sdk.tar.bz2 - ) + upload-s3-artifact "/solana/bpf-sdk.tar.bz2" "s3://solana-sdk/$CHANNEL_OR_TAG/bpf-sdk.tar.bz2" fi exit 0 diff --git a/ci/publish-tarball.sh b/ci/publish-tarball.sh index b6f10c699b..e3f2090742 100755 --- a/ci/publish-tarball.sh +++ b/ci/publish-tarball.sh @@ -113,19 +113,10 @@ for file in "${TARBALL_BASENAME}"-$TARGET.tar.bz2 "${TARBALL_BASENAME}"-$TARGET. if [[ -n $BUILDKITE ]]; then echo --- AWS S3 Store: "$file" - ( - set -x - $DRYRUN docker run \ - --rm \ - --env AWS_ACCESS_KEY_ID \ - --env AWS_SECRET_ACCESS_KEY \ - --volume "$PWD:/solana" \ - eremite/aws-cli:2018.12.18 \ - /usr/bin/s3cmd --acl-public put /solana/"$file" s3://release.solana.com/"$CHANNEL_OR_TAG"/"$file" + upload-s3-artifact "/solana/$file" s3://release.solana.com/"$CHANNEL_OR_TAG"/"$file" - echo Published to: - $DRYRUN ci/format-url.sh https://release.solana.com/"$CHANNEL_OR_TAG"/"$file" - ) + echo Published to: + $DRYRUN ci/format-url.sh https://release.solana.com/"$CHANNEL_OR_TAG"/"$file" if [[ -n $TAG ]]; then ci/upload-github-release-asset.sh "$file" @@ -149,7 +140,9 @@ done # Create install wrapper for release.solana.com -if [[ -n $BUILDKITE ]]; then +if [[ -n $DO_NOT_PUBLISH_TAR ]]; then + echo "Skipping publishing install wrapper" +elif [[ -n $BUILDKITE ]]; then cat > release.solana.com-install <> release.solana.com-install echo --- AWS S3 Store: "install" - ( - set -x - $DRYRUN docker run \ - --rm \ - --env AWS_ACCESS_KEY_ID \ - --env AWS_SECRET_ACCESS_KEY \ - --volume "$PWD:/solana" \ - eremite/aws-cli:2018.12.18 \ - /usr/bin/s3cmd --acl-public put /solana/release.solana.com-install s3://release.solana.com/"$CHANNEL_OR_TAG"/install - - echo Published to: - $DRYRUN ci/format-url.sh https://release.solana.com/"$CHANNEL_OR_TAG"/install - ) + $DRYRUN upload-s3-artifact "/solana/release.solana.com-install" "s3://release.solana.com/$CHANNEL_OR_TAG/install" + echo Published to: + $DRYRUN ci/format-url.sh https://release.solana.com/"$CHANNEL_OR_TAG"/install fi echo --- ok diff --git a/ci/upload-ci-artifact.sh b/ci/upload-ci-artifact.sh index 1e6b2d4020..233c32503e 100644 --- a/ci/upload-ci-artifact.sh +++ b/ci/upload-ci-artifact.sh @@ -16,3 +16,16 @@ upload-ci-artifact() { fi } +upload-s3-artifact() { + echo "--- artifact: $1 to $2" + ( + set -x + docker run \ + --rm \ + --env AWS_ACCESS_KEY_ID \ + --env AWS_SECRET_ACCESS_KEY \ + --volume "$PWD:/solana" \ + eremite/aws-cli:2018.12.18 \ + /usr/bin/s3cmd --acl-public put "$1" "$2" + ) +}