Skip to content

Feat: build freebsd bin #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 11, 2018

Conversation

sarcasticadmin
Copy link
Contributor

Description

Enable helm-diff on freebsd

Previous Behavior

  • No freebsd binary for releases
  • Could not install plugin using helm plugin install https://github.com/databus23/helm-diff --version master

New Behavior

  • Build freebsd binary for releases
  • Should be able to use helm plugin install https://github.com/databus23/helm-diff --version master (will have to test once release of new version actually happens)

It currently works fine if built locally:

$ gmake build
mkdir -p bin/
go build -i -v -o bin/diff -ldflags="-X github.com/databus23/helm-diff/cmd.Version=2.10.0+2 -X github.com/databus23/helm-diff/vendor/k8s.io/helm/pkg/version.BuildMetadata= -X github.com/databus23/helm-diff/vendor/k8s.io/helm/pkg/version.Version="
$ bin/diff version
2.10.0+2
$ gmake dist
...
GOOS=freebsd GOARCH=amd64 go build -o build/diff/bin/diff -ldflags="-X github.com/databus23/helm-diff/cmd.Version=2.10.0+2 -X github.com/databus23/helm-diff/vendor/k8s.io/helm/pkg/version.BuildMetadata= -X github.com/databus23/helm-diff/vendor/k8s.io/helm/pkg/version.Version="
tar -C build/ -zcvf /usr/home/rherna/.helm/cache/plugins/https-i.8713187.xyz-databus23-helm-diff/release/helm-diff-freebsd.tgz diff/
a diff
a diff/LICENSE
a diff/README.md
a diff/plugin.yaml
a diff/bin
a diff/bin/diff
...
$ cd release/
$ tar zxvf helm-diff-freebsd.tgz
x diff/
x diff/LICENSE
x diff/README.md
x diff/plugin.yaml                                                                                                                                                                                                                     
x diff/bin/
 diff/bin/diff
$ diff/bin/diff version
2.10.0+2 

Config

$ uname -srm
FreeBSD 11.2-RELEASE-p1 amd64
$ glide --version
glide version 0.13.0-dev
$ helm version
Client: &version.Version{SemVer:"v2.11.0+unreleased", GitCommit:"", GitTreeState:""}
Server: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}

Shebang shouldnt hardcode path to /bin/bash since some *nix flavors
dont ship with bash or install it in a different path.

install-binary.sh which is used by the helm plugin system was updated
for a freebsd binary support. This should be functional when the
first release for helm-diff is released for freebsd.
@databus23 databus23 merged commit efad233 into databus23:master Oct 11, 2018
@databus23
Copy link
Owner

Thanks!

@databus23
Copy link
Owner

I released
https://github.com/databus23/helm-diff/releases/tag/v2.11.0%2B2 which includes a freebsd binary.

@sarcasticadmin
Copy link
Contributor Author

@databus23 you're welcome!

I've validated that helm plugin install https://github.com/databus23/helm-diff --version master does work on freebsd with 2.11.0+2 being released:

$ helm plugin install https://github.com/databus23/helm-diff --version master
Downloading https://github.com/databus23/helm-diff/releases/download/v2.11.0+2/helm-diff-freebsd.tgz     
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   611    0   611    0     0   1562      0 --:--:-- --:--:-- --:--:--  1562
100 6948k  100 6948k    0     0   690k      0  0:00:10  0:00:10 --:--:-- 1187k
Preparing to install into /home/rherna/.helm/plugins/helm-diff
helm-diff installed into /home/rherna/.helm/plugins/helm-diff/helm-diff
...
Installed plugin: diff
$ helm diff version
2.11.0+2

Thanks for the quick responses!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants