How to add multiple args in the Cloud run orb in CircleCI?

195 Views Asked by At

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/[email protected]
        gcp-gcr: circleci/[email protected]
    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

1

There are 1 best solutions below

1
On

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'