-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Chore) Upgrade golang version + docker build (#13)
Upgrade golang version + docker build - Remove accidental binary checkin - go mod tidy
- Loading branch information
1 parent
be6fe7e
commit eedb0e5
Showing
9 changed files
with
380 additions
and
232 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,18 +1,15 @@ | ||
version: 2 | ||
jobs: | ||
build-go1.9: | ||
build-go1.14: | ||
docker: | ||
- image: golang:1.9 | ||
- image: golang:1.14 | ||
working_directory: /go/src/github.com/micromdm/squirrel | ||
steps: &steps | ||
- checkout | ||
- run: make deps | ||
- run: make test | ||
- run: make | ||
|
||
workflows: | ||
version: 2 | ||
build: | ||
jobs: | ||
- build-go1.9 | ||
|
||
- build-go1.14 |
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,8 +1,22 @@ | ||
FROM alpine:3.4 | ||
FROM golang:latest as builder | ||
|
||
WORKDIR /go/src/github.com/micromdm/squirrel/ | ||
|
||
ENV CGO_ENABLED=0 \ | ||
GOARCH=amd64 \ | ||
GOOS=linux | ||
|
||
COPY . . | ||
|
||
RUN make deps | ||
RUN make | ||
|
||
|
||
FROM alpine:3.11.5 | ||
RUN apk --update add \ | ||
ca-certificates | ||
|
||
COPY ./build/squirrel-linux-amd64 /squirrel | ||
COPY --from=builder /go/src/github.com/micromdm/squirrel/build/linux/squirrel /usr/bin/ | ||
|
||
CMD ["/squirrel", "serve"] | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,14 @@ all: build | |
|
||
.PHONY: build | ||
|
||
ifndef ($(GOPATH)) | ||
GOPATH = $(HOME)/go | ||
ifeq ($(GOPATH),) | ||
PATH := $(HOME)/go/bin:$(PATH) | ||
else | ||
PATH := $(GOPATH)/bin:$(PATH) | ||
endif | ||
|
||
export GO111MODULE=on | ||
|
||
PATH := $(GOPATH)/bin:$(PATH) | ||
VERSION = $(shell git describe --tags --always --dirty) | ||
BRANCH = $(shell git rev-parse --abbrev-ref HEAD) | ||
|
@@ -27,34 +31,22 @@ else | |
endif | ||
|
||
BUILD_VERSION = "\ | ||
-X github.com/micromdm/squirrel/vendor/github.com/micromdm/go4/version.appName=${APP_NAME} \ | ||
-X github.com/micromdm/squirrel/vendor/github.com/micromdm/go4/version.version=${VERSION} \ | ||
-X github.com/micromdm/squirrel/vendor/github.com/micromdm/go4/version.branch=${BRANCH} \ | ||
-X github.com/micromdm/squirrel/vendor/github.com/micromdm/go4/version.buildUser=${USER} \ | ||
-X github.com/micromdm/squirrel/vendor/github.com/micromdm/go4/version.buildDate=${NOW} \ | ||
-X github.com/micromdm/squirrel/vendor/github.com/micromdm/go4/version.revision=${REVISION} \ | ||
-X github.com/micromdm/squirrel/vendor/github.com/micromdm/go4/version.goVersion=${GOVERSION}" | ||
|
||
WORKSPACE = ${GOPATH}/src/github.com/micromdm/squirrel | ||
check-deps: | ||
ifneq ($(shell test -e ${WORKSPACE}/Gopkg.lock && echo -n yes), yes) | ||
@echo "folder is clonded in the wrong place, copying to a Go Workspace" | ||
@echo "See: https://golang.org/doc/code.html#Workspaces" | ||
@git clone [email protected]:micromdm/squirrel ${WORKSPACE} | ||
@echo "cd to ${WORKSPACE} and run make deps again." | ||
@exit 1 | ||
endif | ||
ifneq ($(shell pwd), $(WORKSPACE)) | ||
@echo "cd to ${WORKSPACE} and run make deps again." | ||
@exit 1 | ||
endif | ||
-X github.com/micromdm/go4/version.appName=${APP_NAME} \ | ||
-X github.com/micromdm/go4/version.version=${VERSION} \ | ||
-X github.com/micromdm/go4/version.branch=${BRANCH} \ | ||
-X github.com/micromdm/go4/version.buildUser=${USER} \ | ||
-X github.com/micromdm/go4/version.buildDate=${NOW} \ | ||
-X github.com/micromdm/go4/version.revision=${REVISION} \ | ||
-X github.com/micromdm/go4/version.goVersion=${GOVERSION}" | ||
|
||
gomodcheck: | ||
@go help mod > /dev/null || (@echo micromdm requires Go version 1.11 or higher && exit 1) | ||
|
||
deps: check-deps | ||
go get -u github.com/golang/dep/... | ||
dep ensure -vendor-only | ||
deps: gomodcheck | ||
@go mod download | ||
|
||
test: | ||
go test -cover -race -v $(shell go list ./... | grep -v /vendor/) | ||
go test -cover -race ./... | ||
|
||
build: squirrel | ||
|
||
|
@@ -66,11 +58,9 @@ clean: | |
mkdir -p build/darwin | ||
mkdir -p build/linux | ||
|
||
INSTALL_STEPS := \ | ||
install-local: \ | ||
install-squirrel | ||
|
||
install-local: $(INSTALL_STEPS) | ||
|
||
.pre-squirrel: | ||
$(eval APP_NAME = squirrel) | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module github.com/micromdm/squirrel | ||
|
||
go 1.14 | ||
|
||
require ( | ||
cloud.google.com/go v0.55.0 // indirect | ||
cloud.google.com/go/storage v1.6.0 | ||
github.com/aws/aws-sdk-go v1.29.30 | ||
github.com/go-kit/kit v0.6.0 | ||
github.com/go-logfmt/logfmt v0.3.0 // indirect | ||
github.com/go-stack/stack v1.6.0 // indirect | ||
github.com/groob/finalizer v0.0.0-20170707115354-4c2ed49aabda | ||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 // indirect | ||
github.com/micromdm/go4 v0.0.0-20171021052028-032f15f8a872 | ||
github.com/pkg/errors v0.9.1 | ||
github.com/stretchr/testify v1.5.1 // indirect | ||
google.golang.org/api v0.20.0 | ||
) |
Oops, something went wrong.