gocd / go-cookbook

Cookbook that installs and configures the open-source ThoughtWorks Studios GoCD product
http://www.gocd.org/
Apache License 2.0
45 stars 66 forks source link

URL for Windows agent download (possibly server too) gets resolved wrong #127

Closed eugeneromero closed 6 years ago

eugeneromero commented 7 years ago

What I did: Included the gocd::agent recipe in my wrapper cookbook, with no overridden attributes:

include_recipe 'gocd::agent'

Then, ran a Windows 2012 R2 Kitchen suite to test agent install.

What I expected to happen: Gocd cookbook downloads the correct gocd agent package and installs it.

What actually happened: The remote_file[go-agent-latest-setup.exe] resource in gocd::agent_windows_install fails with a 404:

Recipe: gocd::agent_windows_install
  * remote_file[go-agent-latest-setup.exe] action create[2017-07-05T21:40:19+00:00] WARN:
    remote_file[go-agent-latest-setup.exe] cannot be downloaded from
    https://download.gocd.org/binaries/17.7.0-5147/win/go-agent-17.7.0-5147-setup.exe:
    404 "Not Found"

Cause: The URL for the Windows agent is wrong. Going to the GoCD download page, you can see the correct address is https://download.gocd.org/binaries/17.7.0-5147/win/go-agent-17.7.0-5147-jre-64bit-setup.exe (notice the -jre-64bit in the file name, there is also a 32bit version).

Looking at the recipe, I see a source property, which uses the go_agent_package_url helper.

This helper in turn, uses the go_agent_remote_package_name helper. I believe this is the helper that needs to be modified to properly set the correct package names for Windows.

I would imagine this also happens with the GoCD server package, but have not tested it.

Possible Solution: By means of Ohai, check if Windows is 32 or 64 bit, and create the Windows download URL as needed.

varshavaradarajan commented 7 years ago

Thanks for reporting the bug. Will look into it.

eugeneromero commented 7 years ago

Sorry about the double PR, forgot to switch to my personal account in the first PR (GitHub does not like my work email).

eugeneromero commented 6 years ago

Since PR #129 was merged, this issue can be closed.