From 924bfa367640cdac3c2a551217637d73e761b0fc Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Mon, 30 Sep 2019 13:00:43 -0700 Subject: [PATCH 1/2] build darwin and windows binaries without cgo also run 'make snapshot-release' within CI --- .buildkite/pipeline.yml | 13 +++++++++++++ deploy/.goreleaser.snapshot.yml | 22 ++++++++++++++++++---- deploy/.goreleaser.yml | 23 +++++++++++++++++++---- 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index fae3fd6be8..4db510d7ff 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -9,6 +9,19 @@ steps: mount-checkout: true workdir: /go/src/github.com/replicatedhq/kots + + - label: snapshot-release + commands: + - make snapshot-release + plugins: + - docker#v3.2.0: + always-pull: true + image: replicated/gitops-builder:buildkite-go12-node10 + workdir: /go/src/github.com/replicatedhq/kots + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + - "/var/lib/buildkite-agent/.docker/config.json:/home/builder/.docker/config.json" + - wait - label: release diff --git a/deploy/.goreleaser.snapshot.yml b/deploy/.goreleaser.snapshot.yml index 73545e6ab0..00f17dde6c 100644 --- a/deploy/.goreleaser.snapshot.yml +++ b/deploy/.goreleaser.snapshot.yml @@ -4,14 +4,11 @@ release: owner: replicatedhq name: kots builds: - - id: kots + - id: kots-linux goos: - linux - # - windows - # - darwin goarch: - amd64 - # - "386" env: - CGO_ENABLED=1 - GO111MODULE=on @@ -23,6 +20,23 @@ builds: flags: -tags netgo -tags containers_image_ostree_stub -tags exclude_graphdriver_devicemapper -tags exclude_graphdriver_btrfs -tags containers_image_openpgp -installsuffix netgo binary: kots hooks: {} + - id: kots + goos: + - windows + - darwin + goarch: + - amd64 + env: + - CGO_ENABLED=0 + - GO111MODULE=on + main: cmd/kots/main.go + ldflags: -s -w + -X github.com/replicatedhq/kots/pkg/version.version={{.Version}} + -X github.com/replicatedhq/kots/pkg/version.gitSHA={{.FullCommit}} + -X github.com/replicatedhq/kots/pkg/version.buildTime={{.Date}} + flags: -tags netgo -tags containers_image_ostree_stub -tags exclude_graphdriver_devicemapper -tags exclude_graphdriver_btrfs -tags containers_image_openpgp -installsuffix netgo + binary: kots + hooks: {} - id: so goos: - linux diff --git a/deploy/.goreleaser.yml b/deploy/.goreleaser.yml index bd6dfa7fcf..408620c05a 100644 --- a/deploy/.goreleaser.yml +++ b/deploy/.goreleaser.yml @@ -4,14 +4,11 @@ release: owner: replicatedhq name: kots builds: - - id: kots + - id: kots-linux goos: - linux - # - windows - # - darwin goarch: - amd64 - # - "386" env: - CGO_ENABLED=1 - GO111MODULE=on @@ -23,6 +20,23 @@ builds: flags: -tags netgo -tags containers_image_ostree_stub -tags exclude_graphdriver_devicemapper -tags exclude_graphdriver_btrfs -tags containers_image_openpgp -installsuffix netgo binary: kots hooks: {} + - id: kots + goos: + - windows + - darwin + goarch: + - amd64 + env: + - CGO_ENABLED=0 + - GO111MODULE=on + main: cmd/kots/main.go + ldflags: -s -w + -X github.com/replicatedhq/kots/pkg/version.version={{.Version}} + -X github.com/replicatedhq/kots/pkg/version.gitSHA={{.FullCommit}} + -X github.com/replicatedhq/kots/pkg/version.buildTime={{.Date}} + flags: -tags netgo -tags containers_image_ostree_stub -tags exclude_graphdriver_devicemapper -tags exclude_graphdriver_btrfs -tags containers_image_openpgp -installsuffix netgo + binary: kots + hooks: {} - id: so goos: - linux @@ -44,6 +58,7 @@ archives: - id: kots builds: - kots + - kots-linux format: tar.gz format_overrides: - goos: windows From 714f432bcaa8c0e0f6eb117d076a19c172d46c49 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Tue, 1 Oct 2019 10:11:15 -0700 Subject: [PATCH 2/2] only build with buildkite in CI --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 4db510d7ff..f9c1c119fc 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,7 +1,7 @@ steps: - label: build commands: - - make kots ffi ci-test + - make ci-test plugins: - docker#v3.2.0: image: replicated/gitops-builder:buildkite-go12-node10