Commit ebc55a3b1e6aed37abb3a8096525b2bc20065c6a
1 parent
cafc2d0b
Exists in
master
and in
17 other branches
Create rake wrapper during build
Showing
1 changed file
with
17 additions
and
0 deletions
Show diff stats
config/software/gitlab-core.rb
@@ -39,4 +39,21 @@ build do | @@ -39,4 +39,21 @@ build do | ||
39 | bundle "install --without mysql development test --path=#{install_dir}/embedded/service/gem" | 39 | bundle "install --without mysql development test --path=#{install_dir}/embedded/service/gem" |
40 | command "mkdir -p #{install_dir}/embedded/service/gitlab-core" | 40 | command "mkdir -p #{install_dir}/embedded/service/gitlab-core" |
41 | command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/gitlab-core/" | 41 | command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/gitlab-core/" |
42 | + block do | ||
43 | + open("#{install_dir}/bin/gitlab-rake", "w") do |file| | ||
44 | + file.print <<-EOH | ||
45 | +#!/bin/bash | ||
46 | +export PATH=/opt/gitlab/bin:/opt/gitlab/embedded/bin:$PATH | ||
47 | + | ||
48 | +# default to RAILS_ENV=production | ||
49 | +if [[ -z $RAILS_ENV ]]; then | ||
50 | + export RAILS_ENV=production | ||
51 | +fi | ||
52 | + | ||
53 | +cd /opt/gitlab/embedded/service/gitlab-core | ||
54 | +/opt/gitlab/embedded/bin/chpst -u git -U git /opt/gitlab/embedded/bin/bundle exec rake "$@" | ||
55 | +EOH | ||
56 | + end | ||
57 | + end | ||
58 | + command "chmod +x #{install_dir}/bin/gitlab-rake" | ||
42 | end | 59 | end |