Google Cloud Run Automation

Hi out there!

I'm trying to build a CI/CD pipeline from JetBrains Space to Google Cloud Platform. 

Basically I just need to build and then deploy a Docker image, but I am totally lost in the specifics of the *.kts DSL (I'm coming from YAML-based GitHub Actions).

Could you please provide me with some guidance on how to wrap up two commands and set the pipeline up?

When deploying manually from my machine I simply use these two commands one right after another and it's done:

1. Builds an image and submits to Google Cloud Docker Registry

gcloud builds submit --tag

2. Deploys the image to the bucket

gcloud run deploy --image --platform managed



2 years later and not a single comment to help?

I guess Space is not very friendly to Google Cloud Platform or the Go language. 

Since I can find ZERO documentation on building a Go program or deploying to Google Cloud Platform/Google App Engine Standard.


Hey Jarrod,

I managed to build my own CI/CD pipeline using traditional shell scripts rather than these fancy KotlinScript automations
Hers is what your sample code would look like to build an image, push it to and then deploy it to GKE k8s cluster (however, you can replace this step and deploy to App Engine or Cloud Run):


* JetBrains Space Automation
* This Kotlin-script file lets you automate build activities
* For more info, see

job("build and deploy: testing") {
startOn {
gitPush {
branchFilter {

container(displayName = "Google Cloud SDK", image = "google/cloud-sdk:latest") {

env["GCP_ENVIRONMENT"] = "testing"
env["GCP_SA_KEY"] = Secrets("gcp_sa_key")
env["GCP_SA_NAME"] = Params("gcp_sa_name")
env["GCP_PROJECT"] = Params("gcp_project")
env["GCP_REGION"] = Params("gcp_region")

shellScript {
content = """
printf "%s" "${'$'}GCP_SA_KEY" > ./gcloud.json
sh ./ \
${'$'}GCP_SA_NAME \
${'$'}GCP_REGION \



And the file

set -e


echo "----------------------------------------------------------------"
echo "\nProject name: $SERVICE_NAME \nBranch: $ENVIRONMENT"
echo "\nProject ID: $GCP_PROJECT \nRegion: $GCP_REGION"
echo "----------------------------------------------------------------"

# Setting up authentication for GKE v1.26
# Read more:

echo "\nActivate service account..."
gcloud auth activate-service-account \

echo "\nConfigure gcloud cli..."
gcloud config set account $GCP_SA_NAME
gcloud config set project $GCP_PROJECT

echo "\nBuild image..."
gcloud builds submit --tag$GCP_PROJECT/$SERVICE_NAME --timeout=30m || true

echo "\nDeploy to Google Kubernetes Engine..."
gcloud container clusters get-credentials $ENVIRONMENT --region "$GCP_REGION"
kubectl apply -f k8s/$ENVIRONMENT/
kubectl rollout restart statefulset $SERVICE_NAME-deployment

echo "----------------------------------------------------------------"
echo "\nSuccessfully deployed $SERVICE_NAME version-0.$BUILD_NUMBER-$ENVIRONMENT"
echo "----------------------------------------------------------------"



Please sign in to leave a comment.