Although i can successfully use gcloud app deploy from my local machine, I get this error when i try to use cloud builder to deploy using python runtime to the flex environment e.g. with build 1db0be0d-9143-4ad4-9f1d-1d952d42c38e
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: python]. To use your cloudbuild.yaml to build a custom runtime, set the runtime field to [runtime: custom]. To continue using the [python] runtime, please remove the cloudbuild.yaml from this directory.
app.yaml looks like this:
runtime: python
env: flex
entrypoint: gunicorn -b :$PORT application:app
runtime_config:
python_version: 3
automatic_scaling:
min_num_instances: 1
max_num_instances: 2
cool_down_period_sec: 180
cpu_utilization:
target_utilization: 0.6
<truncated>
cloudbuild.yaml looks like this:
steps:
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "deploy"]
timeout: "1600s"
This sounds like a faulty expectation on the part of gcloud app deploy, I'll file a bug to clarify with that team.
In the meantime, if you rename your cloudbuild.yaml to something-else.yaml does your deployment work? They might be looking for a file named exactly that, in which case renaming would unblock you.
yes, if i remove cloudbuild.yaml i can deploy from the command line. But of course without cloudbuild.yaml i cant use a build trigger to automatically deploy from git e.g. https://cloud.google.com/source-repositories/docs/quickstart-triggering-builds-with-source-repositories
@mnbf9rca @ImJasonH any progress solving issue? I have the same issues with using cloudbuild and build triggers on git branch push.
Same problem here using PHP runtime...
I'm having a hard time understanding how I can set up a cloud build trigger of my python app engine project. What is an obvious alternative?
I was having this problem with a nodejs project as well.
Moving/renaming app.yaml did not fix the issue. The gcloud command seems to flat out refuse to deploy if it sees cloudbuild.yaml in the root directory.
I was able to resolve this issue by moving the cloudbuild.yaml to a subdirectory instead, and updating the cloud build trigger to point to the moved cloudbuild.yaml
I had this problem and worked around it by renaming cloudbuild.yaml to cloud_build.yaml, as suggested by @ImJasonH. I didn't need to move it into a sub-directory.
Is there a workaround to use the GitHub Cloudbuild App and cloudbuild triggers simultaneous?
try renaming / moving + using the new customized trigger option for the Github App per https://cloud.google.com/blog/products/devops-sre/cloud-build-brings-advanced-cicd-capabilities-to-github
Closing as off-topic; this issue tracker is for issues with the cloud-builders build steps. For issues with the hosted service, including cloudbuild triggers and the Github Cloudbuild App, please contact Google Cloud Support.
Most helpful comment
try renaming / moving + using the new customized trigger option for the Github App per https://cloud.google.com/blog/products/devops-sre/cloud-build-brings-advanced-cicd-capabilities-to-github