This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
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.
Update go to 1.12 and refactor cmd tool code.
- Loading branch information
Showing
4 changed files
with
27 additions
and
21 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 |
---|---|---|
|
@@ -19,7 +19,6 @@ _cgo_export.* | |
|
||
_testmain.go | ||
|
||
workreportmgr | ||
*.exe | ||
*.test | ||
|
||
|
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 |
---|---|---|
|
@@ -19,6 +19,5 @@ _cgo_export.* | |
|
||
_testmain.go | ||
|
||
workreportmgr | ||
*.exe | ||
*.test |
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,27 +1,35 @@ | ||
FROM golang:1.8-alpine | ||
FROM golang:1.12-alpine | ||
|
||
ARG GO_ROOT_IMPORT_PATH=github.com/icedream/workreport-manager | ||
|
||
COPY . "/go/src/${GO_ROOT_IMPORT_PATH}" | ||
RUN \ | ||
apk add --no-cache --virtual .build-deps \ | ||
git \ | ||
libc-dev \ | ||
&&\ | ||
git config --global http.followRedirects true &&\ | ||
mkdir -p /go &&\ | ||
export GOPATH=/go &&\ | ||
export PATH="${PATH}:${GOPATH}/bin" &&\ | ||
libc-dev | ||
|
||
# Git configuration | ||
RUN git config --global http.followRedirects true | ||
|
||
# Install tools which will be used by go generate | ||
RUN \ | ||
go get -v \ | ||
github.com/jteeuwen/go-bindata/... \ | ||
golang.org/x/tools/cmd/goimports &&\ | ||
export CGO_ENABLED=0 &&\ | ||
go get -v -d "${GO_ROOT_IMPORT_PATH}/..." &&\ | ||
(cd "${GOPATH}/src/${GO_ROOT_IMPORT_PATH}" &&\ | ||
go generate -v ./...) &&\ | ||
go build -v -a -installsuffix cgo \ | ||
-o /usr/local/bin/workreportmgr "${GO_ROOT_IMPORT_PATH}" &&\ | ||
apk del .build-deps &&\ | ||
rm -rf "${GOPATH}" | ||
golang.org/x/tools/cmd/goimports | ||
|
||
# Copy app source, fetch dependencies and build all binaries | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
RUN go generate -v ./... | ||
RUN \ | ||
CGO_ENABLED=0 \ | ||
GOBIN="/usr/local/bin" \ | ||
go install -v -a -installsuffix cgo ./cmd/... | ||
|
||
RUN ls -lAh /usr/local/bin | ||
|
||
### | ||
|
||
FROM alpine | ||
|
||
# Copy built binaries into this image | ||
COPY --from=0 /usr/local/bin/ /usr/local/bin/ | ||
|
||
ENTRYPOINT ["workreportmgr"] |
File renamed without changes.