-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
9 changed files
with
94 additions
and
55 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
/kfilt | ||
kfilt | ||
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,43 @@ | ||
project_name: kfilt | ||
before: | ||
hooks: | ||
- go mod download | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- windows | ||
- linux | ||
- darwin | ||
# Default is `-s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`. | ||
ldflags: | ||
- -s -w -X github.com/ryane/kfilt/cmd.Version={{.Version}} -X github.com/ryane/kfilt/cmd.GitCommit={{.ShortCommit}} | ||
archives: | ||
- format: binary | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "master" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- Merge pull request | ||
- Merge branch | ||
dockers: | ||
- goos: linux | ||
goarch: amd64 | ||
goarm: '' | ||
binaries: | ||
- kfilt | ||
image_templates: | ||
- "ryane/{{.ProjectName}}:latest" | ||
- "ryane/{{.ProjectName}}:{{ .Tag }}" | ||
skip_push: false | ||
dockerfile: Dockerfile | ||
build_flag_templates: | ||
- "--label=org.label-schema.schema-version=1.0" | ||
- "--label=org.label-schema.version={{.Version}}" | ||
- "--label=org.label-schema.name={{.ProjectName}}" |
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,24 @@ | ||
language: go | ||
|
||
go: | ||
- 1.12.x | ||
|
||
env: | ||
global: | ||
- GO111MODULE=on | ||
|
||
install: true | ||
|
||
services: | ||
- docker | ||
|
||
after_success: | ||
- test -n "$TRAVIS_TAG" && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" | ||
|
||
deploy: | ||
- provider: script | ||
skip_cleanup: true | ||
script: curl -sL https://git.io/goreleaser | bash | ||
on: | ||
tags: true | ||
condition: $TRAVIS_OS_NAME = linux |
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 |
---|---|---|
@@ -1,17 +1,3 @@ | ||
FROM golang:1.12-alpine3.9 as builder | ||
|
||
RUN apk --no-cache add make git gcc musl-dev && rm -rf /var/cache/apk/* | ||
WORKDIR /go/src/github.com/ryane/kfilt | ||
RUN GO111MODULE=off go get github.com/ahmetb/govvv | ||
ENV GO111MODULE=on | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
|
||
COPY . . | ||
RUN govvv install -pkg github.com/ryane/kfilt/cmd | ||
|
||
FROM alpine:3.9 | ||
RUN apk --no-cache add ca-certificates && rm -rf /var/cache/apk/* | ||
COPY --from=builder /go/bin/kfilt /bin/kfilt | ||
ENTRYPOINT ["/bin/kfilt"] | ||
FROM scratch | ||
COPY kfilt / | ||
ENTRYPOINT ["/kfilt"] |
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 |
---|---|---|
@@ -1,20 +1,22 @@ | ||
VERSION ?= $(shell cat VERSION) | ||
GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "-dirty") | ||
GIT_SHA = $(shell git rev-parse --short HEAD) | ||
GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "-dirty") | ||
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD) | ||
|
||
.PHONY: all | ||
all: build | ||
all: test build | ||
|
||
.PHONY: build | ||
build: deps | ||
govvv build -pkg github.com/ryane/kfilt/cmd | ||
build: | ||
go build | ||
|
||
.PHONY: test | ||
test: | ||
go test -v ./... | ||
|
||
.PHONY: docker | ||
docker: | ||
docker build -t ryane/kfilt:${VERSION}${GIT_DIRTY} . | ||
CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags "-w -X github.com/ryane/kfilt/cmd.Version=${GIT_BRANCH} -X github.com/ryane/kfilt/cmd.GitCommit=${GIT_SHA}${GIT_DIRTY}" . | ||
docker build -t ryane/kfilt:${GIT_SHA}${GIT_DIRTY} . | ||
|
||
push: build | ||
docker push ryane/kfilt:${VERSION}${GIT_DIRTY} | ||
|
||
.PHONY: deps | ||
deps: | ||
GO111MODULE=off go get github.com/ahmetb/govvv | ||
docker push ryane/kfilt:${GIT_SHA}${GIT_DIRTY} |
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 was deleted.
Oops, something went wrong.
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