File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 2
2
FAQ.md
3
3
README.md
4
4
LICENSE
5
- Makefile
6
5
.gitignore
7
6
.travis.yml
8
7
CONTRIBUTING.md
Original file line number Diff line number Diff line change 1
1
FROM golang:1.14-alpine3.12 AS builder
2
2
ARG VERSION
3
3
4
- RUN apk add --no-cache git gcc musl-dev
4
+ RUN apk add --no-cache git gcc musl-dev make
5
5
6
6
WORKDIR /go/src/github.com/golang-migrate/migrate
7
7
8
8
ENV GO111MODULE=on
9
- ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse mongodb sqlserver firebird sqlite3 neo4j"
10
- ENV SOURCES="file go_bindata github github_ee aws_s3 google_cloud_storage godoc_vfs gitlab"
11
9
12
10
COPY go.mod go.sum ./
13
11
14
12
RUN go mod download
15
13
16
14
COPY . ./
17
15
18
- RUN go build -a -o build/migrate.linux-386 -ldflags= "-s -w -X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cmd/migrate
16
+ RUN make build-docker
19
17
20
18
FROM alpine:3.12
21
19
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ COVERAGE_DIR ?= .coverage
9
9
build :
10
10
CGO_ENABLED=0 go build -ldflags=' -X main.Version=$(VERSION)' -tags ' $(DATABASE) $(SOURCE)' ./cmd/migrate
11
11
12
+ build-docker :
13
+ CGO_ENABLED=0 go build -a -o build/migrate.linux-386 -ldflags=" -s -w -X main.Version=${VERSION} " -tags " $( DATABASE) $( SOURCE) " ./cmd/migrate
14
+
12
15
build-cli : clean
13
16
-mkdir ./cli/build
14
17
cd ./cmd/migrate && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o ../../cli/build/migrate.linux-amd64 -ldflags=' -X main.Version=$(VERSION) -extldflags "-static"' -tags ' $(DATABASE) $(SOURCE)' .
@@ -102,10 +105,10 @@ define external_deps
102
105
endef
103
106
104
107
105
- .PHONY : build build-cli clean test-short test test-with-flags html-coverage \
108
+ .PHONY : build build-docker build- cli clean test-short test test-with-flags html-coverage \
106
109
restore-import-paths rewrite-import-paths list-external-deps release \
107
110
docs kill-docs open-docs kill-orphaned-docker-containers
108
111
109
- SHELL = /bin/bash
112
+ SHELL = /bin/sh
110
113
RAND = $(shell echo $$RANDOM)
111
114
You can’t perform that action at this time.
0 commit comments