ci: correct way to build go binary

parent fd0f3562
......@@ -32,18 +32,6 @@ pre_build:checker:
- docker push $CI_REGISTRY_IMAGE/checks:ci-${CI_PIPELINE_ID}
- docker push $CI_REGISTRY_IMAGE/checks:latest
pre_build:tar-split:
stage: pre_build
tags:
- docker
script:
- echo http://dl-cdn.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
- apk update
- apk add go=1.11.5-r0
- apk add musl-dev
- go get -d github.com/vbatts/tar-split/cmd/tar-split
- go build -o $HOME/tar-split -a -ldflags '-extldflags "-static"' $HOME/go/src/github.com/vbatts/tar-split/cmd/tar-split
package:docs:
stage: prepare
tags:
......@@ -106,6 +94,10 @@ publish:oci-image-layout:
tags:
- docker
script:
- echo http://dl-cdn.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
- apk update
- apk add go=1.11.5-r0
- apk add musl-dev
- go get github.com/coolljt0725/docker2oci
- docker save $CI_REGISTRY_IMAGE:ci-${CI_PIPELINE_ID} | $HOME/go/bin/docker2oci image-layout-${CI_COMMIT_TAG}
# upload image_layer to minio
......@@ -189,7 +181,13 @@ start_test_services:
# allow beiran to start up (might not be enough)
- sleep 5
# copy tar-split
# build and copy tar-split
- echo http://dl-cdn.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
- apk update
- apk add go=1.11.5-r0
- apk add musl-dev
- go get -d github.com/vbatts/tar-split/cmd/tar-split
- go build -o $HOME/tar-split -a -ldflags '-extldflags "-static"' $HOME/go/src/github.com/vbatts/tar-split/cmd/tar-split
- |
for node in beiran1 beiran2 beiran3 beiran4
do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment