3

I'm trying to build a simple CI that goes

  1. When pushed to main branch on one of my Source Repo
  2. Deploy Cloud Functions

But after all process seems to succeed, Unable to delete previous cache image: DELETE・・・ & the error in the title shows up and fails to deploy.

If I do this on console, it just comes through. I've tried changing the role of Cloud Build service account from developer to owner but no luck.

Do I have to add some line in yaml to delete the cache? If so, where is the reference for that line?

Here is my yaml config;

steps:
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
  args:
  - gcloud
  - functions
  - deploy
  - FUNCTION_NAME
  - --region=asia-northeast1
  - --memory=256MB
  - --trigger-topic=TOPIC_NAME
  - --retry
  - --runtime=python39
  - --entry-point=PYTHON_FUNC
  - --timeout=540s
  - --max-instances=1
  - --set-env-vars=[KEY=VALUE]

Update

I added - --remove-labels=[latest] in yaml but still no luck.

1 Answers1

0

From gcloud cli docs you must specify --source if updating a cloud function that was previously deployed from a git repository.

This is not mentioned i thw cloud functions deployment docs but it did indeed fix the issue for me.

machazthegamer
  • 593
  • 8
  • 18
  • Ooooh, thought it's set on Cloud Build config level but have to write it in the code, too? Thank you very much! Will try this out. – Kantumrobot Apr 13 '22 at 00:30