File tree Expand file tree Collapse file tree 2 files changed +57
-1
lines changed Expand file tree Collapse file tree 2 files changed +57
-1
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,36 @@ WORKDIR /
4
4
COPY . /
5
5
RUN go build .
6
6
7
+
7
8
FROM bats/bats:v1.1.0 as acceptance
8
9
COPY --from=builder /conftest /usr/local/bin
9
10
COPY acceptance.bats /acceptance.bats
10
- COPY testdata /testdata
11
+ COPY examples /examples
11
12
RUN ./acceptance.bats
13
+
14
+
15
+ FROM golang:1.12-alpine as examples
16
+
17
+ ENV TERRAFORM_VERSION=0.12.0-rc1 \
18
+ KUSTOMIZE_VERSION=2.0.3
19
+
20
+ COPY --from=builder /conftest /usr/local/bin
21
+ COPY examples /examples
22
+
23
+ RUN apk add --update npm make git jq ca-certificates openssl unzip wget && \
24
+ cd /tmp && \
25
+ wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
26
+ unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin
27
+
28
+ RUN wget -O /usr/local/bin/kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/v${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64 && \
29
+ chmod +x /usr/local/bin/kustomize
30
+
31
+ RUN go get -u cuelang.org/go/cmd/cue
32
+
33
+ WORKDIR /examples
34
+
35
+
36
+ FROM scratch
37
+ COPY --from=builder /conftest /
38
+ ENTRYPOINT ["/conftest" ]
39
+ CMD ["--help" ]
Original file line number Diff line number Diff line change
1
+
2
+ TAG =$(shell git describe --abbrev=0 --tags)
3
+
4
+ NAME =conftest
5
+ IMAGE =instrumenta/$(NAME )
6
+
7
+ COMMAND =docker
8
+ BUILD=DOCKER_BUILDKIT =1 $(COMMAND ) build
9
+ PUSH =$(COMMAND ) push
10
+
11
+ all : push
12
+
13
+ examples :
14
+ $(BUILD ) --target examples -t instrumenta/conftest:examples .
15
+
16
+ acceptance :
17
+ $(BUILD ) --target acceptance .
18
+
19
+ conftest :
20
+ $(BUILD ) -t $(IMAGE ) :$(TAG ) .
21
+ $(COMMAND ) tag $(IMAGE ) :$(TAG ) $(IMAGE ) :latest
22
+
23
+ push : example conftest
24
+ $(PUSH ) $(IMAGE ) :$(TAG )
25
+ $(PUSH ) $(IMAGE ) :latest
26
+ $(PUSH ) $(IMAGE ) :examples
27
+
28
+ .PHONY : examples acceptance conftest push all
You can’t perform that action at this time.
0 commit comments