Skip to content
Snippets Groups Projects
Commit e9b798eb8ea5 authored by nhi.tran's avatar nhi.tran
Browse files

Multi platform build

parent f49194956353
No related branches found
No related tags found
1 merge request!1Multi platform build
Pipeline #38787 passed
......@@ -24,6 +24,8 @@
# CI_COMMIT_TAG=myTag task build
# this will use the provided version for build linking
BUILD_VERSION: "{{.CI_COMMIT_TAG}}/{{.BUILD_COMMIT_ID}}"
GOOS:
sh: uname | tr '[:upper:]' '[:lower:]'
tasks:
default:
......@@ -35,7 +37,7 @@
cmds:
- mkdir -p build
- |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
CGO_ENABLED=0 GOOS={{.GOOS}} GOARCH=amd64 go build \
-a -tags netgo \
-ldflags "-X 'orus.io/orus-io/beaver/lib.version=${CI_COMMIT_TAG}' -X 'orus.io/orus-io/beaver/lib.commitSha=$(hg id -i --debug)' -X 'orus.io/orus-io/beaver/lib.buildDate=$(date)' -w -extldflags "-static"" \
-o {{.OUTPUT}} \
......@@ -43,6 +45,13 @@
generates:
- "{{.OUTPUT}}"
install:
desc: install binary in $GOPATH/bin
deps:
- build
cmds:
- install -m 755 {{.OUTPUT}} $GOPATH/bin
fetch-golangci-lint:
desc: fetch golangci-lint tool
cmds:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment