2019-10-02 22:19:02 +00:00
|
|
|
image: "golang:1-alpine"
|
2019-10-02 22:13:42 +00:00
|
|
|
|
2019-10-08 23:13:55 +00:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- publish
|
|
|
|
|
2019-10-02 22:50:30 +00:00
|
|
|
before_script:
|
|
|
|
# Disabling cgo to not install gcc
|
|
|
|
- export CGO_ENABLED=0
|
2019-10-02 22:58:01 +00:00
|
|
|
- export GOARCH=amd64
|
2019-10-02 22:50:30 +00:00
|
|
|
|
|
|
|
build_linux_amd64:
|
2019-10-08 23:13:55 +00:00
|
|
|
stage: build
|
2019-10-02 22:13:42 +00:00
|
|
|
script:
|
2019-10-02 22:58:01 +00:00
|
|
|
- export GOOS=linux
|
2019-10-08 23:13:55 +00:00
|
|
|
- go build -o ./magnetico-go-migrator-$GOOS "-ldflags=-s -w" .
|
|
|
|
- ./magnetico-go-migrator-$GOOS --help
|
2019-10-02 22:13:42 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-10-08 23:13:55 +00:00
|
|
|
- magnetico-go-migrator-*
|
2019-10-02 22:50:30 +00:00
|
|
|
|
|
|
|
build_windows_amd64:
|
2019-10-08 23:13:55 +00:00
|
|
|
stage: build
|
2019-10-02 22:50:30 +00:00
|
|
|
script:
|
2019-10-02 22:58:01 +00:00
|
|
|
- export GOOS=windows
|
2019-10-08 23:13:55 +00:00
|
|
|
- go build -o ./magnetico-go-migrator-$GOOS.exe "-ldflags=-s -w" .
|
2019-10-02 22:58:01 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-10-08 23:13:55 +00:00
|
|
|
- magnetico-go-migrator-*.exe
|
2019-10-02 22:50:30 +00:00
|
|
|
|
|
|
|
build_darwin_amd64:
|
2019-10-08 23:13:55 +00:00
|
|
|
stage: build
|
2019-10-02 22:50:30 +00:00
|
|
|
script:
|
2019-10-02 22:58:01 +00:00
|
|
|
- export GOOS=darwin
|
2019-10-08 23:13:55 +00:00
|
|
|
- go build -o ./magnetico-go-migrator-$GOOS "-ldflags=-s -w" .
|
2019-10-02 22:58:01 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-10-08 23:13:55 +00:00
|
|
|
- magnetico-go-migrator-*
|
|
|
|
|
|
|
|
#publish:
|
|
|
|
# image: inetprocess/gitlab-release
|
|
|
|
# stage: publish
|
|
|
|
# only:
|
|
|
|
# - tags
|
|
|
|
# script:
|
|
|
|
# - gitlab-release --message 'New release' magnetico-go-migrator-linux-$CI_BUILD_TAG magnetico-go-migrator-windows-$CI_BUILD_TAG.exe magnetico-go-migrator-darwin-$CI_BUILD_TAG
|