Add rake task to install or upgrade gitlab-shell installation.
Created by: crohr
I think it would be nice if Gitlab came with a rake task to streamline the gitlab-shell installation, based on the existing Gitlab configuration. This task does just that, and allows for upgrading to a newer version of gitlab-shell as well.
rake gitlab:shell:install
# or, with specific version
rake gitlab:shell:install[v1.9.3]
What this does:
- fetch gitlab-shell code from github, at the given tag/branch/commit given.
- write gitlab-shell/config.yml based on the existing gitlab config
- launch the installation process of gitlab-shell
- write the current PATH to
$gitlab-shell-home/.ssh/environment
, so that the#!/usr/bin/env ruby
shebang in gitlab-shell files returns the right ruby version (i.e. the one currently used by the gitlab app).
The last point requires a change in the sshd configuration to take effect, with potential security issues if the server is also used by normal users (http://www.openssh.org/cgi-bin/man.cgi?query=sshd_config), so if this is an issue I'm happy to remove lines 50 to 58, as it would not apply to an 'install-everything-from-source' gitlab installation anyway.