Closed deknos closed 3 years ago
adding terraform-inventory as well. i use this in some schools for ansible inventory preparation
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.
thanks for the headsup! i will adapt the files. and thanks for the versioning hint!
sadly i will only able to do that in the evening
sadly i will only able to do that in the evening
no problem, take it easy
i added it regarding your suggestions! :)
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:
distributions.yaml
to ~/.config/binenv/distributions.yaml
binenv update terraform-inventory
binenv install terraform-inventory
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?
after 20:00 localtime i can try to have a look into the code, earlier won't work.
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 https://github.com/devops-works/binenv/pull/47#issuecomment-733599710 and https://github.com/devops-works/binenv/pull/47#issuecomment-732433162 :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",
...
... arg. i will fix it.
done. i surely oversaw that.
and i updated and installed succesfully <3
Awesome, thanks !!
adding yq