Skip to content

Commit d273077

Browse files
committed
Install golang from the package manager instead of external binaries
There is a golang cookbook but this also installs from external binaries or from source, which seems pointless when all the supported platforms already have a sufficiently recent version available. If it's not in the main repositories then it can at least be found in EPEL (which we already use) or Universe. The Ubuntu versions mentioned in .kitchen.yml should be updated anyway.
1 parent 4463a29 commit d273077

File tree

2 files changed

+1
-36
lines changed

2 files changed

+1
-36
lines changed

attributes/default.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
default['gitlab']['packages'] = %w(
8282
cmake
8383
curl
84+
golang
8485
nodejs
8586
python-docutils
8687
sudo

recipes/default.rb

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -365,42 +365,6 @@ class unix_stream_socket connectto;
365365
not_if { File.exist?(bundle_success) }
366366
end
367367

368-
# Install Gitlab Git HTTP server
369-
370-
## get Go 1.5 # TODO, for future PR find cookbook for Go ie: https://github.com/NOX73/chef-golang
371-
golang_package = 'https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz'
372-
temp_golangpkg = '/tmp/gitlab_git_http_server.tar'
373-
374-
remote_file temp_golangpkg do
375-
source golang_package
376-
# checksum node['']['']['checksum']
377-
owner 'root'
378-
group 'root'
379-
mode '0755'
380-
notifies :run, 'bash[extract_golang]', :immediately
381-
not_if { ::File.exist?('/usr/local/bin/go') }
382-
end
383-
384-
bash 'extract_golang' do
385-
action :run
386-
cwd ::File.dirname(node['gitlab']['home'])
387-
code <<-EOH
388-
tar -C /usr/local -xzf #{temp_golangpkg}
389-
rm -f #{temp_golangpkg}
390-
EOH
391-
not_if { ::File.exist?('/usr/local/bin/go') }
392-
end
393-
394-
%w(go godoc gofmt).each do |l|
395-
link "/usr/local/bin/#{l}" do
396-
to "/usr/local/go/bin/#{l}"
397-
not_if "test -e /usr/local/bin/#{l}"
398-
only_if "test -e /usr/local/go/bin/#{l}"
399-
# not_if {File.exists?("/usr/local/bin/#{l}")}
400-
# only_if {File.exists?("/usr/local/go/bin/#{l}")}
401-
end
402-
end
403-
404368
# Install gitlab git http server
405369
git "#{node['gitlab']['home']}/gitlab-git-http-server" do
406370
# default repository 'https://gitlab.com/gitlab-org/gitlab-git-http-server.git

0 commit comments

Comments
 (0)