forked from golang-migrate/migrate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request golang-migrate#24 from Its-Alex/master
Dockerization
- Loading branch information
Showing
5 changed files
with
55 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Project | ||
FAQ.md | ||
README.md | ||
LICENSE | ||
Makefile | ||
.gitignore | ||
.travis.yml | ||
CONTRIBUTING.md | ||
MIGRATIONS.md | ||
docker-deploy.sh | ||
|
||
# Golang | ||
testing |
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,25 @@ | ||
FROM golang:1.10-alpine3.7 AS downloader | ||
|
||
RUN apk add --no-cache git gcc musl-dev | ||
|
||
WORKDIR /go/src/github.com/golang-migrate/migrate | ||
|
||
COPY *.go ./ | ||
COPY cli ./cli | ||
COPY database ./database | ||
COPY source ./source | ||
|
||
RUN go get -v ./... && \ | ||
go get -u github.com/fsouza/fake-gcs-server/fakestorage && \ | ||
go get -u github.com/kshvakov/clickhouse && \ | ||
GOOS=linux GOARCH=386 go build -a -o build/migrate.linux-386 -ldflags='-X main.Version=$(VERSION)' -tags '$(DATABASE) $(SOURCE)' ./cli | ||
|
||
FROM alpine:3.7 | ||
|
||
RUN apk add --no-cache ca-certificates | ||
|
||
COPY --from=downloader /go/src/github.com/golang-migrate/migrate/build/migrate.linux-386 /migrate | ||
RUN chmod u+x /migrate | ||
|
||
ENTRYPOINT ["/migrate"] | ||
CMD ["--help"] |
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,5 @@ | ||
#!/bin/bash | ||
|
||
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin && \ | ||
docker build . -t migrate/migrate:"$TRAVIS_TAG" && \ | ||
docker push migrate/migrate:"$TRAVIS_TAG" |