google-cloud-build

cloudbuil.yaml does not unmarshall when using base64-encoded value on build trigger

故事扮演 提交于 2020-01-24 06:45:07
问题 On my cloudbuild.yaml definition, I used to have a secrets section to get environment values from Google KMS. The secretEnv fields had keys mapping to 'encrypted + base64-encoded' values: ... secrets: - kmsKeyName: <API_PATH> secretEnv: <KEY>: <ENCRYPTED+BASE64> I've tried to put this value on a substitution instead, which is replaced when a build trigger is used: ... secrets: - kmsKeyName: <API_PATH> secretEnv: <KEY>: ${_VALUE} With that I intend to keep the file generic. However, the build

How to prevent cloud build from running builds in parallel?

谁说我不能喝 提交于 2020-01-24 05:39:26
问题 We are using cloud build for continuous deployment on GCP. When pushing commits to fast (e.g. on development) the triggered builds are running in parallel. Sometimes those interfere which one another. For example when two app engine deployments are running at the same time. Is there a way or best practise to force builds which are triggered from the same build trigger to run one after another? Regards, Carsten 回答1: You can't by setup. But you can define custom builder. Create one which check

Multiple commands in the same build step in Google Cloud Builder

血红的双手。 提交于 2020-01-15 07:23:22
问题 I want to run our automated backend test suite on Google Cloud Builder environment. However, naturally, I bumped into the need to install various dependencies and prerequisites within the Cloud Builder so that our final test runner ( php tests/run ) can run. Here's my current cloudbuild.yaml: steps: - name: 'ubuntu' args: ['bash', './scripts/install-prerequisites.sh', '&&', 'composer install -n -q --prefer-dist', '&&', 'php init --overwrite=y', '&&', 'php tests/run'] At the moment, the

How do I get Google Cloud Build to properly substitute values when it responds to a GitHub trigger?

空扰寡人 提交于 2020-01-14 08:29:11
问题 The Problem A GitHub trigger set up in Google Cloud Build doesn't actually substitute the configured values while running the Build ( cloudbuild.yaml ) This is the Google Cloud Build config cloudbuild.yaml steps: - name: 'gcr.io/cloud-builders/gcloud' id: 'decrypt .npmrc' args: - kms - decrypt - --ciphertext-file=npmrc.enc - --plaintext-file=/root/.npmrc - --location=global - --keyring=my-keyring - --key=npm-key - --project=${_CLOUD_KMS_PROJECT} volumes: - name: 'home' path: /root/ - name:

Add environment variable in app.yaml file during Google Build

此生再无相见时 提交于 2019-12-31 05:29:25
问题 I'm using Google Cloud Build with cloudbuild.yaml to download an app.yaml file that includes environment variables for my Python based app. The app.yaml version used for the initial deployment does not contain the environment variables for security protection. However, it seems this isn't working and the environment variables aren't being detected - as the app.yaml does not seem to be overwritten. The following is my cloudbuild.yaml configuration: steps: - name: gcr.io/cloud-builders/gsutil

How to deploy to appengine flexible using bazel and google cloud deploy using non containerized artifact?

对着背影说爱祢 提交于 2019-12-25 01:56:05
问题 I have a project structure like: . ├── app │ ├── BUILD │ ├── entry.py │ ├── forms.py │ ├── __init__.py │ ├── jinja_custom_filter.py │ ├── models.py │ ├── __pycache__ │ ├── static │ ├── templates │ ├── utils.py │ └── views.py ├── app.db ├── app.yaml ├── BUILD ├── cloudbuild.yaml ├── config.py ├── __init__.py ├── LICENSE ├── manage.py ├── requirements.txt ├── run.py └── WORKSPACE 4 directories, 20 files Project uses flask, sqlalchemy (see further below) How does one deploy using google cloud

Google App Engine deployment with private git repo in package.json

让人想犯罪 __ 提交于 2019-12-25 00:29:52
问题 I have a dependency to a private Bitbucket repo in my package.json { "my-dependency": "git+ssh://git@bitbucket.org/something/my-dependency.git" } I followed the instructions given in [1] and [2] and created an SSH key that I encrypted with kms. I've created a custom cloudbuild.yaml as follows: # Decrypt the file containing the key steps: - name: 'gcr.io/cloud-builders/gcloud' args: - kms - decrypt - --ciphertext-file=bitbucket_rsa.enc - --plaintext-file=/root/.ssh/id_rsa - --location=global -

How to build a docker image using cloud build with sdk, in local machine without dying trying it

家住魔仙堡 提交于 2019-12-20 04:23:32
问题 I'm using cloud build to build a docker image Guiding myself from examples provide at github: ------bin ------pkg ------src --cloud.google.com --contrib.go.opencensus.io --github.com --go.opencensus.io --golang.org --google.golang.org --me --backend ------cloudbuild.yaml ------Dockerfile Where all my code is in src -> me -> backend Cloud build steps .yaml file content is: steps: - name: 'gcr.io/cloud-builders/go' args: ['install', 'me/backend'] env: ['GOPATH=.'] - name: 'gcr.io/cloud-builders

GCP cloudbuild.yaml conditional step error

冷暖自知 提交于 2019-12-13 02:49:21
问题 This is my cloud build file substitutions: _CLOUDSDK_COMPUTE_ZONE: us-central1-a _CLOUDSDK_CONTAINER_CLUSTER: $_CLOUDSDK_CONTAINER_CLUSTER steps: - name: gcr.io/$PROJECT_ID/sonar-scanner:latest entrypoint: 'bash' args: - '-c' - 'if [ $BRANCH_NAME != 'production' ]; then sonar-scanner -Dsonar.host.url=https://sonar.test.io -Dsonar.login=${_SONAR_LOGIN} -Dsonar.projectKey=service -Dsonar.sources=. ; fi' - id: 'build test-service image' name: 'gcr.io/cloud-builders/docker' args: ['build', '-t',

does appengine cloudbuild.yaml requires a custom runtime?

假如想象 提交于 2019-12-13 00:26:27
问题 Build errors out with below output (Using a Rails app) ERROR: (gcloud.app.deploy) There is a cloudbuild.yaml in the current directory, and the runtime field in /workspace/app.yaml is currently set to [runtime: ruby]. To use your cloudbuild.yaml to build a custom runtime, set the runtime field to [runtime: custom]. To continue using the [ruby] runtime, please remove the cloudbuild.yaml from this directory. 回答1: Cloudbuild.yaml should work with App Engine Flexible without the need to use a