Commit 90c7c03ebecab3fda5c7b4803efb1d85afefe1a0

Authored by Jacob Vosmaer
1 parent 7585fdf9

Create gitlab-shell wrappers at the end

I am not sure why but this fixes a problem where the templates were
sometimes only applied in /var/cache/omnibus/src/gitlab-shell, but not
in /opt/gitlab/embedded/service/gitlab-shell.
Showing 1 changed file with 3 additions and 4 deletions   Show diff stats
config/software/gitlab-shell.rb
@@ -25,17 +25,16 @@ dependency "rsync" @@ -25,17 +25,16 @@ dependency "rsync"
25 source :git => "https://gitlab.com/gitlab-org/gitlab-shell.git" 25 source :git => "https://gitlab.com/gitlab-org/gitlab-shell.git"
26 26
27 build do 27 build do
  28 + command "mkdir -p #{install_dir}/embedded/service/gitlab-shell"
  29 + command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/gitlab-shell/"
28 block do 30 block do
29 env_shebang = "#!/usr/bin/env ruby" 31 env_shebang = "#!/usr/bin/env ruby"
30 `grep -r -l '^#{env_shebang}' #{project_dir}`.split("\n").each do |ruby_script| 32 `grep -r -l '^#{env_shebang}' #{project_dir}`.split("\n").each do |ruby_script|
31 script = File.read(ruby_script) 33 script = File.read(ruby_script)
32 - next if script.start_with?("#!#{install_dir}") # Shebang looks good, skip this script  
33 - erb :dest => ruby_script, 34 + erb :dest => ruby_script.sub(project_dir, "#{install_dir}/embedded/service/gitlab-shell"),
34 :source => "ruby_script_wrapper.erb", 35 :source => "ruby_script_wrapper.erb",
35 :mode => 0755, 36 :mode => 0755,
36 :vars => {:script => script, :install_dir => install_dir} 37 :vars => {:script => script, :install_dir => install_dir}
37 end 38 end
38 end 39 end
39 - command "mkdir -p #{install_dir}/embedded/service/gitlab-shell"  
40 - command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/gitlab-shell/"  
41 end 40 end