-
Notifications
You must be signed in to change notification settings - Fork 7
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
04bf607
commit 2be595c
Showing
7 changed files
with
97 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
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,31 @@ | ||
builds: | ||
- main: ./cmd/gomodguard/main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
checksum: | ||
name_template: 'checksums.txt' | ||
dockers: | ||
- goos: linux | ||
goarch: amd64 | ||
binaries: | ||
- gomodguard | ||
image_templates: | ||
- "ryancurrah/gomodguard:latest" | ||
- "ryancurrah/gomodguard:{{.Tag}}" | ||
skip_push: false | ||
dockerfile: Dockerfile.goreleaser | ||
build_flag_templates: | ||
- "--pull" | ||
- "--build-arg=gomodguard_VERSION={{.Version}}" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.name={{.ProjectName}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
- "--label=org.opencontainers.image.source={{.GitURL}}" |
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,17 @@ | ||
ARG GO_VERSION=1.14.2 | ||
ARG ALPINE_VERSION=3.11 | ||
ARG gomodguard_VERSION= | ||
|
||
# ---- Build container | ||
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS builder | ||
WORKDIR /gomodguard | ||
COPY . . | ||
RUN apk add --no-cache git | ||
RUN go build -o gomodguard cmd/gomodguard/main.go | ||
|
||
# ---- App container | ||
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} | ||
WORKDIR / | ||
RUN apk --no-cache add ca-certificates | ||
COPY --from=builder gomodguard/gomodguard / | ||
ENTRYPOINT ./gomodguard |
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,10 @@ | ||
ARG GO_VERSION=1.14.2 | ||
ARG ALPINE_VERSION=3.11 | ||
ARG gomodguard_VERSION= | ||
|
||
# ---- App container | ||
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} | ||
WORKDIR / | ||
RUN apk --no-cache add ca-certificates | ||
COPY gomodguard /gomodguard | ||
ENTRYPOINT ./gomodguard |
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,37 @@ | ||
current_dir = $(shell pwd) | ||
version = $(shell printf '%s' $$(cat VERSION)) | ||
|
||
.PHONEY: lint | ||
lint: | ||
golangci-lint run -v --enable-all --disable funlen,gochecknoglobals,lll ./... | ||
|
||
.PHONEY: build | ||
build: | ||
go build -o gomodguard cmd/gomodguard/main.go | ||
|
||
.PHONEY: dockerbuild | ||
dockerbuild: | ||
docker build --build-arg GOMODGUARD_VERSION=${version} --tag ryancurrah/gomodguard:${version} . | ||
|
||
.PHONEY: run | ||
run-basicauth: build | ||
./gomodguard | ||
|
||
.PHONEY: dockerrun | ||
dockerrun: dockerbuild | ||
docker run -v "${current_dir}/.gomodguard.yaml:/.gomodguard.yaml" ryancurrah/gomodguard:latest | ||
|
||
.PHONEY: release | ||
release: | ||
git tag ${version} | ||
git push --tags | ||
goreleaser --skip-validate --rm-dist | ||
|
||
.PHONEY: clean | ||
clean: | ||
rm -rf dist/ | ||
rm -f gomodguard | ||
|
||
.PHONEY: install-tools-mac | ||
install-tools-mac: | ||
brew install goreleaser/tap/goreleaser |
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 @@ | ||
v1.0.3 |
File renamed without changes.