File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 22FAQ.md
33README.md
44LICENSE
5- Makefile
65.gitignore
76.travis.yml
87CONTRIBUTING.md
Original file line number Diff line number Diff line change 11FROM golang:1.14-alpine3.12 AS builder
22ARG VERSION
33
4- RUN apk add --no-cache git gcc musl-dev
4+ RUN apk add --no-cache git gcc musl-dev make
55
66WORKDIR /go/src/github.com/golang-migrate/migrate
77
88ENV 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"
119
1210COPY go.mod go.sum ./
1311
1412RUN go mod download
1513
1614COPY . ./
1715
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
1917
2018FROM alpine:3.12
2119
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ COVERAGE_DIR ?= .coverage
99build :
1010 CGO_ENABLED=0 go build -ldflags=' -X main.Version=$(VERSION)' -tags ' $(DATABASE) $(SOURCE)' ./cmd/migrate
1111
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+
1215build-cli : clean
1316 -mkdir ./cli/build
1417 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
102105endef
103106
104107
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 \
106109 restore-import-paths rewrite-import-paths list-external-deps release \
107110 docs kill-docs open-docs kill-orphaned-docker-containers
108111
109- SHELL = /bin/bash
112+ SHELL = /bin/sh
110113RAND = $(shell echo $$RANDOM)
111114
You can’t perform that action at this time.
0 commit comments