Skip to content

Commit cb2ead1

Browse files
committed
Use go modules instead of dep
Adapt Makefile .travis.yml and use go 1.12
1 parent 94fb27d commit cb2ead1

8 files changed

+584
-337
lines changed

.travis.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
language: go
22
go:
3-
- "1.11"
3+
- "1.12"
44
go_import_path: github.com/camptocamp/terraboard
55
install:
6-
- go get -u github.com/golang/dep/cmd/dep
7-
- go get -u github.com/bradfitz/goimports
6+
- make vendor
7+
script:
8+
- make terraboard
9+
- make test
810
- go get -u github.com/mattn/goveralls
911
- go get -u golang.org/x/tools/cmd/cover
10-
- dep ensure
11-
script:
12-
- make
1312
- make coverage
1413
- "$HOME/gopath/bin/goveralls -service=travis-ci -coverprofile=coverage.out"

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM golang:1.11 as builder
22
WORKDIR /go/src/github.com/camptocamp/terraboard
33
COPY . .
4-
RUN go get -u github.com/golang/dep/cmd/dep && dep ensure
4+
ENV GO111MODULE=on
55
RUN make terraboard
66

77
FROM scratch

Dockerfile.dev

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM golang:1.11
22
WORKDIR /go/src/github.com/camptocamp/terraboard
33
COPY . .
4-
RUN go get -u github.com/golang/dep/cmd/dep && dep ensure
4+
ENV GO111MODULE=on
55
RUN go install .
66
ENTRYPOINT ["terraboard"]
77
CMD [""]

Gopkg.lock

-303
This file was deleted.

Gopkg.toml

-23
This file was deleted.

Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ VERSION = $(shell git describe --always)
44
all: test terraboard
55

66
terraboard: main.go $(DEPS)
7-
CGO_ENABLED=1 GOOS=linux go build \
7+
GO111MODULE=on CGO_ENABLED=1 GOOS=linux go build \
88
-ldflags "-linkmode external -extldflags -static -X main.version=$(VERSION)" \
99
-o $@ $<
1010
strip $@
@@ -21,11 +21,13 @@ vet: main.go
2121
go vet $<
2222

2323
imports: main.go
24-
dep ensure
2524
goimports -d $<
2625

2726
test: lint vet imports
28-
go test -v ./...
27+
GO111MODULE=on go test -v ./...
28+
29+
vendor:
30+
GO111MODULE=on go mod vendor
2931

3032
coverage:
3133
rm -rf *.out

0 commit comments

Comments
 (0)