Skip to content

Commit

Permalink
add vault-env to goreleaser as well
Browse files Browse the repository at this point in the history
  • Loading branch information
bonifaido committed Oct 15, 2021
1 parent 7473271 commit be16c80
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 22 deletions.
55 changes: 43 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,57 @@
# Requirements:
# - Docker
# - go install github.com/crazy-max/xgo@latest
builds:
-
main: ./cmd/bank-vaults
# Building of Bank-Vaults is a bit hacky since the pkcs11 package can't be built with simple Go Crosscompiling
# so we need to use xgo, but that is not directly supported in GoReleaser, so we do the actual compilation with
# xgo in post hooks for all targets.
- id: bank-vaults
main: ./cmd/template
binary: bank-vaults
env:
- CGO_ENABLED=0
ldflags: "-s -w -X main.version={{ .Version }} -X main.commitHash={{ .ShortCommit }} -X main.buildDate={{ .Date }}"
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
hooks:
post:
# TODO
# This would be better if it could be ./cmd/bank-vaults instead of github.com/banzaicloud/bank-vaults/cmd/bank-vaults
# Since this is pulling the source code directly from GitHub so what we would like to build has to be pushed there first
- xgo --targets={{ .Os }}/{{ .Arch }} --dest=dist github.com/banzaicloud/bank-vaults/cmd/bank-vaults
- bash -c "mv dist/bank-vaults-* dist/bank-vaults_{{ .Os }}_{{ .Arch }}/bank-vaults"

- id: vault-env
main: ./cmd/vault-env
binary: vault-env
env:
- CGO_ENABLED=0
ldflags: "-s -w -X main.version={{ .Version }} -X main.commitHash={{ .ShortCommit }} -X main.buildDate={{ .Date }}"
goos:
- linux
- darwin
goarch:
- amd64
- arm64
archives:
-
id: bin
name_template: "bank-vaults-{{ .Os }}-{{ .Arch }}"
format: binary
-
id: targz
name_template: "bank-vaults-{{ .Os }}-{{ .Arch }}"
- id: bank-vaults-targz
name_template: "{{ .Binary }}-{{ .Os }}-{{ .Arch }}"
builds:
- bank-vaults
format_overrides:
- goos: windows
format: zip
- id: vault-env
name_template: "{{ .Binary }}-{{ .Os }}-{{ .Arch }}"
builds:
- vault-env
format_overrides:
- goos: windows
format: zip

checksum:
name_template: "bank-vaults_checksums.txt"
Expand All @@ -29,12 +60,12 @@ changelog:
skip: false

brews:
-
tap:
- tap:
owner: banzaicloud
name: homebrew-tap
folder: Formula
homepage: https://banzaicloud.com/products/bank-vaults/
description: A Vault swiss-army knife CLI with Kubernetes support
test: |
system "#{bin}/bank-vaults"
system "#{bin}/vault-env"
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<a href="https://hub.docker.com/r/banzaicloud/bank-vaults/">
<img src="https://img.shields.io/docker/pulls/banzaicloud/bank-vaults.svg?style=shield" alt="Docker Pulls">
</a>

<a href="https://godoc.org/github.com/banzaicloud/bank-vaults">
<img src="https://godoc.org/github.com/banzaicloud/bank-vaults?status.svg" alt="GoDoc">
</a>
Expand Down Expand Up @@ -74,13 +74,6 @@ On macOS, you can directly Homebrew the CLI:
$ brew install banzaicloud/tap/bank-vaults
```

Alternatively, fetch the source and compile it using `go get`:

```shell
go get github.com/banzaicloud/bank-vaults/cmd/bank-vaults
go get github.com/banzaicloud/bank-vaults/cmd/vault-env
```

## Documentation

Read more about the usage of bank-vaults in the [detailed
Expand All @@ -100,9 +93,9 @@ If you encounter any problems that is not addressed in our documentation, [open
If you find this project useful, help us:

- Support the development of this project and star this repo! :star:
- If you use Bank-Vaults in a production environment, add yourself to the list of production [adopters](https://github.com/banzaicloud/bank-vaults/blob/master/ADOPTERS.md).:metal: <br>
- If you use Bank-Vaults in a production environment, add yourself to the list of production [adopters](https://github.com/banzaicloud/bank-vaults/blob/master/ADOPTERS.md).:metal: <br>
- Help new users with issues they may encounter :muscle:
- Send a pull request with your new features and bug fixes :rocket:
- Send a pull request with your new features and bug fixes :rocket:

### Commercial Support

Expand Down

0 comments on commit be16c80

Please sign in to comment.