Skip to content
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

Add to package managers like homebrew #3

Open
nitrocode opened this issue May 14, 2019 · 12 comments
Open

Add to package managers like homebrew #3

nitrocode opened this issue May 14, 2019 · 12 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@nitrocode
Copy link
Contributor

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!

@flosell
Copy link
Owner

flosell commented May 15, 2019

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!

@flosell flosell added enhancement New feature or request help wanted Extra attention is needed labels May 15, 2019
@nitrocode
Copy link
Contributor Author

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 💀 😂

@flosell
Copy link
Owner

flosell commented May 16, 2019

Awesome, thanks! Let me know if you need any help!

@flosell
Copy link
Owner

flosell commented Jul 14, 2019

hey, @nitrocode any progress on this?

@pascal-hofmann
Copy link

Hey @nitrocode, any update on this?

@nitrocode
Copy link
Contributor Author

nitrocode commented Jan 10, 2020

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.

@flosell
Copy link
Owner

flosell commented Jan 12, 2020

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?

@nitrocode
Copy link
Contributor Author

Submitted the formula to homebrew. Hope it gets accepted. If not, we can always create our own tap.

Homebrew/homebrew-core#49921

@flosell
Copy link
Owner

flosell commented Feb 11, 2020

Thanks a lot for your work on this!

nitrocode added a commit to nitrocode/iam-policy-json-to-terraform that referenced this issue Feb 18, 2020
@flosell
Copy link
Owner

flosell commented Feb 20, 2020

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.

@nitrocode
Copy link
Contributor Author

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

@nitrocode
Copy link
Contributor Author

Btw here are some stats regarding homebrew formula downloads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants