-
Notifications
You must be signed in to change notification settings - Fork 678
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
287495c
commit 621524e
Showing
32 changed files
with
322 additions
and
255 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,77 @@ | ||
linters-settings: | ||
errcheck: | ||
# ignore cases where we truly don't care about the returned error | ||
ignore: net/http:^Write$,io:^WriteString$ | ||
govet: | ||
check-shadowing: true | ||
settings: | ||
printf: | ||
funcs: | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf | ||
golint: | ||
min-confidence: 0 | ||
gocyclo: | ||
min-complexity: 12 | ||
maligned: | ||
suggest-new: true | ||
dupl: | ||
threshold: 100 | ||
goconst: | ||
min-len: 2 | ||
min-occurrences: 2 | ||
depguard: | ||
list-type: blacklist | ||
misspell: | ||
locale: US | ||
lll: | ||
line-length: 160 | ||
goimports: | ||
local-prefixes: github.com/gliderlabs/logspout | ||
gocritic: | ||
settings: | ||
hugeParam: | ||
sizeThreshold: 160 | ||
enabled-tags: | ||
- performance | ||
nakedret: | ||
max-func-lines: 65 | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- maligned | ||
- prealloc | ||
- gochecknoglobals | ||
- funlen | ||
- gochecknoinits | ||
|
||
issues: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-rules: | ||
# Exclude some linters from running on tests files. | ||
- path: _test\.go | ||
linters: | ||
- dupl | ||
- errcheck | ||
- goconst | ||
- gocyclo | ||
- gosec | ||
- lll | ||
- nakedret | ||
- unparam | ||
- funlen | ||
|
||
run: | ||
deadline: 2m | ||
issues-exit-code: 1 | ||
|
||
# golangci.com configuration | ||
# https://github.com/golangci/golangci/wiki/Configuration | ||
service: | ||
golangci-lint-version: 1.18.x # use the fixed version to not introduce new linters unexpectedly | ||
prepare: | ||
- echo "here I can run custom commands, but no preparation needed for this repo" | ||
|
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,4 +1,4 @@ | ||
FROM alpine:3.9 | ||
FROM alpine:3.10 | ||
ENTRYPOINT ["/bin/logspout"] | ||
VOLUME /mnt/routes | ||
EXPOSE 80 | ||
|
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,12 +1,9 @@ | ||
FROM alpine:3.9 | ||
FROM alpine:3.10 | ||
VOLUME /mnt/routes | ||
EXPOSE 80 | ||
|
||
ENV GOPATH /go | ||
RUN apk --no-cache add go build-base git mercurial ca-certificates | ||
COPY . /go/src/github.com/gliderlabs/logspout | ||
WORKDIR /go/src/github.com/gliderlabs/logspout | ||
RUN go get | ||
CMD go get \ | ||
&& go build -ldflags "-X main.Version=dev" -o /bin/logspout \ | ||
&& exec /bin/logspout | ||
RUN apk --no-cache add go build-base git mercurial ca-certificates curl | ||
COPY . /src | ||
WORKDIR /src | ||
CMD go build -ldflags "-X main.Version=dev" -o /bin/logspout \ | ||
&& exec /bin/logspout |
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
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
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,14 +1,10 @@ | ||
#!/bin/sh | ||
set -e | ||
apk add --update go build-base git mercurial ca-certificates | ||
mkdir -p /go/src/github.com/gliderlabs | ||
cp -r /src /go/src/github.com/gliderlabs/logspout | ||
cd /go/src/github.com/gliderlabs/logspout | ||
export GOPATH=/go | ||
go get github.com/Masterminds/glide && $GOPATH/bin/glide install | ||
cd /src | ||
go build -ldflags "-X main.Version=$1" -o /bin/logspout | ||
apk del go git mercurial build-base | ||
rm -rf /go /var/cache/apk/* /root/.glide | ||
rm -rf /root/go /var/cache/apk/* | ||
|
||
# backwards compatibility | ||
ln -fs /tmp/docker.sock /var/run/docker.sock |
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,11 @@ | ||
package cfg | ||
|
||
import "os" | ||
|
||
// GetEnvDefault is a helper function to retrieve an env variable value OR return a default value | ||
func GetEnvDefault(name, dfault string) string { | ||
if val := os.Getenv(name); val != "" { | ||
return val | ||
} | ||
return dfault | ||
} |
Oops, something went wrong.