gocd / go-cookbook

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

Fix various server installation errors on windows #92

Closed watsonlu closed 7 years ago

watsonlu commented 7 years ago

Right now the server portion of the cookbook will 100% not install on windows.

The windows server is hardcoded to install to C:\GoServer. This does not respect work_dir. I fixed that.

In helpers.rb I fixed the config path, its hard coded to point to C:\Program Files\Go Server (even though the server is hard coded to install to C:\GoServer, whats up with that?). I fixed it so that it respects work_dir and will actually find the config instead of pointing to a file that doesn't exist.

Work_Dir does not have a windows friendly default setting. I added some logic to set a default attribute to C:\GoServer if its on windows. I updated the documentation with this info.

Finally, "publish_autoregister_key" doesn't always get the config on the first try. It's a race condition I think, but i'm not positive. I worked around it by adding retries to the logic for now.

tomzo commented 7 years ago

Thank you for your fixes.

It does not work on Windows because this cookbook is maintained on best-effort basis by community. I try to keep linux server and agent setup working, but I do tests only on the setup which fits my use case - no chef server and private GoCD repository.

PR looks good.

Finally, "publish_autoregister_key" doesn't always get the config on the first try. It's a race condition I think, but i'm not positive.

That sounds right, server can take a while to boot and create agentAutoRegisterKey