Created
July 11, 2012 09:20
-
-
Save codec/3089233 to your computer and use it in GitHub Desktop.
Jenkins Execute shell step for gitlab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p ${WORKSPACE}/build/etc/init | |
mkdir -p ${WORKSPACE}/build/etc/init.d | |
mkdir -p ${WORKSPACE}/build/srv/gitlabhq | |
mkdir -p ${WORKSPACE}/build/etc/apache2/sites-available | |
cat >${WORKSPACE}/build/etc/apache2/sites-available/gitlabhq <<EOF | |
<VirtualHost *:80> | |
# Passenger options that can be set in a virtual host | |
# configuration block. | |
PassengerHighPerformance on | |
PassengerStatThrottleRate 120 | |
PassengerUseGlobalQueue on | |
PassengerMaxPoolSize 5 | |
RackAutoDetect Off | |
RailsAutoDetect Off | |
RackBaseURI / | |
DocumentRoot /srv/gitlabhq/public | |
<Directory /srv/gitlabhq/public> | |
Options None | |
AllowOverride None | |
Order allow,deny | |
allow from all | |
</Directory> | |
</VirtualHost> | |
EOF | |
cat >${WORKSPACE}/build/etc/init/gitlab-resque.conf <<EOF | |
description "gitlabhq resque worker" | |
start on local-filesystems and net-device-up and runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
umask 022 | |
pre-start script | |
test -e /srv/gitlabhq/resque.sh || { stop; exit 0; } | |
end script | |
exec su - git -c /srv/gitlabhq/resque.sh | |
EOF | |
ln -s /lib/init/upstart-job ${WORKSPACE}/build/etc/init.d/gitlab-resque | |
tar xv -C ${WORKSPACE}/build/srv/gitlabhq -f gitlabhq-stable-*.tar | |
fpm -s dir -t deb -a all -n 'gitlabhq' -v "$(cat ${WORKSPACE}/build/srv/gitlabhq/VERSION)-$VERSION" -C build . | |
RC=$? | |
dpkg -c *.deb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment