google-cloud-build

Run Google Cloud Build in a specific region and zone?

让人想犯罪 __ 提交于 2021-01-24 08:53:06
问题 Is it possible to specify to run a Google Cloud Build in a specific region and zone? The documentation seems to outline how to run a kubectl in a specific region/zone for deploying containers, but it doesn't seem to document where to run the cloud build itself. I've also not found this setting in the automatic build trigger configuration. 回答1: This is not yet an available feature, however, at Google Next we announced an EAP / soon to be Alpha feature called "Custom Workers" which will enable

Access environment variables stored in Google Secret Manager from Google Cloud Build

我的未来我决定 提交于 2021-01-04 05:40:12
问题 How can I access the variables I define in Google Secret Manager from my Google Cloud Build Pipeline ? 回答1: You can access to secret from Cloud Build by using the standard Cloud Builder gcloud But, there is 2 issues: If you want to use the secret value in another Cloud Build step, you have to store your secret in a file, the only way to reuse a previous value from one step to another one The current Cloud Builder gcloud isn't up to date (today, 03 feb 2020). You have to add a gcloud component

How to set environment variables using Google Cloud Build or other method in Google App Engine Standard Environment?

落花浮王杯 提交于 2020-12-24 07:47:28
问题 Is there anyway to inject environment variables from Cloud Build into the App Engine Standard environment? I do not want to push my environment variables to GitHub inside the app.yaml or .env . Thus, when Cloud Build pulls and deploys it is missing the .env file and the server is unable to complete some requests. I am trying to avoid using Datastore as the async nature of Datastore will make the code a lot more messy. I tried to use encrypted secrets found here, but that doesn't seem to work

Upload build folder in Google Cloud Build

痴心易碎 提交于 2020-12-11 22:15:12
问题 I'm trying to upload my React app to App Engine using Cloud Build but it upload all source files. Is it possible to only deploy the build folder using Cloud Build pipeline? Current pipeline: steps: # Install - name: 'gcr.io/cloud-builders/npm' args: ['install'] # Build - name: 'gcr.io/cloud-builders/npm' args: ['run', 'build'] # Deploy - name: "gcr.io/cloud-builders/gcloud" args: ["app", "deploy"] timeout: "1600s" 回答1: I assume that you want to only deploy the Build folder and not to upload

Upload build folder in Google Cloud Build

岁酱吖の 提交于 2020-12-11 22:09:57
问题 I'm trying to upload my React app to App Engine using Cloud Build but it upload all source files. Is it possible to only deploy the build folder using Cloud Build pipeline? Current pipeline: steps: # Install - name: 'gcr.io/cloud-builders/npm' args: ['install'] # Build - name: 'gcr.io/cloud-builders/npm' args: ['run', 'build'] # Deploy - name: "gcr.io/cloud-builders/gcloud" args: ["app", "deploy"] timeout: "1600s" 回答1: I assume that you want to only deploy the Build folder and not to upload

Upload build folder in Google Cloud Build

匆匆过客 提交于 2020-12-11 22:09:29
问题 I'm trying to upload my React app to App Engine using Cloud Build but it upload all source files. Is it possible to only deploy the build folder using Cloud Build pipeline? Current pipeline: steps: # Install - name: 'gcr.io/cloud-builders/npm' args: ['install'] # Build - name: 'gcr.io/cloud-builders/npm' args: ['run', 'build'] # Deploy - name: "gcr.io/cloud-builders/gcloud" args: ["app", "deploy"] timeout: "1600s" 回答1: I assume that you want to only deploy the Build folder and not to upload

Running python unit test in Google Cloud Build

允我心安 提交于 2020-12-10 09:00:26
问题 I would like Google Cloud Build to run the unit test I have in my python project after pushing the changes. I am able to configure the step that runs the test, but I am not sure how to input the directory the holds the test and if I just put . then it run 0 test my project structure is: - project_name - package_name - test - sample_test.py This is my cloudbuild.yaml configuration: steps: - name: 'gcr.io/cloud-builders/docker' args: ["run","gcr.io/google-appengine/python","python3","-m",

Running python unit test in Google Cloud Build

点点圈 提交于 2020-12-10 08:59:05
问题 I would like Google Cloud Build to run the unit test I have in my python project after pushing the changes. I am able to configure the step that runs the test, but I am not sure how to input the directory the holds the test and if I just put . then it run 0 test my project structure is: - project_name - package_name - test - sample_test.py This is my cloudbuild.yaml configuration: steps: - name: 'gcr.io/cloud-builders/docker' args: ["run","gcr.io/google-appengine/python","python3","-m",

Execute a BigQuery query in Cloud Build step

怎甘沉沦 提交于 2020-12-10 08:45:11
问题 I'm using Cloud Build with the gcloud builder. I override the entrypoint to be bq so I can run some BigQuery SQL in my build step. Previously, I had the SQL embedded directly in the YAML config for Cloud Build. This works fine: steps: - name: gcr.io/cloud-builders/gcloud entrypoint: 'bq' args: ['query', '--use_legacy_sql=false', 'SELECT 1'] Now I'd like to refactor the SQL out of the YAML and into a file instead. According to here, you can cat the file or pipe it to bq . This works on the

Cloud Build fails to deploy to Google App Engine - You do not have permission to act as @appspot.gserviceaccount.com

♀尐吖头ヾ 提交于 2020-12-01 07:59:25
问题 This morning I made a PR which triggered a Cloud Build for my staging enviroment but failed to deploy the results to GAE. The error was as follows: ERROR: (gcloud.app.deploy) PERMISSION_DENIED: You do not have permission to act as '[redacted]@appspot.gserviceaccount.com' Step #4: - '@type': type.googleapis.com/google.rpc.ResourceInfo Step #4: description: You do not have permission to act as this service account. Step #4: resourceName: [redacted]@appspot.gserviceaccount.com Step #4: