提交 dcdced81 编写于 作者: R Rémy Coutable

Merge branch 'gitlab-shell-compile' into 'master'

Compile gitlab-shell go executables

See merge request !11039
......@@ -104,6 +104,7 @@ cd /home/git/gitlab-shell
sudo -u git -H git fetch --all --tags
sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION)
sudo -u git -H bin/compile
```
### 7. Update gitlab-workhorse
......
......@@ -75,6 +75,7 @@ cd /home/git/gitlab-shell
sudo -u git -H git fetch --all --tags
sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION` -b v`cat /home/git/gitlab/GITLAB_SHELL_VERSION`
sudo -u git -H sh -c 'if [ -x bin/compile ]; then bin/compile; fi'
```
### 6. Start application
......
......@@ -60,6 +60,7 @@ GitLab Shell might be outdated, running the commands below ensures you're using
cd /home/git/gitlab-shell
sudo -u git -H git fetch
sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION`
sudo -u git -H sh -c 'if [ -x bin/compile ] ; then bin/compile ; fi'
```
## One line upgrade command
......@@ -78,6 +79,7 @@ cd /home/git/gitlab; \
cd /home/git/gitlab-shell; \
sudo -u git -H git fetch; \
sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION`; \
sudo -u git -H sh -c 'if [ -x bin/compile ] ; then bin/compile ; fi'; \
cd /home/git/gitlab; \
sudo service gitlab start; \
sudo service nginx restart; \
......
......@@ -41,8 +41,14 @@ namespace :gitlab do
# Generate config.yml based on existing gitlab settings
File.open("config.yml", "w+") {|f| f.puts config.to_yaml}
# Launch installation process
system(*%w(bin/install) + repository_storage_paths_args)
[
%w(bin/install) + repository_storage_paths_args,
%w(bin/compile)
].each do |cmd|
unless Kernel.system(*cmd)
raise "command failed: #{cmd.join(' ')}"
end
end
end
# (Re)create hooks
......
......@@ -11,6 +11,10 @@ describe 'gitlab:shell rake tasks' do
it 'invokes create_hooks task' do
expect(Rake::Task['gitlab:shell:create_hooks']).to receive(:invoke)
storages = Gitlab.config.repositories.storages.values.map { |rs| rs['path'] }
expect(Kernel).to receive(:system).with('bin/install', *storages).and_call_original
expect(Kernel).to receive(:system).with('bin/compile').and_call_original
run_rake_task('gitlab:shell:install')
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册