Ayub Malik
Ayub Malik

Reputation: 2578

Google cloud build docker multistage build store test artfifacts

Give I have a cloudbuild.yaml file which builds a multistage Dockerfile, how do I store artifacts generated by Docker?

My Dockerfile contains this section:

FROM golang:1.23-alpine AS build
WORKDIR /app
RUN go test -timeout 1m -v ./... > test.log
RUN go build -ldflags="-s -w" -o /app/hello-app ./
... 

in my cloudbuild.yaml how do I refer to the /app/test.log under the artifacts section?

If I try this

artifacts:
    objects:
        location: 'gs://mybucket/test-results'
        paths: ['/app/test.log']

I get an error in build output

CommandException: No URLs matched: /app/test.log

Upvotes: 3

Views: 23

Answers (0)

Related Questions