0

I am trying to add the flags that are mentioned in the GCP's cloud build deploy using the gcp-cloud-run orb. The documentation mentions the use of args to add the flags. The build was completed successfully with the service getting deployed but none of the flags are working.

Here is the config:

    version: 2.1
    orbs:
        gcp-cloud-run: circleci/gcp-cloud-run@1.0.2
        gcp-gcr: circleci/gcp-gcr@0.15.0
    jobs:
        build_and_deploy:
        docker:
          - image: 'cimg/base:stable'
        steps:
          - checkout
          - gcp-cloud-run/init
          - gcp-gcr/gcr-auth

       - setup_remote_docker:
          version: 20.10.14
          docker_layer_caching: true
      
       - gcp-gcr/build-image:
          path: "<path-to-dockerfile>"
          image: "gcr.io/test/image"
  
       - gcp-gcr/push-image:
           image: "gcr.io/test/image"
  
       - gcp-cloud-run/deploy:
           image: ""gcr.io/test/image:latest"
           platform: managed
           region: us-central1
           service-name: test-service
           unauthenticated: false
           args: --memory="1Gi" --min-instances="5" --labels=["version=0.1"]
   
    workflows:
        build_and_deploy_to_managed_workflow:
          jobs:
            - build_and_deploy

Here is the documentation screenshot: enter image description here

Amogh Mishra
  • 1,088
  • 1
  • 16
  • 25
  • 1
    Based on this post, the CircleCI orb cannot pass args. Try these workarounds: using [github actions](https://github.com/CircleCI-Public/gcp-cloud-run-orb/issues/5#issuecomment-686179264) and [wild-orchid-watch-api-facade](https://github.com/CircleCI-Public/gcp-cloud-run-orb/issues/5#issuecomment-708938591). – Sarah Remo Nov 29 '22 at 00:03
  • Did my previous comment address your concern? – Sarah Remo Nov 29 '22 at 22:21
  • @SarahRemo didn't try it but you were right the orb cannot pass args. – Amogh Mishra Apr 04 '23 at 17:14

1 Answers1

0

You can pass in args like this

args: '--memory 1Gi'

for example

       - gcp-cloud-run/deploy:
           image: ""gcr.io/test/image:latest"
           platform: managed
           region: us-central1
           service-name: test-service
           unauthenticated: false
           args: '--memory 1Gi'

I haven't tried with multiple args but since it's a string I'd assume it'd be separated with space or comma like this

args: '--memory 1Gi --min-instances 5'