From ebc55a3b1e6aed37abb3a8096525b2bc20065c6a Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 6 Feb 2014 15:09:37 +0100 Subject: [PATCH] Create rake wrapper during build --- config/software/gitlab-core.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+), 0 deletions(-) diff --git a/config/software/gitlab-core.rb b/config/software/gitlab-core.rb index 1980fa9..412e591 100644 --- a/config/software/gitlab-core.rb +++ b/config/software/gitlab-core.rb @@ -39,4 +39,21 @@ build do bundle "install --without mysql development test --path=#{install_dir}/embedded/service/gem" command "mkdir -p #{install_dir}/embedded/service/gitlab-core" command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/gitlab-core/" + block do + open("#{install_dir}/bin/gitlab-rake", "w") do |file| + file.print <<-EOH +#!/bin/bash +export PATH=/opt/gitlab/bin:/opt/gitlab/embedded/bin:$PATH + +# default to RAILS_ENV=production +if [[ -z $RAILS_ENV ]]; then + export RAILS_ENV=production +fi + +cd /opt/gitlab/embedded/service/gitlab-core +/opt/gitlab/embedded/bin/chpst -u git -U git /opt/gitlab/embedded/bin/bundle exec rake "$@" +EOH + end + end + command "chmod +x #{install_dir}/bin/gitlab-rake" end -- libgit2 0.21.2