forked from OpenCloud/opencloud
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
3.0 KiB
99 lines
3.0 KiB
version: '2' |
|
|
|
env: |
|
CGO_ENABLED: 1 |
|
GO111MODULE: on |
|
|
|
vars: |
|
VERSION: {sh: git describe --tags --always} |
|
GOARCH: "amd64" |
|
GOOS: "illumos" |
|
#Required by package tools to set install into the temporary root folder instead of / |
|
DESTDIR: "" |
|
#Prefix to install packages into |
|
PREFIX: "usr/local" |
|
BRAND_DIR: "usr/lib/brand" |
|
GCP: "/usr/gnu/bin/cp" |
|
|
|
tasks: |
|
imageadm: |
|
cmds: |
|
- "GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/imageadm -ldflags \"-X main.version={{.VERSION}}\" cmd/imageadm.go" |
|
|
|
buildhelper: |
|
cmds: |
|
- "CGO_ENABLED=0 GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/buildhelper_{{.GOOS}} -ldflags \"-X main.version={{.VERSION}}\" cmd/buildhelper.go" |
|
|
|
podadm: |
|
cmds: |
|
- "GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/podadm -ldflags \"-X main.version={{.VERSION}}\" cmd/podadm.go" |
|
|
|
podadmd: |
|
cmds: |
|
- "GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/podadmd -ldflags \"-X main.version={{.VERSION}}\" cmd/podadmd.go" |
|
|
|
build: |
|
desc: Build all the binaries |
|
cmds: |
|
- task: imageadm |
|
- task: buildhelper |
|
- task: buildhelper |
|
vars: {GOOS: "linux"} |
|
- task: podadm |
|
#- task: podadmd |
|
|
|
clean: |
|
desc: remove all the build artifacts to force recompile |
|
cmds: |
|
- "rm -rf artifacts" |
|
|
|
install: |
|
desc: install all binaries |
|
deps: [build] |
|
cmds: |
|
- "mkdir -p {{.DESTDIR}}/{{.PREFIX}}" |
|
- "mkdir -p {{.DESTDIR}}/{{.PREFIX}}/bin" |
|
- "{{.GCP}} -t {{.DESTDIR}}/{{.PREFIX}}/bin/ artifacts/imageadm artifacts/podadm" |
|
- "mkdir -p {{.DESTDIR}}/{{.BRAND_DIR}}/pod/helpers/{{.GOOS}}" |
|
- "mkdir -p {{.DESTDIR}}/{{.BRAND_DIR}}/pod/helpers/linux" |
|
- "{{.GCP}} -t {{.DESTDIR}}/{{.BRAND_DIR}}/pod supportfiles/brand/*" |
|
- "{{.GCP}} artifacts/buildhelper_{{.GOOS}} {{.DESTDIR}}/{{.BRAND_DIR}}/pod/helpers/{{.GOOS}}/buildhelper" |
|
- "{{.GCP}} artifacts/buildhelper_linux {{.DESTDIR}}/{{.BRAND_DIR}}/pod/helpers/linux/buildhelper" |
|
|
|
tools: |
|
desc: Install tools into ./bin |
|
cmds: |
|
- "go mod download" |
|
- "go build -o ./bin/go-junit-report github.com/jstemmer/go-junit-report" |
|
- "go build -o ./bin/gocover-cobertura github.com/t-yuki/gocover-cobertura" |
|
- "go build -o ./bin/stringer golang.org/x/tools/cmd/stringer" |
|
#- "go build -o ./bin/tea code.gitea.io/tea" |
|
|
|
test: |
|
desc: Run the Testsuite for Jenkins Compatible CI's |
|
deps: [tools] |
|
cmds: |
|
- "mkdir -p reports" |
|
- "go test $(go list) -v 2>&1 | ./bin/go-junit-report > reports/junit.xml" |
|
- "go test $(go list) -coverprofile=cover.out" |
|
- "./bin/gocover-cobertura < cover.out > reports/coverage.xml" |
|
|
|
publish: |
|
desc: Publish Artifacts to Gitea |
|
deps: [build] |
|
cmds: |
|
- "echo not implemented" |
|
|
|
generate: |
|
desc: Generate Go Code files |
|
deps: [tools] |
|
env: |
|
GO111MODULE: off |
|
cmds: |
|
- "go get -v -d ./net" |
|
- "PATH=\"$PATH:$(realpath ./bin)\" go generate ./net" |
|
|
|
default: |
|
cmds: |
|
- task: clean |
|
- task: build |