Last active
September 23, 2020 19:10
-
-
Save r4rohan/2c7f2efdc71b8307dc586b4875d794b0 to your computer and use it in GitHub Desktop.
This file contains 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
import os | |
from google.cloud.devtools import cloudbuild_v1 | |
client = cloudbuild_v1.CloudBuildClient() | |
project_id = os.environ.get('GCP_PROJECT') | |
build = { | |
"steps": [{ | |
"name": "gcr.io/cloud-builders/gcloud", | |
"entrypoint":"bash", | |
"args": [ | |
"-c", | |
"gcloud compute ssh rohandash1998@virtual-instance --zone=us-central1-a --command=\"touch /home/rohandash1998/test\"\n" | |
] | |
}] | |
} | |
def create_build(data, context): | |
response = client.create_build( | |
project_id="cloudorbit", | |
build=cloudbuild_v1.Build(build), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment