close #186
parent
b7887ed162
commit
1234ee32e4
|
@ -7,7 +7,8 @@ RUN apk add --no-cache git
|
||||||
RUN go get ./...
|
RUN go get ./...
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/hacdias/filemanager/cmd/filemanager
|
WORKDIR /go/src/github.com/hacdias/filemanager/cmd/filemanager
|
||||||
RUN go install
|
RUN go build -ldflags "-X main.version=$(git tag -l --points-at HEAD)"
|
||||||
|
RUN mv filemanager /go/bin/filemanager
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
COPY --from=0 /go/bin/filemanager /usr/local/bin/filemanager
|
COPY --from=0 /go/bin/filemanager /usr/local/bin/filemanager
|
||||||
|
|
|
@ -87,10 +87,13 @@ func setupViper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func printVersion() {
|
func printVersion() {
|
||||||
|
version = strings.TrimSpace(version)
|
||||||
|
|
||||||
if version == "" {
|
if version == "" {
|
||||||
fmt.Println("filemanager is at an untracked version")
|
fmt.Println("filemanager is at an untracked version")
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("filemanager", version)
|
version = strings.TrimPrefix(version, "v")
|
||||||
|
fmt.Println("filemanager version", version)
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
|
Loading…
Reference in New Issue