Skip to content

Instantly share code, notes, and snippets.

@ripiuk
Created December 16, 2020 17:26

Revisions

  1. ripiuk created this gist Dec 16, 2020.
    17 changes: 17 additions & 0 deletions bitbucket-pipelines.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    image: <your_image>

    pipelines:
    default:
    - step:
    name: <description>
    deployment: <your_deployment_name>
    image: google/cloud-sdk:320.0.0-alpine
    script:
    # on linux you can use `$ base64 -w 0 < ~/.google_app_credentials.json` to generate $GCP_KEY_FILE
    # then you should add it to <your_deployment_name> variables on bitbucket to be able to use it here
    - echo "${GCP_KEY_FILE}" | base64 -d >> /tmp/key-file.json
    - gcloud auth activate-service-account --key-file=/tmp/key-file.json --quiet
    - gcloud config set project <your_project> --quiet
    # sync everything from the `./<your_directory>` dir
    # gsutil rsync documentation: https://cloud.google.com/storage/docs/gsutil/commands/rsync
    - gsutil -m rsync -r -d -c -u ./<your_directory> gs://<bucket_name>/<directory_path>