Last active
March 10, 2019 08:39
-
-
Save tibotiber/7204e92578ee2e3ceeb9beff6197bd83 to your computer and use it in GitHub Desktop.
Medium: Deploy private source maps with Netlify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# build | |
yarn react-app-rewired build | |
# install gcloud cli | |
echo "Installing gcloud sdk" | |
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-237.0.0-linux-x86_64.tar.gz | |
tar -xzf google-cloud-sdk-237.0.0-linux-x86_64.tar.gz | |
./google-cloud-sdk/bin/gcloud --version | |
# authenticate to gcloud | |
echo "Authenticating to gcloud" | |
echo $GCLOUD_KEY_FILE > /tmp/gcloud_keyfile.json | |
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file /tmp/gcloud_keyfile.json | |
# upload sourcemaps | |
echo "Uploading sourcemaps to gcs" | |
./google-cloud-sdk/bin/gsutil cp build/**/**/*.map gs://<bucket-name>/ | |
# delete sourcemaps | |
echo "Deleting sourcemaps from netlify deploy" | |
rm build/**/**/*.map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment