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

Package can't be internalized #1

Open
2Deep2Dive opened this issue Aug 5, 2020 · 3 comments
Open

Package can't be internalized #1

2Deep2Dive opened this issue Aug 5, 2020 · 3 comments

Comments

@2Deep2Dive
Copy link

Hi,

When attempting to internalize the jenkins-x package I get the following error

Found internalizable Chocolatey functions. Inspecting values for remote resources.
Found 'https://github.com/jenkins-x/jx/releases/download/v$env:ChocolateyPackageVersion/jx-windows-amd64.zip' for replacement.
Found 'https://github.com/jenkins-x/jx/releases/download/v$env:ChocolateyPackageVersion/jx-checksums.txt' for replacement.
Encountered error downloading package jenkins-x v:
System.Exception: The remote file either doesn't exist, is unauthorized, or is forbidden for url 'https://github.com/jenkins-x/jx/releases/download/v$env:
The remote server returned an error: (404) Not Found.

the error is caused because "$env:ChocolateyPackageVersion" is used to set the version in the path but the variable is only assigned the value when installing the app and not when downloading it

the following approach will solve the issue

$latestRelease = Invoke-WebRequest https://github.com/jenkins-x/jx/releases/latest -Headers @{"Accept"="application/json"}
$json = $latestRelease.Content | ConvertFrom-Json
$version = $json.tag_name

regards,
Mohamed

@jufab
Copy link
Owner

jufab commented Aug 6, 2020

Hi Mohamed,

I received your mail and thanks for your return on C4B

I prefer to stay with the version number and not with the latest. Because when you want to install a specific version you don't want the latest...

I tried a new approach for the version number.

See at the next publication if this bugfix works ...

@jufab
Copy link
Owner

jufab commented Aug 11, 2020

@2Deep2Dive The latest version have the modification (2.1.129)

is it working?

@2Deep2Dive
Copy link
Author

Hi Julien,

Sorry for the very long delay, life was not easy with Corona
I finally managed to run a quick test to internalize the package but sadly I revived the following error

jenkins-x v2.1.155 (forced) [Approved]
Found internalizable Chocolatey functions. Inspecting values for remote resources.
Unable to find value for variable '$version'. May not be able to download resource from url 'https://github.com/jenkins-x/jx/releases/download/v$version/$fileZip'.
Found 'https://github.com/jenkins-x/jx/releases/download/v$version/jx-windows-amd64.zip' for replacement.
Unable to find value for variable '$version'. May not be able to download resource from url 'https://github.com/jenkins-x/jx/releases/download/v$version/$fileChecksums'.
Found 'https://github.com/jenkins-x/jx/releases/download/v$version/jx-checksums.txt' for replacement.
Encountered error downloading package jenkins-x v:
System.Exception: The remote file either doesn't exist, is unauthorized, or is forbidden for url 'https://github.com/jenkins-x/jx/releases/download/v$version/jx-windows-amd64.zip'.
The remote server returned an error: (404) Not Found.

hopefully this will help and you will manage to find a solution to this issue

stay safe and stay healthy

Cheers,
Mohamed

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

No branches or pull requests

2 participants