Skip to content

Commit

Permalink
bake target to generate certs for e2e tets
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit d234a81)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
crazy-max authored and thaJeztah committed Mar 27, 2023
1 parent 6a8406e commit 80f2798
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
6 changes: 6 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,9 @@ target "e2e-image" {
VERSION = VERSION
}
}

target "e2e-gencerts" {
inherits = ["_common"]
dockerfile = "./e2e/testdata/Dockerfile.gencerts"
output = ["./e2e/testdata"]
}
19 changes: 19 additions & 0 deletions e2e/testdata/Dockerfile.gencerts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION=1.19.7

FROM golang:${GO_VERSION}-alpine AS generated
RUN go install github.com/dmcgowan/quicktls@master
WORKDIR /tmp/gencerts/notary
RUN --mount=type=bind,source=e2e/testdata/notary,target=/tmp/gencerts/notary,rw <<EOT
set -eu
mkdir -p ../notary-evil /out
quicktls -org=Docker -with-san notary-server notaryserver evil-notary-server evilnotaryserver localhost 127.0.0.1
cat ca.pem >> notary-server.cert
mv ca.pem root-ca.cert
cp notary-server.cert notary-server.key root-ca.cert ../notary-evil
cp -r /tmp/gencerts/notary* /out/
EOT

FROM scratch
COPY --from=generated /out /
12 changes: 0 additions & 12 deletions e2e/testdata/gen-certs.sh

This file was deleted.

0 comments on commit 80f2798

Please sign in to comment.