File tree 8 files changed +47
-117
lines changed
8 files changed +47
-117
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
2
.env
3
+ /dbmate
3
4
/dist
4
5
/testdata /db /schema.sql
5
6
/vendor
Original file line number Diff line number Diff line change 1
1
# build image
2
- FROM golang:1.10 as build
2
+ FROM golang:1.11 as build
3
3
4
4
# required to force cgo (for sqlite driver) with cross compile
5
5
ENV CGO_ENABLED 1
@@ -13,21 +13,17 @@ RUN apt-get update \
13
13
&& rm -rf /var/lib/apt/lists/*
14
14
15
15
# development dependencies
16
- RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 \
17
- && chmod +x /usr/local/bin/dep
18
- RUN go get gopkg.in/alecthomas/gometalinter.v2 \
19
- && gometalinter.v2 --install
16
+ RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
17
+ | sh -s v1.12.3
20
18
21
19
# copy source files
22
- COPY . /go/ src/github.com/amacneil/dbmate
23
- WORKDIR /go/ src/github.com/amacneil/dbmate
20
+ COPY . /src
21
+ WORKDIR /src
24
22
25
23
# build
26
- RUN make dep install build
24
+ RUN make build
27
25
28
26
# runtime image
29
- FROM debian:stretch-slim
30
- COPY --from=build /go/src/github.com/amacneil/dbmate/dist/dbmate-linux-amd64 \
31
- /usr/local/bin/dbmate
32
- WORKDIR /app
33
- ENTRYPOINT ["/usr/local/bin/dbmate" ]
27
+ FROM gcr.io/distroless/base
28
+ COPY --from=build /src/dist/dbmate-linux-amd64 /dbmate
29
+ ENTRYPOINT ["/dbmate" ]
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
DC := docker-compose
2
2
BUILD_FLAGS := -ldflags '-s'
3
- PACKAGES := . ./pkg/...
4
3
5
4
.PHONY : all
6
- all : dep install test lint build
7
-
8
- .PHONY : dep
9
- dep :
10
- dep ensure -vendor-only
11
-
12
- .PHONY : install
13
- install :
14
- go install -v $(PACKAGES )
5
+ all : test lint build
15
6
16
7
.PHONY : test
17
8
test :
18
- go test -v $( PACKAGES )
9
+ go test -v ./...
19
10
20
11
.PHONY : lint
21
12
lint :
22
- gometalinter.v2 $( PACKAGES )
13
+ golangci-lint run
23
14
24
15
.PHONY : wait
25
16
wait :
26
- dbmate -e MYSQL_URL wait
27
- dbmate -e POSTGRESQL_URL wait
17
+ dist/ dbmate-linux-amd64 -e MYSQL_URL wait
18
+ dist/ dbmate-linux-amd64 -e POSTGRESQL_URL wait
28
19
29
20
.PHONY : clean
30
21
clean :
Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ version: '2.3'
4
4
services :
5
5
dbmate :
6
6
volumes :
7
- - .:/go/ src/github.com/amacneil/dbmate
7
+ - .:/src
Original file line number Diff line number Diff line change
1
+ module github.com/amacneil/dbmate
2
+
3
+ require (
4
+ github.com/davecgh/go-spew v1.1.0 // indirect
5
+ github.com/go-sql-driver/mysql v0.0.0-20180113200744-2cc627ac8def
6
+ github.com/joho/godotenv v1.2.0
7
+ github.com/lib/pq v0.0.0-20180123210206-19c8e9ad0095
8
+ github.com/mattn/go-sqlite3 v1.6.0
9
+ github.com/pmezard/go-difflib v1.0.0 // indirect
10
+ github.com/stretchr/testify v1.2.0
11
+ github.com/urfave/cli v1.20.0
12
+ google.golang.org/appengine v1.0.0 // indirect
13
+ )
Original file line number Diff line number Diff line change
1
+ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 =
2
+ github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
3
+ github.com/go-sql-driver/mysql v0.0.0-20180113200744-2cc627ac8def h1:S5Q9hDt/aa5nJp7+qwsNSKi9KIlEoSBaNdjyKS44OAQ =
4
+ github.com/go-sql-driver/mysql v0.0.0-20180113200744-2cc627ac8def /go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w =
5
+ github.com/joho/godotenv v1.2.0 h1:vGTvz69FzUFp+X4/bAkb0j5BoLC+9bpqTWY8mjhA9pc =
6
+ github.com/joho/godotenv v1.2.0 /go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg =
7
+ github.com/lib/pq v0.0.0-20180123210206-19c8e9ad0095 h1:Do4XI4HSm+8jdo6z1Zk0CQDgqoAMwWew3ksTcDDSWiA =
8
+ github.com/lib/pq v0.0.0-20180123210206-19c8e9ad0095 /go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo =
9
+ github.com/mattn/go-sqlite3 v1.6.0 h1:TDwTWbeII+88Qy55nWlof0DclgAtI4LqGujkYMzmQII =
10
+ github.com/mattn/go-sqlite3 v1.6.0 /go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc =
11
+ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
12
+ github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
13
+ github.com/stretchr/testify v1.2.0 h1:LThGCOvhuJic9Gyd1VBCkhyUXmO8vKaBFvBsJ2k03rg =
14
+ github.com/stretchr/testify v1.2.0 /go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs =
15
+ github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw =
16
+ github.com/urfave/cli v1.20.0 /go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA =
17
+ google.golang.org/appengine v1.0.0 h1:dN4LljjBKVChsv0XCSI+zbyzdqrkEwX5LQFUMRSGqOc =
18
+ google.golang.org/appengine v1.0.0 /go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM =
You can’t perform that action at this time.
0 commit comments