-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathDockerfile
26 lines (22 loc) · 877 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
ARG base_image=concourse/resource-types-base-image-static:latest
ARG builder_image=concourse/golang-builder
FROM ${builder_image} AS builder
COPY . $GOPATH/src/github.com/concourse/github-release-resource
ENV CGO_ENABLED=0
WORKDIR $GOPATH/src/github.com/concourse/github-release-resource
RUN go mod vendor
RUN go build -o /assets/out github.com/concourse/github-release-resource/cmd/out
RUN go build -o /assets/in github.com/concourse/github-release-resource/cmd/in
RUN go build -o /assets/check github.com/concourse/github-release-resource/cmd/check
RUN set -e; for pkg in $(go list ./...); do \
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done
FROM ${base_image} AS resource
USER root
COPY --from=builder /assets /opt/resource
FROM resource AS tests
COPY --from=builder /tests /tests
RUN set -e; for test in /tests/*.test; do \
$test; \
done
FROM resource