-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd72a2d
commit 5bb1991
Showing
7 changed files
with
716 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#Dockerfile vars | ||
|
||
#vars | ||
IMAGENAME=go-proxy | ||
TAG= | ||
BUILDDATE=${shell date -u +%Y-%m-%dT%H:%M:%SZ} | ||
IMAGEFULLNAME=avhost/${IMAGENAME} | ||
BRANCH=${shell git symbolic-ref --short HEAD} | ||
|
||
.PHONY: help build bootstrap all docs publish push version | ||
|
||
help: | ||
@echo "Makefile arguments:" | ||
@echo "" | ||
@echo "Makefile commands:" | ||
@echo "push" | ||
@echo "build" | ||
@echo "build-bin" | ||
@echo "all" | ||
@echo "docs" | ||
@echo "publish" | ||
@echo "version" | ||
@echo ${TAG} | ||
|
||
.DEFAULT_GOAL := all | ||
|
||
build: | ||
@echo ">>>> Build docker image" | ||
@docker buildx build --build-arg TAG=${TAG} --build-arg BUILDDATE=${BUILDDATE} -t ${IMAGEFULLNAME}:${BRANCH} . | ||
|
||
push: | ||
@echo ">>>> Push into private repo" | ||
@docker push localhost:5000/mesos-m3s:dev | ||
|
||
build-bin: | ||
@echo ">>>> Build binary" | ||
@CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags "-X main.BuildVersion=${BUILDDATE} -X main.GitVersion=${TAG} -X main.VersionURL=${VERSION_URL} -extldflags \"-static\"" . | ||
|
||
publish-latest: | ||
@echo ">>>> Publish docker image" | ||
docker tag ${IMAGEFULLNAME}:${BRANCH} ${IMAGEFULLNAME}:latest | ||
docker push ${IMAGEFULLNAME}:latest | ||
|
||
publish-tag: | ||
@echo ">>>> Publish docker image" | ||
@docker push ${IMAGEFULLNAME}:${BRANCH} | ||
|
||
update-gomod: | ||
go get -u | ||
|
||
seccheck: | ||
gosec --exclude G104 --exclude-dir ./vendor ./... | ||
|
||
sboom: | ||
syft dir:. > sbom.txt | ||
syft dir:. -o json > sbom.json | ||
|
||
all: build seccheck sboom publish-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.