{"action":"created","issue":{"url":"https://api.github.com/repos/gocd-contrib/go-cookbook/issues/75","repository_url":"https://api.github.com/repos/gocd-contrib/go-cookbook","labels_url":"https://api.github.com/repos/gocd-contrib/go-cookbook/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/gocd-contrib/go-cookbook/issues/75/comments","events_url":"https://api.github.com/repos/gocd-contrib/go-cookbook/issues/75/events","html_url":"https://github.com/gocd-contrib/go-cookbook/pull/75","id":136981428,"number":75,"title":"#63 #67 improve version handling and installing on windows","user":{"login":"tomzo","id":5710970,"avatar_url":"https://avatars.githubusercontent.com/u/5710970?v=3","gravatar_id":"","url":"https://api.github.com/users/tomzo","html_url":"https://github.com/tomzo","followers_url":"https://api.github.com/users/tomzo/followers","following_url":"https://api.github.com/users/tomzo/following{/other_user}","gists_url":"https://api.github.com/users/tomzo/gists{/gist_id}","starred_url":"https://api.github.com/users/tomzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomzo/subscriptions","organizations_url":"https://api.github.com/users/tomzo/orgs","repos_url":"https://api.github.com/users/tomzo/repos","events_url":"https://api.github.com/users/tomzo/events{/privacy}","received_events_url":"https://api.github.com/users/tomzo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-02-27T23:29:58Z","updated_at":"2016-04-19T17:58:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/gocd-contrib/go-cookbook/pulls/75","html_url":"https://github.com/gocd-contrib/go-cookbook/pull/75","diff_url":"https://github.com/gocd-contrib/go-cookbook/pull/75.diff","patch_url":"https://github.com/gocd-contrib/go-cookbook/pull/75.patch"},"body":"Few things here\r\n1. The way attributes were constructed from one another - it did not work in many cases. Leading to paths, filenames, urls ending up with something like `go-agent--setup.exe`. I replaced those by library methods. User can still overide versions and urls as before. But it is more bulletproof now.\r\n2. Changed `windows_package` and `package` resources into simple `execute` with proper nsis arguments - `/s` to be silent. The windows package resources just don't work too well on windows (meaning I had a few silly errors when trying out the windows recipe @ketan recently added). At least not in all chef version. I think that extra chef-o-cracy is just breaking the cookbook instead of being useful. `execute` will work, all the time.\r\n3. I used the updates service #63. On windows, it makes perfect sense to call service to find out what is latest stable.\r\n4. A few improvements on package names and version handling to make it feel better. Now user can also set `node['gocd']['version'] = 'stable'` or `node['gocd']['version'] = 'experimental'` which will be resolved with updates service at compile time. On windows this is resolved always.\r\n\r\nAll this is unit tested only at this point, so please don't merge yet, but **please have a look and review**. I'll test it within next few days as I am working on windows now.\r\n\r\nWindows agent LWRP will be in another PR. Once I test these changes a bit."},"comment":{"url":"https://api.github.com/repos/gocd-contrib/go-cookbook/issues/comments/212043543","html_url":"https://github.com/gocd-contrib/go-cookbook/pull/75#issuecomment-212043543","issue_url":"https://api.github.com/repos/gocd-contrib/go-cookbook/issues/75","id":212043543,"user":{"login":"tomzo","id":5710970,"avatar_url":"https://avatars.githubusercontent.com/u/5710970?v=3","gravatar_id":"","url":"https://api.github.com/users/tomzo","html_url":"https://github.com/tomzo","followers_url":"https://api.github.com/users/tomzo/followers","following_url":"https://api.github.com/users/tomzo/following{/other_user}","gists_url":"https://api.github.com/users/tomzo/gists{/gist_id}","starred_url":"https://api.github.com/users/tomzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomzo/subscriptions","organizations_url":"https://api.github.com/users/tomzo/orgs","repos_url":"https://api.github.com/users/tomzo/repos","events_url":"https://api.github.com/users/tomzo/events{/privacy}","received_events_url":"https://api.github.com/users/tomzo/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T17:58:14Z","updated_at":"2016-04-19T17:58:14Z","body":"I reverted my windows changes, I managed to catch the error I previously encountered:\r\n```\r\nStarting Chef Client, version 12.4.2\r\n       Compiling Cookbooks...\r\n       [2016-04-19T17:45:28-07:00] WARN: Go server not found on Chef server or not specifed via node['gocd']['agent']['go_server_host'] attribute, defaulting Go server to 127.0.0.1\r\n       Converging 9 resources\r\n       Recipe: gocd::server_windows_install\r\n       \r\n           - create new file C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\kitchen\\cache/go-server-stable-setup.exe\r\n           - update content in file C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\kitchen\\cache/go-server-stable-setup.exe from none to f01b1a\r\n           (file sizes exceed 10000000 bytes, diff output suppressed)\r\n       \r\n           \r\n           ================================================================================\r\n           Error executing action `install` on resource 'windows_package[Go Server]'\r\n           ================================================================================\r\n           \r\n           ArgumentError\r\n           -------------\r\n           Installer type for Windows Package 'Go Server' not specified and cannot be determined from file extension 'exe'\r\n           \r\n           Resource Declaration:\r\n           ---------------------\r\n           # In C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\kitchen\\cookbooks\\gocd\\recipes\\server_windows_install.rb\r\n           \r\n            13:   package 'Go Server' do\r\n            14:     source package_path\r\n            15:     options opts.join(\" \")\r\n            16:   end\r\n            17: else\r\n           \r\n           Compiled Resource:\r\n           ------------------\r\n           # Declared in C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\kitchen\\cookbooks\\gocd\\recipes\\server_windows_install.rb:13:in `from_file'\r\n           \r\n           windows_package(\"Go Server\") do\r\n             action [:install]\r\n             retries 0\r\n             retry_delay 2\r\n             default_guard_interpreter :default\r\n             options \"/S /D=C:\\\\GoServer\"\r\n             package_name \"Go Server\"\r\n             source \"c:\\\\users\\\\admini~1\\\\appdata\\\\local\\\\temp\\\\kitchen\\\\cache\\\\go-server-stable-setup.exe\"\r\n             timeout 600\r\n             returns [0]\r\n             declared_type :package\r\n             cookbook_name :gocd\r\n             recipe_name \"server_windows_install\"\r\n           end\r\n           \r\n       \r\n```"}}