I have the following .gitlab-ci.yml...
stages:
- test
- build
- art
image: golang:1.9.2
variables:
BIN_NAME: example
ARTIFACTS_DIR: artifacts
GO_PROJECT: example
GOPATH: /go
before_script:
- mkdir -p ${GOPATH}/src/${GO_PROJECT}
- mkdir -p ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}
- go get -u github.com/golang/dep/cmd/dep
- cp -r ${CI_PROJECT_DIR}/* ${GOPATH}/src/${GO_PROJECT}/
- cd ${GOPATH}/src/${GO_PROJECT}
test:
stage: test
script:
# Run all tests
go test -run ''
build:
stage: build
script:
# Compile and name the binary as `hello`
- go build -o hello
- pwd
- ls -l hello
# Execute the binary
- ./hello
# Move to gitlab build directory
- mv ./hello ${CI_PROJECT_DIR}
artifacts:
paths:
- ./hello
This works great for linux but i now need to do the same so that it builds a windows executable.
I then plan to run a scheduled script to download the artifacts.
The other option is I run a virtual linux server on the windows server and use that to run my go binarys. I know i need to change the image to windows but can't see to find an appropriate one online (one that is configured for golang).
Or is it possible to have this docker image build a windows exe?