Skip to content

Commit

Permalink
🏗 Disable gcloud storage support (#33917)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg committed Apr 20, 2021
1 parent 0450666 commit bdf4190
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
29 changes: 2 additions & 27 deletions .circleci/setup_storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the license.

# Script used by AMP's CI builds to authenticate with GCP storage on CircleCI.
# TODO(rsimha, ampproject/amp-github-apps#1110): Update storage details.

set -e

GREEN() { echo -e "\033[0;32m$1\033[0m"; }
RED() { echo -e "\033[0;31m$1\033[0m"; }

if [[ -z "${STORAGE_TOKEN}" ]] ;
then
echo $(RED "Could not find the STORAGE_TOKEN environment variable. Exiting.")
exit 1
fi

echo $(GREEN "Installing Google Cloud SDK...")
(set -x && cd ~/ && curl -Ss --retry 5 https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-329.0.0-linux-x86_64.tar.gz | tar xz)

echo $(GREEN "Setting up Cloud SDK environment...")
(set -x && echo "source ~/google-cloud-sdk/path.bash.inc" >> $BASH_ENV)
source $BASH_ENV

echo $(GREEN "Authenticating with GCP storage...")
echo $STORAGE_TOKEN > storage-key.json
gcloud auth activate-service-account --key-file=storage-key.json
rm -f storage-key.json

echo $(GREEN "Applying settings...")
gcloud config set pass_credentials_to_gsutil true
YELLOW() { echo -e "\033[0;33m$1\033[0m"; }

echo $(GREEN "Successfully set up GCP storage.")
echo $(YELLOW "This step is a NO-OP and will be removed soon.")
5 changes: 1 addition & 4 deletions build-system/tasks/pr-deploy-bot-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ async function signalPrDeployUpload(result) {
'to the pr-deploy GitHub App...'
);
const sha = ciBuildSha();
const maybeJobId =
result == 'success' && !process.env.USE_LEGACY_GCLOUD_STORAGE
? `/${circleciBuildNumber()}`
: '';
const maybeJobId = result == 'success' ? `/${circleciBuildNumber()}` : '';
const url = `${prDeployBotBaseUrl}headshas/${sha}/${result}${maybeJobId}`;
await fetch(url, {method: 'POST'});
}
Expand Down

0 comments on commit bdf4190

Please sign in to comment.