iam-policy-json-to-terraform
iam-policy-json-to-terraform copied to clipboard
Add to package managers like homebrew
Would be nice to install this using a package managers
brew install iam-policy-json-to-terraform
choco install iam-policy-json-to-terraform
scoop install iam-policy-json-to-terraform
Thanks!
Agreed, this would be very helpful! Unfortunately, has a policy against self-submitting so I might need some help submitting this:
We frown on authors submitting their own work unless it is very popular.
As for choco and scoop, those are windows package managers, correct? I haven't touched windows systems in years so I'm probably not the right person to work on this, help would be much appreciated though!
Cool, I can help with this since I've submitted stuff to all 3. If I don't do it in a week, just comment this thread and make insulting comments and I'll eventually do it 💀 😂
Awesome, thanks! Let me know if you need any help!
hey, @nitrocode any progress on this?
Hey @nitrocode, any update on this?
Hi everyone. Looking at this today. To make the test for the homebrew formula, it would be ideal if this tool had a --version
or -v
switch that returned its version.
Edit: I'd like to emulate the terraform landscape tool test formula
Edi2:
Also, @flosell how do I compile this locally? I extracted the contents and I'm getting this issue
$ go build
iam-policy-json-to-terraform.go:7:2: cannot find package "github.com/flosell/iam-policy-json-to-terraform/converter" in any of:
/usr/local/Cellar/go/1.13.6/libexec/src/github.com/flosell/iam-policy-json-to-terraform/converter (from $GOROOT)
/Users/user/go/src/github.com/flosell/iam-policy-json-to-terraform/converter (from $GOPATH)
$ go install github.com/flosell/iam-policy-json-to-terraform/converter
can't load package: package github.com/flosell/iam-policy-json-to-terraform/converter: cannot find package "github.com/flosell/iam-policy-json-to-terraform/converter" in any of:
/usr/local/Cellar/go/1.13.6/libexec/src/github.com/flosell/iam-policy-json-to-terraform/converter (from $GOROOT)
/Users/user/go/src/github.com/flosell/iam-policy-json-to-terraform/converter (from $GOPATH)
Edit3:
This project may be too niche according to the Acceptable Criteria and so it might be best to maintain our own tap.
The following criteria should be done
- document how to build this tool
- add a
--version
or-v
that ties into the tag - add a homebrew tap
- document how to install on osx using the tap
Let me know what you think.
Hi @nitrocode, sorry for the late response and thanks for picking this up!
First things first, to your comments (tl;dr: 👍):
- document how to build this tool : I'll add some notes to the README (edit: done). For your specific issue, see below
- add a --version or -v that ties into the tag: Makes sense. Let me know if it's something you want to pick up or if you'll need help from me (or someone else who wants to pick it up)
- add a homebrew tap: I'm guessing what's niche will depend on homebrew maintainers :) But I agree, this project isn't super well-known so I'm fine starting with our own tap
- document how to install on osx using the tap 👍
Now to your question around building;
In short, the Makefile and Travis will give you some pointers and I just verified in a container that those should work with your golang version (1.13.6):
$ docker run -it -v $(pwd):/go/src/iam-policy-json-to-terraform golang:1.13.6-buster bash -c 'cd /go/src/iam-policy-json-to-terraform/ && (curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh) && make tools vendor test build'
ARCH = amd64
OS = linux
Will install into /go/bin
Fetching https://github.com/golang/dep/releases/latest..
Release Tag = v0.5.4
Fetching https://github.com/golang/dep/releases/tag/v0.5.4..
Fetching https://github.com/golang/dep/releases/download/v0.5.4/dep-linux-amd64..
Setting executable permissions.
Moving executable to /go/bin/dep
go get -u golang.org/x/lint/golint
dep ensure
go test -v ./...
? iam-policy-json-to-terraform [no test files]
=== RUN TestConvertFromJsonToTerraformHcl
--- PASS: TestConvertFromJsonToTerraformHcl (0.01s)
PASS
ok iam-policy-json-to-terraform/converter 0.021s
golint -set_exit_status ./converter
golint -set_exit_status .
go vet ./...
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o iam-policy-json-to-terraform_amd64 *.go
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o iam-policy-json-to-terraform_alpine *.go
GOOS=darwin go build -o iam-policy-json-to-terraform_darwin *.go
GOOS=windows GOARCH=amd64 go build -o iam-policy-json-to-terraform.exe *.go
As far as I remember, golang and dep expected your code to be in specific directories in the $GOPATH
so maybe the issue is that you cloned to a different directory?
Submitted the formula to homebrew. Hope it gets accepted. If not, we can always create our own tap.
https://github.com/Homebrew/homebrew-core/pull/49921
Thanks a lot for your work on this!
brew install iam-policy-json-to-terraform
now works, thanks to @nitrocode for the contribution! Leaving this issue open for anyone willing to contribute choco or scoop support.
No problem! This looks interesting too. Let's see if the brew formula will have an increase in the rate of stars attributed to this repo as of the update of the README.md
on 02/20/2020 (113 so far).
https://star-history.t9t.io/#flosell/iam-policy-json-to-terraform
Btw here are some stats regarding homebrew formula downloads