build binaries

This commit is contained in:
Robert Kaussow 2020-09-20 23:17:17 +02:00
parent 17db659310
commit 1fa6b07b14
Signed by: xoxys
GPG Key ID: 65362AE74AF98B61
2 changed files with 5 additions and 37 deletions

View File

@ -9,7 +9,6 @@ local PipelineTest = {
{ {
name: 'staticcheck', name: 'staticcheck',
image: 'golang:1.14', image: 'golang:1.14',
pull: 'always',
commands: [ commands: [
'go run honnef.co/go/tools/cmd/staticcheck ./...', 'go run honnef.co/go/tools/cmd/staticcheck ./...',
], ],
@ -23,7 +22,6 @@ local PipelineTest = {
{ {
name: 'lint', name: 'lint',
image: 'golang:1.14', image: 'golang:1.14',
pull: 'always',
commands: [ commands: [
'go run golang.org/x/lint/golint -set_exit_status ./...', 'go run golang.org/x/lint/golint -set_exit_status ./...',
], ],
@ -37,7 +35,6 @@ local PipelineTest = {
{ {
name: 'vet', name: 'vet',
image: 'golang:1.14', image: 'golang:1.14',
pull: 'always',
commands: [ commands: [
'go vet ./...', 'go vet ./...',
], ],
@ -51,7 +48,6 @@ local PipelineTest = {
{ {
name: 'test', name: 'test',
image: 'golang:1.14', image: 'golang:1.14',
pull: 'always',
commands: [ commands: [
'go test -cover ./...', 'go test -cover ./...',
], ],
@ -86,13 +82,11 @@ local PipelineBuildBinaries = {
{ {
name: 'build', name: 'build',
image: 'techknowlogick/xgo:go-1.14.x', image: 'techknowlogick/xgo:go-1.14.x',
pull: 'always',
commands: [ commands: [
'[ -z "${DRONE_TAG}" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}', '[ -z "${DRONE_TAG}" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}',
'mkdir -p release/', 'mkdir -p release/',
"cd cmd/drone-github-comment && xgo -ldflags \"-s -w -X main.Version=$BUILD_VERSION\" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' .", "cd cmd/drone-github-comment && xgo -ldflags \"-s -w -X main.Version=$BUILD_VERSION\" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out drone-github-comment .",
'ls -la /drone/src', 'ls -la /build/',
'ls -la /build*',
'mv /build/* /drone/src/release/', 'mv /build/* /drone/src/release/',
], ],
}, },
@ -139,7 +133,6 @@ local PipelineBuildContainer(arch='amd64') = {
{ {
name: 'build', name: 'build',
image: 'golang:1.14', image: 'golang:1.14',
pull: 'always',
commands: [ commands: [
'go build -v -ldflags "-X main.version=${DRONE_TAG:-latest}" -a -tags netgo -o release/' + arch + '/drone-github-comment ./cmd/drone-github-comment', 'go build -v -ldflags "-X main.version=${DRONE_TAG:-latest}" -a -tags netgo -o release/' + arch + '/drone-github-comment ./cmd/drone-github-comment',
], ],
@ -147,7 +140,6 @@ local PipelineBuildContainer(arch='amd64') = {
{ {
name: 'dryrun', name: 'dryrun',
image: 'plugins/docker:18-linux-' + arch, image: 'plugins/docker:18-linux-' + arch,
pull: 'always',
settings: { settings: {
dry_run: true, dry_run: true,
dockerfile: 'docker/Dockerfile.' + arch, dockerfile: 'docker/Dockerfile.' + arch,
@ -163,7 +155,6 @@ local PipelineBuildContainer(arch='amd64') = {
{ {
name: 'publish-dockerhub', name: 'publish-dockerhub',
image: 'plugins/docker:18-linux-' + arch, image: 'plugins/docker:18-linux-' + arch,
pull: 'always',
settings: { settings: {
auto_tag: true, auto_tag: true,
auto_tag_suffix: arch, auto_tag_suffix: arch,
@ -180,7 +171,6 @@ local PipelineBuildContainer(arch='amd64') = {
{ {
name: 'publish-quay', name: 'publish-quay',
image: 'plugins/docker:18-linux-' + arch, image: 'plugins/docker:18-linux-' + arch,
pull: 'always',
settings: { settings: {
auto_tag: true, auto_tag: true,
auto_tag_suffix: arch, auto_tag_suffix: arch,
@ -242,7 +232,6 @@ local PipelineNotifications = {
}, },
{ {
name: 'pushrm-dockerhub', name: 'pushrm-dockerhub',
pull: 'always',
image: 'chko/docker-pushrm:1', image: 'chko/docker-pushrm:1',
environment: { environment: {
DOCKER_PASS: { DOCKER_PASS: {
@ -261,7 +250,6 @@ local PipelineNotifications = {
}, },
{ {
name: 'pushrm-quay', name: 'pushrm-quay',
pull: 'always',
image: 'chko/docker-pushrm:1', image: 'chko/docker-pushrm:1',
environment: { environment: {
APIKEY__QUAY_IO: { APIKEY__QUAY_IO: {

View File

@ -8,7 +8,6 @@ platform:
steps: steps:
- name: staticcheck - name: staticcheck
pull: always
image: golang:1.14 image: golang:1.14
commands: commands:
- go run honnef.co/go/tools/cmd/staticcheck ./... - go run honnef.co/go/tools/cmd/staticcheck ./...
@ -17,7 +16,6 @@ steps:
path: /go path: /go
- name: lint - name: lint
pull: always
image: golang:1.14 image: golang:1.14
commands: commands:
- go run golang.org/x/lint/golint -set_exit_status ./... - go run golang.org/x/lint/golint -set_exit_status ./...
@ -26,7 +24,6 @@ steps:
path: /go path: /go
- name: vet - name: vet
pull: always
image: golang:1.14 image: golang:1.14
commands: commands:
- go vet ./... - go vet ./...
@ -35,7 +32,6 @@ steps:
path: /go path: /go
- name: test - name: test
pull: always
image: golang:1.14 image: golang:1.14
commands: commands:
- go test -cover ./... - go test -cover ./...
@ -63,14 +59,12 @@ platform:
steps: steps:
- name: build - name: build
pull: always
image: techknowlogick/xgo:go-1.14.x image: techknowlogick/xgo:go-1.14.x
commands: commands:
- "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}" - "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}"
- mkdir -p release/ - mkdir -p release/
- cd cmd/drone-github-comment && xgo -ldflags "-s -w -X main.Version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' . - cd cmd/drone-github-comment && xgo -ldflags "-s -w -X main.Version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out drone-github-comment .
- ls -la /drone/src - ls -la /build/
- ls -la /build*
- mv /build/* /drone/src/release/ - mv /build/* /drone/src/release/
- name: executable - name: executable
@ -109,13 +103,11 @@ platform:
steps: steps:
- name: build - name: build
pull: always
image: golang:1.14 image: golang:1.14
commands: commands:
- go build -v -ldflags "-X main.version=${DRONE_TAG:-latest}" -a -tags netgo -o release/amd64/drone-github-comment ./cmd/drone-github-comment - go build -v -ldflags "-X main.version=${DRONE_TAG:-latest}" -a -tags netgo -o release/amd64/drone-github-comment ./cmd/drone-github-comment
- name: dryrun - name: dryrun
pull: always
image: plugins/docker:18-linux-amd64 image: plugins/docker:18-linux-amd64
settings: settings:
dockerfile: docker/Dockerfile.amd64 dockerfile: docker/Dockerfile.amd64
@ -132,7 +124,6 @@ steps:
- build - build
- name: publish-dockerhub - name: publish-dockerhub
pull: always
image: plugins/docker:18-linux-amd64 image: plugins/docker:18-linux-amd64
settings: settings:
auto_tag: true auto_tag: true
@ -151,7 +142,6 @@ steps:
- dryrun - dryrun
- name: publish-quay - name: publish-quay
pull: always
image: plugins/docker:18-linux-amd64 image: plugins/docker:18-linux-amd64
settings: settings:
auto_tag: true auto_tag: true
@ -189,13 +179,11 @@ platform:
steps: steps:
- name: build - name: build
pull: always
image: golang:1.14 image: golang:1.14
commands: commands:
- go build -v -ldflags "-X main.version=${DRONE_TAG:-latest}" -a -tags netgo -o release/arm64/drone-github-comment ./cmd/drone-github-comment - go build -v -ldflags "-X main.version=${DRONE_TAG:-latest}" -a -tags netgo -o release/arm64/drone-github-comment ./cmd/drone-github-comment
- name: dryrun - name: dryrun
pull: always
image: plugins/docker:18-linux-arm64 image: plugins/docker:18-linux-arm64
settings: settings:
dockerfile: docker/Dockerfile.arm64 dockerfile: docker/Dockerfile.arm64
@ -212,7 +200,6 @@ steps:
- build - build
- name: publish-dockerhub - name: publish-dockerhub
pull: always
image: plugins/docker:18-linux-arm64 image: plugins/docker:18-linux-arm64
settings: settings:
auto_tag: true auto_tag: true
@ -231,7 +218,6 @@ steps:
- dryrun - dryrun
- name: publish-quay - name: publish-quay
pull: always
image: plugins/docker:18-linux-arm64 image: plugins/docker:18-linux-arm64
settings: settings:
auto_tag: true auto_tag: true
@ -269,13 +255,11 @@ platform:
steps: steps:
- name: build - name: build
pull: always
image: golang:1.14 image: golang:1.14
commands: commands:
- go build -v -ldflags "-X main.version=${DRONE_TAG:-latest}" -a -tags netgo -o release/arm/drone-github-comment ./cmd/drone-github-comment - go build -v -ldflags "-X main.version=${DRONE_TAG:-latest}" -a -tags netgo -o release/arm/drone-github-comment ./cmd/drone-github-comment
- name: dryrun - name: dryrun
pull: always
image: plugins/docker:18-linux-arm image: plugins/docker:18-linux-arm
settings: settings:
dockerfile: docker/Dockerfile.arm dockerfile: docker/Dockerfile.arm
@ -292,7 +276,6 @@ steps:
- build - build
- name: publish-dockerhub - name: publish-dockerhub
pull: always
image: plugins/docker:18-linux-arm image: plugins/docker:18-linux-arm
settings: settings:
auto_tag: true auto_tag: true
@ -311,7 +294,6 @@ steps:
- dryrun - dryrun
- name: publish-quay - name: publish-quay
pull: always
image: plugins/docker:18-linux-arm image: plugins/docker:18-linux-arm
settings: settings:
auto_tag: true auto_tag: true
@ -377,7 +359,6 @@ steps:
- success - success
- name: pushrm-dockerhub - name: pushrm-dockerhub
pull: always
image: chko/docker-pushrm:1 image: chko/docker-pushrm:1
environment: environment:
DOCKER_PASS: DOCKER_PASS:
@ -392,7 +373,6 @@ steps:
- success - success
- name: pushrm-quay - name: pushrm-quay
pull: always
image: chko/docker-pushrm:1 image: chko/docker-pushrm:1
environment: environment:
APIKEY__QUAY_IO: APIKEY__QUAY_IO:
@ -436,6 +416,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: eac62dee32972ee5ccf29b0f59700da46bbc1837499f212669a39541527e22a4 hmac: e39c311c9112476acd3c980340474969a5ea27720867d85bce0dc63f5307569d
... ...