Not seeing output in Cloud Build logs when running with Deployment Manager

Viewed 660

I'm trying to run Cloud Build with Deployment Manager but I'm not seeing the output of commands in the build logs.

imports:
  - path: somefolder/**

resources:
  - name: build-something
    action: gcp-types/cloudbuild-v1:cloudbuild.projects.builds.create
    metadata:
      runtimePolicy:
        - UPDATE_ALWAYS
        #- UPDATE_ON_CHANGE
    properties:
      steps:
        - name: 'ubuntu'
          args: ['bash', '-c', 'echo', '====================================================']
        - name: 'ubuntu'
          args: ['bash', '-c', 'pwd']
        - name: 'ubuntu'
          args: ['bash', '-c', 'ls', '-laR']
      timeout: 120s

I don't see the output of echo '=====' or ls -laR in the logs in the console: enter image description here

1 Answers

1 - Regarding the first step, you need to define it as follow:

- name: 'ubuntu'
  args: ['bash', '-c', 'echo "===================================================="']

2 - Regarding the last step, I believe that the command does work but that there's indeed no files or directory to list in /workspace. When I run this build by creating a cloudbuild.yaml file with your exact step and running gcloud builds submit ., I see the cloudbuild.yaml file listed.

Related