Skip to content

Step 9 - cleanup - awk commands refer to wrong field ($) #63

@christoforos86

Description

@christoforos86

Hello and thanks for the the tutorial on "Deploy a website with Cloud Run".
I believe that step 9 for cleaning up has an issue in the section for "Delete Cloud Build artifacts from Cloud Storage":
The command for printing all available soures is:
gcloud builds list | awk 'NR > 1 {print $4}'
This returns blank lines.
image

If I run "gcloud builds list", the results with the available source archives only have data in two fields, one with the description of the fields ($1) and one with the information ($2).
image
When running for field 1, I get the following:
image
When running for field 2, I get the following:
image

I believe that the $4 in the example is wrong as there is no 4th field to populate data from as the fields seem to be read in columns.
That explains why when running with $4, I get blank lines, since there is no 4 field when the data are read columnwise.

I assume the intention was to read rows of IDs, and except for the first one (which is the last one created), pull the 4th field (SOURCE) for other entries and remove them.

However for that to happen, I assume some additional command is required to read the fields in rows for each entry?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions