From adfa290420c800f583aaa100c4e0f5a33fcbd173 Mon Sep 17 00:00:00 2001 From: Tyler Slaton Date: Wed, 13 Apr 2022 18:10:43 -0400 Subject: [PATCH] feat(crdvalidator): add goreleaser support Signed-off-by: Tyler Slaton --- .goreleaser.yml | 9 +++++++++ Dockerfile.crdvalidator | 23 ----------------------- Makefile | 2 +- 3 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 Dockerfile.crdvalidator diff --git a/.goreleaser.yml b/.goreleaser.yml index a1228275..049222e1 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -35,6 +35,15 @@ builds: - amd64 ldflags: - -X {{ .Env.PKG }}.GitCommit={{ .ShortCommit }} + - id: crdvalidator + main: ./cmd/crdvalidator + binary: crdvalidator + goos: + - linux + goarch: + - amd64 + ldflags: + - -X {{ .Env.PKG }}.GitCommit={{ .ShortCommit }} dockers: - image_templates: - "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-amd64" diff --git a/Dockerfile.crdvalidator b/Dockerfile.crdvalidator deleted file mode 100644 index 345d90f1..00000000 --- a/Dockerfile.crdvalidator +++ /dev/null @@ -1,23 +0,0 @@ -FROM golang:1.17-buster AS builder - -WORKDIR /workspace -# Copy the Go Modules manifests -COPY go.mod go.mod -COPY go.sum go.sum -# cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN go mod download - -COPY Makefile Makefile -COPY cmd/crdvalidator cmd/crdvalidator - -RUN make crdvalidator - -FROM gcr.io/distroless/static:debug - -WORKDIR / -COPY --from=builder /workspace/bin/crdvalidator . -EXPOSE 443 - -ENTRYPOINT ["/crdvalidator"] -CMD ["run"] diff --git a/Makefile b/Makefile index 68391df0..252402ec 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ test-e2e: ginkgo ## Run the e2e tests $(GINKGO) -trace -progress $(FOCUS) test/e2e e2e: KIND_CLUSTER_NAME=rukpak-e2e -e2e: build-container kind-cluster kind-load cert-mgr kind-load-bundles deploy test-e2e test-crdvalidator-e2e ## Run e2e tests against a kind cluster +e2e: build-container kind-cluster kind-load cert-mgr kind-load-bundles deploy test-e2e ## Run e2e tests against a kind cluster kind-cluster: ## Standup a kind cluster for e2e testing usage ${KIND} delete cluster --name ${KIND_CLUSTER_NAME}