135 questions
0
votes
1
answer
243
views
Cloud Build fails to use Docker BuildKit Cache
We are using Cloud Build to deploy our Docker container to Cloud Run. We would like to speed up the process with caching, as described here:
https://cloud.google.com/build/docs/optimize-builds/...
0
votes
0
answers
63
views
Deploying a Kedro project to cloud build with pytest accessing to google cloud storage
I am trying to deploy my Kedro instance in Cloud Run which my cloudbuild.yml look like this :
steps:
- name: "noobzik/uv-gcp-cloud-build"
id: CI
entrypoint: /bin/bash
env:
- ...
0
votes
1
answer
105
views
Copy function fails in GCP Cloud Build?
I'm having a strange problem where a Dockerfile builds completely fine locally but fails in GCP cloud build due to being unable to find the source files during a copy statement. I am building a spring ...
0
votes
0
answers
158
views
I can not access the environmental variable from Secret Manager that I passed in the secretEnv in Google Cloud Build
steps:
- name: gcr.io/cloud-builders/docker
entrypoint: bash
args:
- '-c'
- |
docker pull $_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:...
2
votes
1
answer
135
views
Resolving secret during Cloud Build not working?
My Dockerfile requires the GITHUB_TOKEN to be set in order to be able to download and install an npm package.
Hence, my Dockerfile an argument GITHUB_TOKEN. This is working fine locally.
The problem ...
0
votes
1
answer
383
views
How to use dynamically versioning in cloudbuild.yaml file?
This is my cloudbuild.yaml file. In this file i manually write the version of the new application, but i want to take this automatically by any approach, Is this possible anyhow?
steps:
Step 1: Build ...
5
votes
1
answer
3k
views
Google Cloud Build substitutions: invalid value for 'build.substitutions': key in the template "FIREBASE_API_KEY" is not a valid built-in substitution
I'm relatively new to Google Cloud from a developer standpoint. I have setup a basic website and configured Google Cloud Build to run any time I push a change to GitHub. This was working well until I ...
0
votes
0
answers
92
views
Cannot transfer files from Cloud Build to Compute Engine with SCP via internal IP
I'm currently using Cloud Build to build HTML and JavaScript codes when they're pushed to a specific repository on GitHub.
After build process is completed, files and folders are transferred to a ...
1
vote
0
answers
32
views
Google cloud build and nodejs mysql connect
I'm having hard time to figure how to configure a database connection on cloudbuild.yaml file.
cloudbuild.yaml:
steps:
- name: 'gcr.io/cloud-builders/docker'
automapSubstitutions: true
env:
...
0
votes
1
answer
235
views
Build multi stage Dockerfile in GCP Cloudbuild
Hi I have this Dockerfile for my NodeJS app :
ARG NODE_IMAGE=node:21.7.3-alpine
ARG PROJECT_NAME=app
FROM $NODE_IMAGE AS base
RUN apk --no-cache add dumb-init
RUN mkdir -p /home/node/$PROJECT_NAME &...
0
votes
1
answer
537
views
How to delete a service from all regions with gcloud run delete in cloudbuild.yaml
I deploy my service on cloud run, in several regions.
My cloudbuild.yaml does this:
Build a new image
Push new image to Artifact Registry
TODO: Stop service in all regions
Run database migrations
...
0
votes
0
answers
85
views
Cloudbuild unable to download Public github repo as a module
Issue - We are trying to deploy gke in our environment using Google's public modules but facing an issue.
This is how we're calling Google's module to create cluster inside our Terrform hosted in ...
1
vote
1
answer
647
views
Parametrizing backend in terraform on gcp
terraform {
required_version = ">= 0.13"
required_providers {
google = {
source = "hashicorp/google
version = "~> 4.9.0"
}...
0
votes
0
answers
33
views
The variable is returning empty in my Python script [duplicate]
I am working on a Python script and using GCP Cloud Build to run it. Instead of hardcoding some of the variables, I am trying to use a Cloud Build YAML file to define the variables there and then use ...
0
votes
0
answers
186
views
Google Cloud build python not found when trigger is running
I'm a software developer and new to GCP. Yesterday I was trying to deploy a simple Spring Boot Application to the App Engine using this tutorial https://medium.com/google-cloud/gcp-deploying-to-app-...
1
vote
0
answers
451
views
cloud run - build : Your build failed to run: invalid build: invalid image name
iam trying to create and run a cloud trigger but every time i run it it says : Failed to trigger build: invalid build: invalid image name "gcr.io/dashs70e/prName:ef50014": could not parse ...
0
votes
0
answers
126
views
Cloud Build YAML Configuration: Issues with Environment Variables from .env File Not Being Set in Application
I'm facing an issue with my Cloud Build configuration YAML file, which is not working as expected. I have a multi-step build process, and I'm encountering problems with environment variable handling ...
1
vote
1
answer
2k
views
Google cloud build - cache and optimize build time
I'm using google cloud build and a new build is triggered each time a new commit is pushed to my branch.
Everything is working fine (artifacts and cloud run machine) but I'm trying to speed up the ...
0
votes
1
answer
500
views
Variable name substitution undefined in cloud build gcp
Hi all I have an issue which I am unable to proceed. According to the user guide, it mentioned that $REPO_NAME is supposed to be substitute to the repository name checked out.
An example the ...
1
vote
1
answer
257
views
Google Cloud Build Doesn't Work Properly on Git Hooks
Im using gcloud and I have a git server on a vm, where in a repository through a git hook (post-receive), Im calling cloud build to triggers the construction of a docker image and the deployment of ...
0
votes
1
answer
959
views
GCP Cloud Build - Running Bash script with arguments
I have a GCP Cloub build configuration, where a bash script is needed to be executed.
The below configuration works just fine.
steps:
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
...
0
votes
1
answer
177
views
How to set environment variables using cloudbuild.yaml for react project
The build is working but environment variables are not assigned during the build, How can I access environment variables?
My cloudbuild.yaml file(Substitution variables are added in the trigger ...
2
votes
1
answer
113
views
Difference between using and not using the 'images' attribute in .cloudyaml (for pushing to artifact registry)
I am reading the google cloud documentation and they have countless examples of using the docker build cloud-builder configuration.
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t',...
0
votes
1
answer
154
views
Execute a Big query in cloud buils step with multiple source files
I have my cloud build file like below.
steps:
name: gcr.io/cloud-builders/gcloud
args:
config
set
project
'${_PROJECT_ID}'
name: gcr.io/cloud-builders/gcloud
args:
query
'--use_legacy_sql=false'
'--...
0
votes
0
answers
258
views
How to correctly for CLI args when deploying from GCP Cloud Deply via cloudbuild.yaml
I have a docker file
FROM golang:1.20-alpine
WORKDIR /app
COPY . .
RUN go build quivrApi/cmd/quivr
EXPOSE $PORT
ENTRYPOINT ["./quivr"]
and my cloudbuild.yaml
steps:
# Build the ...
0
votes
1
answer
267
views
error in Cloud Build (GCP) - javac: invalid target release: 11
I have a maven project which runs normally on my local computer, but when I push the code to the cloud repository, it fails in Cloud Build with the error below:
Step #0: [ERROR] COMPILATION ERROR :
...
2
votes
0
answers
119
views
Getting git history in cloudbuild from github
I need to have the git history in cloudbuild to detect which apps in my nx monorepo had changes. My current approach to getting the history is the following:
steps:
- id: 'create github ssh ...
0
votes
0
answers
491
views
How can I override Github Actions or Cloud Build `skip ci`?
So i have a catch 22 with CI currently.
I need to [skip ci] on cloud build on a certain merge to main because that build will eventually be triggered by tags created by a github action. However, ...
0
votes
0
answers
347
views
I need a cloudbuild builder with both gcloud and yarn available
I have an NX monorepo and would like to deploy only those apps which had a change since the last commit.
My cloudbuild.yaml looks like this:
steps:
- name: node:16-bullseye
entrypoint: yarn
...
0
votes
1
answer
551
views
How to deploy frontend app to Cloud App Engine using cloudbuild
I am trying to deploy a React app to Google Cloud App Engine. Whenever code is pushed to GitHub, Cloud Build creates a production build folder and pushes it into a GCS bucket. I also have an app.yaml ...
2
votes
0
answers
1k
views
How to use BRANCH_NAME with cloudbuild.yaml and Dockerfile in Google Cloud Build
I have been using Dockerfile and cloudbuild.yaml to build images succesfully,
But now I need to have the BRANCH_NAME value inside the Dockerfile, and since this requirement showed up, my docker builds ...
0
votes
1
answer
103
views
Google Managed VM Instance group does not get latest image when created/replaced
I have a cloud build trigger for a branch to build a docker image and to replace vm instances from a group with latest image, I know that before some time when we did a push to github, it replaced vm ...
0
votes
1
answer
91
views
Cloudbuild unable to decrypt using key 404
I am attempting to set up a simple Rails application using GCP Cloudbuild, and am running into a error message that indicates a failure to decrypt a variable due to the kms key not being found.
...
0
votes
0
answers
330
views
How to deploy Apache Beam to Dataflow using google cloud build?
I have a pipeline written in java and its template is deployed on google cloud storage when running the Pipeline.
What I want is to generate a Dockerfile and cloudbuild.yaml file then I can deploy ...
3
votes
1
answer
2k
views
How to GCP Cloud Build + Java 17 + Gradle 7.6
Can't figure out how to use Cloud Build + Gradle + Java 17 to build a Java Jar file. I can't find any example cloudbuild.yaml that uses Gradle 7.6, which is required for my Gradle build. I'm not ...
1
vote
2
answers
1k
views
how to specify default cloud run revision url in the cloud build yaml file
I have a GCP project where I continuously deploy changes (PRs) made to a GitHub repository to a cloud-run service using cloud build triggers
the way i set it up at first is that i use GCP GUI
this ...
1
vote
1
answer
1k
views
Cross project service account impersonation for cloud build
We have a use case where project A has some secrets and databases which cannot be moved to another project. We have a project B that uses the secrets and databases from project A.
Project A has a ...
0
votes
1
answer
788
views
cloud build does not recognize build directory argument
I am trying to build a Cloud Run job with a trigger from Cloud Build and secrets from Secret Manager. I managed to get the trigger that I use to build my Dockerfile to run, but the build itself fails ...
1
vote
1
answer
2k
views
Cloud Build does not push my Docker image to Artifact Registry with images field in cloudbuild.yaml
I have two GitHub repos (let's call them Repo1 and Repo2) in two Cloud Build triggers. Both have the same Service Account, GitHub account, GCP project, and both repos exist in Artifact Registry.
...
0
votes
1
answer
118
views
running commands from cloud-builders-community/sonarqube/
gcloud builds submit . --config=cloudbuild.yaml
Creating temporary tarball archive of 6 file(s) totalling 3.2 KiB before compression.
Uploading tarball of [.] to [gs://training_cloudbuild/source/...
1
vote
1
answer
322
views
Google cloud Manifest unknown during deploy to Kubernetes cluster
I'm trying to deploy my code placed in bitbucket repo to Kubernetes clusters available in google cloud. I've created a trigger which react when I push new changes to bitbucket repo.
I mean:
Based on ...
0
votes
2
answers
3k
views
is there any way to run npm install and npm run build in a cloudbuild.yaml?
I have this react app, I need to deploy into a google cloud storage thru google cloud build, I'm trying to do it adding a cloudbuild.yaml and add some steps to run the npm
This is what I have:
steps:
...
0
votes
0
answers
311
views
YAML configuration to zip file and upload to google storage
I'm pretty new with YAML files and DevOps stuff, sorry if this is a silly question. I have this node project, one folder is just for Cloud Functions (gcp), I'm creating the infrastructure in gcp with ...
3
votes
2
answers
335
views
Can we use the same build steps repeatedly in the cloudbuild yaml file
In the GCP cloud build yaml file, can we use the steps repeatedly by passing the same arguments again but with different file names.
Ex:
- name: 'gcr.io/cloud-builders/gke-deploy'
args:
- run
...
3
votes
2
answers
3k
views
How to setup Docker in Docker (DinD) on CloudBuild?
I am trying to run a script (unitest) that uses docker behind the scenes on a CI. The script works as expected on droneci but switching to CloudBuild it is not clear how to setup DinD.
For the droneci ...
1
vote
1
answer
957
views
How to make App Engine use Cloud Build substitute variables for environmental variables?
I am trying to add Cloud Build on top of my App Engine Flask app. Everything works, but for some reason, I can't access the substitution variables I declared in the trigger.
Env vars are still being ...
1
vote
1
answer
1k
views
gcloud builds submit raises 403 error for `iam.serviceAccounts.get`
I have a Cloud Build I want to run from the command line. However when I try to run the build from my terminal, it raises this error:
$ gcloud builds submit --region=asia-east1 --config cloudbuild....
0
votes
1
answer
1k
views
How to deploy multiple cloud functions at a time through google cloud build by index.js file like in firebase
I have a situation where I want to deploy my whole index file through cloud build using cloudbuild.yaml file but didn't find any way to do so
like in firebase we do like firebase deploy --only ...
1
vote
1
answer
977
views
How to build and push Go image using Google Ko?Could you tell me the steps for cloudbuild.yaml to create the image and push go image using Google ko?
I need to build go project using google Ko after checking out from git and then push the image to private artifactory which takes credentials. How to define the steps for the above in cloudbuild.yaml? ...
2
votes
0
answers
1k
views
how to make mypy step in cicd not fail?
I added a type check to my cloudbuild pipeline but the steps fails.
how to make it pass even with errors detected by mypy ? or maybe set a threshold like in pylint with the option fail-under?
The step ...