Skip to content

Commit

Permalink
Merge pull request #2025 from replicatedhq/divolgin/embed-experiment
Browse files Browse the repository at this point in the history
Build experimental binary
  • Loading branch information
marccampbell committed Aug 3, 2021
2 parents f87a4c9 + 2669b38 commit 92e42cd
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
go-version: '^1.16.3'

- run: sudo apt-get update
- run: sudo apt-get -qq -y install gnupg2 libdevmapper-dev libgpgme-dev libc6-dev-i386 btrfs-progs
- run: sudo apt-get -qq -y install gnupg2 libdevmapper-dev libgpgme-dev libc6-dev-i386 btrfs-progs pkg-config libgpgme-dev
- name: set previous release tag for goreleaser
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export GO111MODULE=on
export GOPROXY=https://proxy.golang.org
export CGO_ENABLED=1
export CGO_ENABLED=0

SHELL := /bin/bash -o pipefail
VERSION_PACKAGE = github.com/replicatedhq/kots/pkg/buildversion
Expand Down
9 changes: 9 additions & 0 deletions cmd/kots/cli/experimental-off.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// +build !kots_experimental

package cli

import "github.com/spf13/cobra"

func addExperimentalCmds(cmd *cobra.Command) {
// no-op
}
9 changes: 9 additions & 0 deletions cmd/kots/cli/experimental-on.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// +build kots_experimental

package cli

import "github.com/spf13/cobra"

func addExperimentalCmds(cmd *cobra.Command) {
cmd.AddCommand(RunCmd())
}
3 changes: 2 additions & 1 deletion cmd/kots/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func RootCmd() *cobra.Command {
cmd.AddCommand(AppStatusCmd())
cmd.AddCommand(GetCmd())
cmd.AddCommand(SetCmd())
cmd.AddCommand(RunCmd())

addExperimentalCmds(cmd)

viper.BindPFlags(cmd.Flags())

Expand Down
2 changes: 2 additions & 0 deletions cmd/kots/cli/run.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build kots_experimental

package cli

import (
Expand Down
34 changes: 33 additions & 1 deletion deploy/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ builds:
goarch:
- amd64
env:
- CGO_ENABLED=1
- CGO_ENABLED=0
- GO111MODULE=on
main: cmd/kots/main.go
ldflags: -s -w
Expand All @@ -23,6 +23,23 @@ builds:
binary: kots
hooks: {}

- id: kots_experimental
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=1
- GO111MODULE=on
main: cmd/kots/main.go
ldflags: -s -w
-X github.com/replicatedhq/kots/pkg/buildversion.version={{.Version}}
-X github.com/replicatedhq/kots/pkg/buildversion.gitSHA={{.FullCommit}}
-X github.com/replicatedhq/kots/pkg/buildversion.buildTime={{.Date}}
flags: -tags netgo -tags containers_image_ostree_stub -tags exclude_graphdriver_devicemapper -tags exclude_graphdriver_btrfs -tags containers_image_openpgp -tags kots_experimental -installsuffix netgo
binary: kots
hooks: {}

archives:
- id: kots
builds:
Expand All @@ -38,3 +55,18 @@ archives:
- README*
- changelog*
- CHANGELOG*

- id: kots_experimental
builds:
- kots_experimental
format: tar.gz
name_template: '{{ .Binary }}_{{ .Os }}_{{ .Arch }}_experimental'
files:
- licence*
- LICENCE*
- license*
- LICENSE*
- readme*
- README*
- changelog*
- CHANGELOG*

0 comments on commit 92e42cd

Please sign in to comment.