google-cloud-build

How to use private, self hosted NPM package with Google App Engine node, standard environment

烂漫一生 提交于 2019-12-12 12:16:45
问题 I have an NPM package hosted on a private Bitbucket git repo (not in the official NPM registry). I have this in my package.json, under the "dependencies" key: "a-private-package" git+ssh://git@bitbucket.org:myusername/a-private-package.git It works when I run npm install locally as my SSH keys are used. But when I use gcloud app deploy to deploy to the app engine standard environment for node, I get a Host key verification failed from Google Cloud Build. I have tried: Adding a custom SSH key

Google Cloud Build timing out

天大地大妈咪最大 提交于 2019-12-12 10:35:54
问题 I have a Google Cloud Build build that times out after 10 min, 3 sec. Is there a way to extend that timeout? The build status is set to "Build failed (timeout)" and I'm okay with it taking longer than 10 minutes. 回答1: If you defined your build using a cloudbuild.yaml, you can just set the timeout field; see the full definition of a Build Resource in the documentation. If you are using the gcloud CLI, it takes a --timeout flag; try gcloud container builds submit --help for details. 回答2: In

Can Google Cloud Build be triggered by new Docker image in Container Registry?

[亡魂溺海] 提交于 2019-12-12 09:49:54
问题 I'm setting up a CI/CD using Google's cloud tools, and was expecting to have a trigger condition "when new image is uploaded to Container Registry". The use case is separating deployment from source (repo). Source would push Docker images and deployment would deploy them to a test stage. But Cloud Build only provides me a trigger choice between three source repos. link What would you use for test, QA and production deployment of Docker images, in a GKE context? 回答1: Meanwhile, there is a

Cloud Build fails to build the the simple build step with maven

天大地大妈咪最大 提交于 2019-12-12 01:25:33
问题 Testing the cloud-build Part of my cloudbuild.yaml - name: 'gcr.io/cloud-builders/mvn' args: ['dockerfile:build'] dockerfile:build perfectly works in bitbucket pipeline, no problem. I use <plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <version>${dockerfile-maven-version}</version> <executions> <execution> <id>default</id> <goals> <goal>build</goal> <goal>push</goal> </goals> </execution> </executions> <configuration> <repository>gcr.io/my-project-id/$

How can Cloud Build take dynamic parameters to increment a registry tag?

隐身守侯 提交于 2019-12-11 16:28:04
问题 I want my Cloud Build to push an image to a registry with an incremented tag. So, when the trigger arrives from GitHub, build the image, and if the latest tag was 1.10 , tag the new one 1.11 . Similarly, the 1.11 value will serve in multiple other steps in the build. Reading the registry and incrementing the tag is easy (in a bash Cloud Build step), but Cloud Build has no way to pass parameters. (Substitutions come from outside the Cloud Build process, for example from the Git tags, and are

Deploying to Google App engine flexible for go1.12 fails

梦想的初衷 提交于 2019-12-11 15:05:14
问题 I have a service that looks somewhat like this - service | |__cmd | |_main.go | |_ app.yaml |_ cloudbuild.yaml |_ service.go |_ someHelper.go I have a few private packages that I include in go.mod and after a lengthy build process I have an image that can be deployed to GAE. However, I get this error after I deploy - Starting Step #6 - "deploy app" Step #6 - "deploy app": Already have image (with digest): gcr.io/cloud-builders/gcloud Step #6 - "deploy app": ERROR: (gcloud.app.deploy) Staging

Problems connecting to BitBucket with Cloud Build and Source Repositories

*爱你&永不变心* 提交于 2019-12-11 04:45:48
问题 I'm GCP project owner and trying to connect a BitBucket repo as mirror in Cloud Source Repos . Also have a Cloud Build trigger based on a BitBucket repo. In Cloud Source Repositories , after granting access to my account, while configuring a mirror, no repositories from BitBucket appear and the following is displayed: The Bitbucket account [username] doesn't have access to any Bitbucket repositories. You will need to grant this account permission to repositories in Bitbucket before you can

Run node.js database migrations on Google Cloud SQL during Google Cloud Build

孤人 提交于 2019-12-09 13:05:01
问题 I would like to run database migrations written in node.js during the Cloud Build process. Currently, the database migration command is being executed but it seems that the Cloud Build process does not have access to connect to Cloud SQL via an IP address with username/password. 回答1: In the case with Cloud SQL and Node.js it would look something like this: steps: # Install Node.js dependencies - id: yarn-install name: node:dubnium entrypoint: yarn waitFor: ['-'] # Install CLoud SQL proxy - id

How do I set an environment or substitution variable via a step in Google Cloud Build?

喜欢而已 提交于 2019-12-09 09:59:54
问题 Basically, when using Google Cloud Build, how do I read a value that was written in an earlier build step in subsequent steps? Specifically, I'd like to make a custom image tag that's based on a combination of the timestamp and $SHORT_SHA. Something like the below. Though, it doesn't work, as docker complains about "export", and, even if that worked, it likely will be a different env: # Setting tag in a variable: - name: 'ubuntu' args: ['export', '_BUILD_TAG=`date', '-u', '+%Y%m%dT%H%M%S_

Google Cloud Build doesn't substitute values in secrets section of cloudbuild.yaml

断了今生、忘了曾经 提交于 2019-12-08 01:55:16
问题 I'm trying to create a Cloud Build trigger where secret environment variables are encrypted with cloud KMS and stored as a substitution variable in Cloud Build. This way my cloud build yaml is fairly generic and the same across all environments we're deploying to. This cloud build yaml works fine: steps: - name: 'ubuntu' entrypoint: 'bash' args: ['-c', 'echo "$$APP_NAME HAS A VALUE $$HELLO_WORLD"'] env: - 'APP_NAME=${_APP_NAME}' secretEnv: - 'HELLO_WORLD' secrets: - kmsKeyName: 'projects/my