how do you start a gcp vm in a pipeline?

I had a bit of a wrong understanding how pipelines in bitbucket exactly work, I figured out I could just download the google-cloud sdk and give commands through the pipeline.

image: google/cloud-sdk:latest 

pipelines:
  default:
    - step:
        name: "Start build instance"
        script:
          - echo ${GCLOUD_JSON_KEY} > client-secret.json
          - gcloud auth activate-service-account --key-file client-secret.json
          - gcloud config set project $project-name
          - 'gcloud compute instances start build-serve --zone=america-west4-b'

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top