Questions tagged [cloudbuild.yaml]

122 questions
0
votes
1 answer

cat a filename in docker command in cloudbuild

I need to pass the output of file to docker command as an argument. I know that $TAG_NAME is already avaliable, i have my value in a file which is dynamic. Is there a way we can access the file and pass it in docker run step. cat…
kavya
  • 75
  • 1
  • 10
0
votes
1 answer

Can't find dependencies when deploying function in google cloud build

So im trying to create a google cloud function that imports a python package called pdftotext. Now in order to pip install pdftotext you have to install some system dependencies. i.e: sudo apt install build-essential libpoppler-cpp-dev pkg-config…
0
votes
0 answers

Can I define a combination of steps in a cloudbuild.yaml?

In a GitHub Workflow I can define a strategy key and loop through all combinations of a matrix. Here is an example for a CI pipeline of a Node.js app. name: CI on: pull_request: jobs: test: strategy: matrix: node: [16, 14] …
0
votes
1 answer

ERROR: (gcloud.builds.submit) INVALID_ARGUMENT: could not parse service account URL

I want to use a custom Service Account to build my docker container with Cloud Build. Using gcloud iam service-accounts list and gcloud config list I have confirmed that the service account is in the project environment and I used gcloud services…
d3f2
  • 87
  • 6
0
votes
1 answer

How to ignore "image not found" error in cloudbuild.yaml when deleting images from the artifact registry?

Currently the cloudbuild.yaml looks like this: steps: - name: 'gcr.io/cloud-builders/gcloud' args: [ 'artifacts', 'docker', 'images', 'delete', 'location-docker.pkg.dev/$PROJECT_ID/repository/image' ] - name: 'gcr.io/cloud-builders/docker' args:…
0
votes
1 answer

--source in cloudbuild.yaml

I have my current Cloud Build working, I connect my github repo to trigger the Cloud Build when I push to the main branch which then creates my Cloud Function, but I am confused about the the --source flag. I have read the google cloud function…
0
votes
0 answers

Create environment vars in Cloud Build

I am trying to create an environment variable in my cloud build job named "MERGE_COMMIT_SHA". I am using this in my deployment pipeline in Spinnaker. I create the variable from a curl command, this is working. I am then able to echo the variable…
user17094440
  • 41
  • 1
  • 4
0
votes
1 answer

GCP cloudbuild react-scripts build don't find env.file

I'm doing something I thought was simple: # Fetch config - name: 'gcr.io/cloud-builders/gsutil' volumes: - name: 'vol1' path: '/persistent_volume' args: [ 'cp', 'gs://servicesconfig/devs/react-app/env.server',…
0
votes
1 answer

Passing a SECRET KEY as environment variable in gcloud

I have stored a key in the Secret manager of GCP and I'm trying to use that secret in the cloudbuild.yaml but every time I have this error: ERROR: (gcloud.functions.deploy) argument --set-secrets: Secrets value configuration must match the pattern…
0
votes
1 answer

How to use custom substitutions with secretmanager in cloudbuild?

I'm having an issue with using custom substitutions in my cloudbuild.yaml. substitutions: _CUSTOM_SUBSTITUTION: this-is-a-path availableSecrets: secretManager: - versionName: projects/$_CUSTOM_SUBSTITUTION/secrets/client_id/versions/1 env:…
0
votes
1 answer

Make CloudBuild git push last commits to a branch in another repo

I have branch_a (development branch) in repo_A and branch_b in repo_B (production branch). Both repos are on Cloud Source. Their history is the same, except for the last commit(s) in branch_a. How to make CloudBuild push last commit(s) from…
0
votes
1 answer

gcloud builds submit substitutions not working properly. (ERROR: (gcloud.builds.submit) INVALID_ARGUMENT.)

I have the following config: steps: - name: 'alpine' args: ['echo', 'B: ${_BRANCH}', 'T: ${_TAG}', 'C => ${_CLIENT}'] If I run with: gcloud builds submit --config=gcp/cloudbuild-main.yaml --substitutions…
0
votes
1 answer

How to perform a "date -v -1m +%Y_%m" in a substitution variable in Cloud Build

I need to get the month and year of the month prior to runtime date in my cloud build yaml file. Try as I may, nothing I do will resolve. I have seen posts about storing environment variables in /workspace, but haven't had any luck doing that…
0
votes
1 answer

Use $() Operator in Google Cloud Build YAML File

I'm currently building pipeline with Google Cloud Build that has this step steps: - name: 'gcr.io/cloud-builders/gcloud' args: - 'dataflow' - 'jobs' - 'cancel' - '$(gcloud dataflow jobs list --filter="name=iot"…
fahmiduldul
  • 924
  • 7
  • 18
0
votes
1 answer

How to retain existing env variables in a new shell

I know I must be doing something silly here, but I'm trying to pass environment variables to a command being run under /bin/sh -c in Cloud Build. My Cloud Build file looks like this: - id: db-migrate name: node:16.13.0 dir: 'packages/backend' …
1 2 3
8 9