Skip to content

Commit

Permalink
v6.4.2
Browse files Browse the repository at this point in the history
* Add a profile script shim, so init script can correct Ruby.
  • Loading branch information
atomic-penguin committed Feb 11, 2014
1 parent 03357a7 commit 92a6eab
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Gitlab Cookbook Changelog
=========================

v6.4.2
------

* Add a profile script shim, so init script can correct Ruby.

v6.4.1
------

Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
description 'Installs/Configures gitlab'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
name 'gitlab'
version '6.4.1'
version '6.4.2'

%w[build-essential zlib readline ncurses git openssh redisio xml
ruby_build certificate database logrotate mysql nginx
Expand Down
8 changes: 8 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@
group node['gitlab']['group']
end

# Drop off a profile script to be included in init script
template "#{node['gitlab']['home']}/.profile" do
source 'profile_gitlab.sh.erb'
owner node['gitlab']['user']
group node['gitlab']['group']
mode '0755'
end

# Render gitlab init script
# This needs to happen before gitlab.yml is rendered.
# So when the service is subscribed, the init file will be in place
Expand Down
3 changes: 3 additions & 0 deletions templates/default/gitlab.init.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ sidekiq_pid_path="$pid_path/sidekiq.pid"
# Read configuration variable file if it is present
test -f /etc/default/gitlab && . /etc/default/gitlab

# Read profile script if it is present
test -x <%= node['gitlab']['home'] %>/.profile && . <%= node['gitlab']['home'] %>/.profile

# Switch to the app_user if it is not he/she who is running the script.
if [ "$USER" != "$app_user" ]; then
sudo -u "$app_user" -H -i $0 "$@"; exit;
Expand Down
7 changes: 7 additions & 0 deletions templates/default/profile_gitlab.sh.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# Generated by Chef for <%= @fqdn %>
# Local modifications will be overwritten.
RUBY_DIR=<%= node['gitlab']['install_ruby_path'] %>
if ! echo ${PATH} | /bin/grep -q $RUBY_DIR/bin ; then
PATH=$RUBY_DIR/bin:${PATH}
fi

0 comments on commit 92a6eab

Please sign in to comment.