mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
Generate all release artifacts using Goreleaser, update Makefile
This commit is contained in:
parent
ec52b39db3
commit
5bce1d4180
2 changed files with 11 additions and 19 deletions
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
|
@ -11,7 +11,7 @@ jobs:
|
|||
run: make docker-test
|
||||
|
||||
- name: build
|
||||
run: make build-single-target
|
||||
run: make goreleaser-build-static
|
||||
|
||||
- name: acceptance-test
|
||||
run: make docker-acceptance
|
||||
|
|
|
|||
28
Makefile
28
Makefile
|
|
@ -2,34 +2,26 @@
|
|||
|
||||
RELEASE_VERSION ?= latest
|
||||
|
||||
.PHONY: test-build test build build-static docker-test docker-build-static build-bats docker-acceptance docker-image release update-deps
|
||||
.PHONY: local-test local-build local-build-static docker-test docker-build docker-build-static build-bats docker-acceptance release update-deps build-single-target
|
||||
|
||||
test-build: test build
|
||||
|
||||
test:
|
||||
local-test:
|
||||
go test -race ./...
|
||||
|
||||
build:
|
||||
local-build:
|
||||
go build -o bin/ ./...
|
||||
|
||||
docker-image:
|
||||
docker build -t kubeconform:${RELEASE_VERSION} .
|
||||
|
||||
save-image:
|
||||
docker save --output kubeconform-image.tar kubeconform:${RELEASE_VERSION}
|
||||
|
||||
push-image:
|
||||
docker tag kubeconform:latest ghcr.io/yannh/kubeconform:${RELEASE_VERSION}
|
||||
docker push ghcr.io/yannh/kubeconform:${RELEASE_VERSION}
|
||||
|
||||
build-static:
|
||||
local-build-static:
|
||||
CGO_ENABLED=0 GOFLAGS=-mod=vendor GOOS=linux GOARCH=amd64 GO111MODULE=on go build -trimpath -tags=netgo -ldflags "-extldflags=\"-static\"" -a -o bin/ ./...
|
||||
|
||||
# These only used for development. Release artifacts and docker images are produced by goreleaser.
|
||||
docker-test:
|
||||
docker run -t -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform golang:1.17 make test
|
||||
|
||||
docker-build-static:
|
||||
docker run -t -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform golang:1.17 make build-static
|
||||
docker run -t -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform golang:1.17 make local-build
|
||||
|
||||
docker-build-static:
|
||||
docker run -t -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform golang:1.17 make local-build-static
|
||||
|
||||
build-bats:
|
||||
docker build -t bats -f Dockerfile.bats .
|
||||
|
|
@ -38,7 +30,7 @@ docker-acceptance: build-bats
|
|||
docker run -t bats -p acceptance.bats
|
||||
docker run --network none -t bats -p acceptance-nonetwork.bats
|
||||
|
||||
build-single-target:
|
||||
goreleaser-build-static:
|
||||
docker run -t -e GOOS=linux -e GOARCH=amd64 -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform goreleaser/goreleaser:v0.176.0 build --single-target --skip-post-hooks --rm-dist --snapshot
|
||||
cp dist/kubeconform_linux_amd64/kubeconform bin/
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue