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

adding yq #47

Merged
merged 4 commits into from
Nov 25, 2020
Merged

adding yq #47

merged 4 commits into from
Nov 25, 2020

Conversation

deknos
Copy link
Contributor

@deknos deknos commented Nov 23, 2020

adding yq

@deknos
Copy link
Contributor Author

deknos commented Nov 23, 2020

adding terraform-inventory as well. i use this in some schools for ansible inventory preparation

@leucos
Copy link
Contributor

leucos commented Nov 23, 2020

Hey @deknos

The URL for yq should be https://github.com/mikefarah/yq/releases/download/{{ .Version }}/yq_{{ .OS }}_{{ .Arch }}

For terraform-inventory, the release URL should be https://api.github.com/repos/adammck/terraform-inventory/releases while the download URL should be https://github.com/adammck/terraform-inventory/releases/download/v{{ .VersionMajor }}.{{ .VersionMinor }}/terraform-inventory_{{ .VersionMajor }}.{{ .VersionMinor }}_{{ .OS }}_{{ .Arch }}.zip

The later is a bit tricky since it is not using SerVer. Thus we have to use individual version components in the URL template.

@deknos
Copy link
Contributor Author

deknos commented Nov 24, 2020

thanks for the headsup! i will adapt the files. and thanks for the versioning hint!

@deknos
Copy link
Contributor Author

deknos commented Nov 24, 2020

sadly i will only able to do that in the evening

@leucos
Copy link
Contributor

leucos commented Nov 24, 2020

sadly i will only able to do that in the evening

no problem, take it easy

@deknos
Copy link
Contributor Author

deknos commented Nov 25, 2020

i added it regarding your suggestions! :)

@leucos
Copy link
Contributor

leucos commented Nov 25, 2020

We're almost there. For terraform-inventory, the release URL should be https://api.github.com/repos/adammck/terraform-inventory/release (therepos part is missing)

You can test your changes easily:

  • copy your version of distributions.yaml to ~/.config/binenv/distributions.yaml
  • run binenv update terraform-inventory
  • if it works, try binenv install terraform-inventory

@deknos
Copy link
Contributor Author

deknos commented Nov 25, 2020

i tested it in a vagrant box:
vagrant@debian10:~$ binenv update terraform-inventory updating distributions 100% |████████████████████████████████████████████| (1/1, 19880 it/s) 2020-11-25T10:56:09Z ERR error unmarshalling github response for https://api.github.com/adammck/terraform-inventory/releases error="json: cannot unmarshal object into Go value of type list.ghReleaseResponse" func=GithubRelease.Get 2020-11-25T10:56:09Z ERR unable to fetch versions for "terraform-inventory" error="json: cannot unmarshal object into Go value of type list.ghReleaseResponse"

i shortened the progressbar, but the rest is copied verbatim. Any idea what's the problem?

@deknos
Copy link
Contributor Author

deknos commented Nov 25, 2020

after 20:00 localtime i can try to have a look into the code, earlier won't work.

@leucos
Copy link
Contributor

leucos commented Nov 25, 2020

i tested it in a vagrant box:
vagrant@debian10:~$ binenv update terraform-inventory updating distributions 100% |████████████████████████████████████████████| (1/1, 19880 it/s) 2020-11-25T10:56:09Z ERR error unmarshalling github response for https://api.github.com/adammck/terraform-inventory/releases error="json: cannot unmarshal object into Go value of type list.ghReleaseResponse" func=GithubRelease.Get 2020-11-25T10:56:09Z ERR unable to fetch versions for "terraform-inventory" error="json: cannot unmarshal object into Go value of type list.ghReleaseResponse"

i shortened the progressbar, but the rest is copied verbatim. Any idea what's the problem?

Yes, see #47 (comment) and #47 (comment) :D

You use the wrong URL. The proper one is https://api.github.com/repos/adammck/terraform-inventory/releases

{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest"
}

vs.

 curl https://api.github.com/repos/adammck/terraform-inventory/releases 
[
  {
    "url": "https://api.github.com/repos/adammck/terraform-inventory/releases/19151645",
    "assets_url": "https://api.github.com/repos/adammck/terraform-inventory/releases/19151645/assets",
    "upload_url": "https://uploads.github.com/repos/adammck/terraform-inventory/releases/19151645/assets{?name,label}",
    "html_url": "https://github.com/adammck/terraform-inventory/releases/tag/v0.9",
    "id": 19151645,
    "author": {
      "login": "adammck",
   ...

@deknos
Copy link
Contributor Author

deknos commented Nov 25, 2020

... arg. i will fix it.

@deknos
Copy link
Contributor Author

deknos commented Nov 25, 2020

done. i surely oversaw that.

@deknos
Copy link
Contributor Author

deknos commented Nov 25, 2020

and i updated and installed succesfully <3

@leucos
Copy link
Contributor

leucos commented Nov 25, 2020

Awesome, thanks !!

@leucos leucos merged commit 615f1bb into devops-works:develop Nov 25, 2020
@deknos deknos deleted the add-suggested-project-2 branch December 1, 2020 11:17
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.

None yet

2 participants