added new ebuild for gitlabhq-7.12.0

This commit is contained in:
Manuel Friedli 2015-06-26 17:44:38 +02:00
parent e41434678e
commit e54169e142
2 changed files with 368 additions and 0 deletions

View file

@ -16,6 +16,7 @@ DIST gitlabhq-7.10.3.tar.gz 5690032 SHA256 e0d442b3c2bc4ae19bc0f146bc9ee0c072756
DIST gitlabhq-7.10.4.tar.gz 5690013 SHA256 9b87da87316ac32ce34b4826c1c8baf28b539c2289c62320ca69cf86298cdb5b SHA512 b97da9fa51fada1fb0694440f2e64de13faceed5bc716b83b39505af3e3f4680d8691360afd4c9ada0a0b7ed2c451ccb822eedf386aa39cd54cb8d57fe4e70ca WHIRLPOOL 2a0958df369b01c543402a2ff0377adb9ed6b7f508a879b89907c59614cd83ccdd9b1c952fca88921c933772d63cede2131273d74a920b2e99909e75670da84d DIST gitlabhq-7.10.4.tar.gz 5690013 SHA256 9b87da87316ac32ce34b4826c1c8baf28b539c2289c62320ca69cf86298cdb5b SHA512 b97da9fa51fada1fb0694440f2e64de13faceed5bc716b83b39505af3e3f4680d8691360afd4c9ada0a0b7ed2c451ccb822eedf386aa39cd54cb8d57fe4e70ca WHIRLPOOL 2a0958df369b01c543402a2ff0377adb9ed6b7f508a879b89907c59614cd83ccdd9b1c952fca88921c933772d63cede2131273d74a920b2e99909e75670da84d
DIST gitlabhq-7.11.1.tar.gz 5731386 SHA256 a877a0948df3f68d476316b88b9a10ea95a916d4c50532efd91e768bd7c04752 SHA512 477f124d72be0a744146691936182c06ff9770eb86a481a8da997150453995ca255f5e190162bacf312ea3111c1aa6ab53ada3fa2774354f15716bcff579583e WHIRLPOOL 69667a927be41c00200287167cb08e2980824a38da4f958cd8e5ee51f20a5c7c3dc2fc931c45f497cf4155c53c43b63d871e19ac6e6c8b6fd088f9fbb8cd25c1 DIST gitlabhq-7.11.1.tar.gz 5731386 SHA256 a877a0948df3f68d476316b88b9a10ea95a916d4c50532efd91e768bd7c04752 SHA512 477f124d72be0a744146691936182c06ff9770eb86a481a8da997150453995ca255f5e190162bacf312ea3111c1aa6ab53ada3fa2774354f15716bcff579583e WHIRLPOOL 69667a927be41c00200287167cb08e2980824a38da4f958cd8e5ee51f20a5c7c3dc2fc931c45f497cf4155c53c43b63d871e19ac6e6c8b6fd088f9fbb8cd25c1
DIST gitlabhq-7.11.4.tar.gz 5731377 SHA256 42e3326a44828bde722e344b85bea6b46cefa803feb754b4a0b50582480af5c8 SHA512 5a98a9bd0e102403a5d528d87b8e7aede114e37f32141a1bfe259e1efb4a7c63d57f18b32d290cc3631170619c06602e0e4252ba04045f25cc35e23ec66772ef WHIRLPOOL fbb6ff540bee4eb2d2985ff4dd58cfdb82689d58cde29e3bf233943b2c018ab0c1c4c902fb763c2f72d35bf0a1d0a13365e78995310aa23756f6d909f1ff711a DIST gitlabhq-7.11.4.tar.gz 5731377 SHA256 42e3326a44828bde722e344b85bea6b46cefa803feb754b4a0b50582480af5c8 SHA512 5a98a9bd0e102403a5d528d87b8e7aede114e37f32141a1bfe259e1efb4a7c63d57f18b32d290cc3631170619c06602e0e4252ba04045f25cc35e23ec66772ef WHIRLPOOL fbb6ff540bee4eb2d2985ff4dd58cfdb82689d58cde29e3bf233943b2c018ab0c1c4c902fb763c2f72d35bf0a1d0a13365e78995310aa23756f6d909f1ff711a
DIST gitlabhq-7.12.0.tar.gz 6095622 SHA256 57cdb0af2fae896db6fbde6bd04b71ed2996605117b11d8b8ddbaa7e269fdaf5 SHA512 40ec367c314a2f1a5e227f51a2d237d53feb466884ac478bf856678e031b121ee8470a41e22fba3aa9ff2f38049e36430ca3776f45daad0f60ec2f15349fcd1c WHIRLPOOL bbc0229a0380761ea3e081354fb8cb20d6546f6dbaaafd10c2fb17a94b4387e8f89b1f043f8c61e0bce92aaaaa58d704ab8333d7f519179ad6c0b2b30dcfa060
DIST gitlabhq-7.8.1.tar.gz 5302130 SHA256 4308a945b605caa369c0cafc22fbf7aa9f6cf9143ab200cde86c9c9308849153 SHA512 ac789c6264e599f44e50edf4ff09187293f1d2a7f4fc9460b3f28d5753a4d868247fe68a443e50c2bcbd75871ed7a124f1d49e84565da954c83f36154b4cc302 WHIRLPOOL ceb7f82f86d31264321fec76b5344d908327546ba9c2ceec7ad81cd8eaba7832450459251cd3e52825ae00f926f8d74205681abc8e867f97d44eea195dca4652 DIST gitlabhq-7.8.1.tar.gz 5302130 SHA256 4308a945b605caa369c0cafc22fbf7aa9f6cf9143ab200cde86c9c9308849153 SHA512 ac789c6264e599f44e50edf4ff09187293f1d2a7f4fc9460b3f28d5753a4d868247fe68a443e50c2bcbd75871ed7a124f1d49e84565da954c83f36154b4cc302 WHIRLPOOL ceb7f82f86d31264321fec76b5344d908327546ba9c2ceec7ad81cd8eaba7832450459251cd3e52825ae00f926f8d74205681abc8e867f97d44eea195dca4652
DIST gitlabhq-7.8.4.tar.gz 5302883 SHA256 84b2f2ed08aa524bcd85145921b99d176da1ed5210ebd00ef16b65b0c69c0c29 SHA512 35d803754b46b11087665f766279cd5b5fe348ba48cec3d889dc393ffa407f50bf9aea8564fd1f3e5fe1b513eec3a4e4e5032ed9c4f6e47189c59a7a60a515ff WHIRLPOOL d97911ac6cf5dcddffd784ee757846ca11c8134f80f88f9fbbb1ef90a3ed7a189ba00c126686fd34ba8889e0fafa0fe0059c9613ab922a1f155d8bfca5777d53 DIST gitlabhq-7.8.4.tar.gz 5302883 SHA256 84b2f2ed08aa524bcd85145921b99d176da1ed5210ebd00ef16b65b0c69c0c29 SHA512 35d803754b46b11087665f766279cd5b5fe348ba48cec3d889dc393ffa407f50bf9aea8564fd1f3e5fe1b513eec3a4e4e5032ed9c4f6e47189c59a7a60a515ff WHIRLPOOL d97911ac6cf5dcddffd784ee757846ca11c8134f80f88f9fbbb1ef90a3ed7a189ba00c126686fd34ba8889e0fafa0fe0059c9613ab922a1f155d8bfca5777d53
DIST gitlabhq-7.9.3.tar.gz 5390351 SHA256 265bf36d8560b8cac59a24474dc8addb7854435600589faae2c46f40bc232b18 SHA512 2387ae0228dbb75d5c58bb7240a7a04a7c36edbc994f9aac4d26509b1163e3e65779958f985de11474693ec6a09e0662d8af8a6fd78f13507e1d9ab38a4092d8 WHIRLPOOL 800148f5490c9a559604d47cb4a1733afbc6dd3bc79755b7985152c2514335d0e15ecef5c4a250bcbae821db8d0dbbaf2457e55b9b6abec4068777282b98ea01 DIST gitlabhq-7.9.3.tar.gz 5390351 SHA256 265bf36d8560b8cac59a24474dc8addb7854435600589faae2c46f40bc232b18 SHA512 2387ae0228dbb75d5c58bb7240a7a04a7c36edbc994f9aac4d26509b1163e3e65779958f985de11474693ec6a09e0662d8af8a6fd78f13507e1d9ab38a4092d8 WHIRLPOOL 800148f5490c9a559604d47cb4a1733afbc6dd3bc79755b7985152c2514335d0e15ecef5c4a250bcbae821db8d0dbbaf2457e55b9b6abec4068777282b98ea01
@ -24,6 +25,7 @@ EBUILD gitlabhq-7.10.3.ebuild 11280 SHA256 b68816f36f41d7c2771448db041b56c9c12d8
EBUILD gitlabhq-7.10.4.ebuild 11291 SHA256 d9958266f80306ae1961e00f50fd211d3d1b9496686301c1d145ecfcde7b03b1 SHA512 516d140f375ff5b915332555f06d805e4455eebab0cfa33dac2c0e8e1460c9f9611573d5f0604e75416f6ee376870123f3f3c4fc7405badc86a1ecbcfe5c4150 WHIRLPOOL ae0281c20bf798cc09ebd52e9e60393e36aee1be5ec10c26ec6bce2cf7a811477fcb67baf99815ef755521b25d24678bf24a42d569fac31daaa29bf6f85911a0 EBUILD gitlabhq-7.10.4.ebuild 11291 SHA256 d9958266f80306ae1961e00f50fd211d3d1b9496686301c1d145ecfcde7b03b1 SHA512 516d140f375ff5b915332555f06d805e4455eebab0cfa33dac2c0e8e1460c9f9611573d5f0604e75416f6ee376870123f3f3c4fc7405badc86a1ecbcfe5c4150 WHIRLPOOL ae0281c20bf798cc09ebd52e9e60393e36aee1be5ec10c26ec6bce2cf7a811477fcb67baf99815ef755521b25d24678bf24a42d569fac31daaa29bf6f85911a0
EBUILD gitlabhq-7.11.1.ebuild 11337 SHA256 c2fae88e4a2ffc3aa16e4feaa56ad5e3ed7aaf891707db49296f77585dde5c56 SHA512 2cd81ec23f75846cc984961edc707ffa4aa837e7e0ca0aafac48e24616f5661aebc0912c5c191485465cc6a5c92edde6eda1b0ff7d79eaaf3688df1a4150cdca WHIRLPOOL c0c95e58f21d5496bc37654a67626eeb1fc7c660f14431fbf948dd2bb71a5fab409c69688dd44456fdc78d0456b24be978f732809305631e10b253a544586561 EBUILD gitlabhq-7.11.1.ebuild 11337 SHA256 c2fae88e4a2ffc3aa16e4feaa56ad5e3ed7aaf891707db49296f77585dde5c56 SHA512 2cd81ec23f75846cc984961edc707ffa4aa837e7e0ca0aafac48e24616f5661aebc0912c5c191485465cc6a5c92edde6eda1b0ff7d79eaaf3688df1a4150cdca WHIRLPOOL c0c95e58f21d5496bc37654a67626eeb1fc7c660f14431fbf948dd2bb71a5fab409c69688dd44456fdc78d0456b24be978f732809305631e10b253a544586561
EBUILD gitlabhq-7.11.4.ebuild 11337 SHA256 c2fae88e4a2ffc3aa16e4feaa56ad5e3ed7aaf891707db49296f77585dde5c56 SHA512 2cd81ec23f75846cc984961edc707ffa4aa837e7e0ca0aafac48e24616f5661aebc0912c5c191485465cc6a5c92edde6eda1b0ff7d79eaaf3688df1a4150cdca WHIRLPOOL c0c95e58f21d5496bc37654a67626eeb1fc7c660f14431fbf948dd2bb71a5fab409c69688dd44456fdc78d0456b24be978f732809305631e10b253a544586561 EBUILD gitlabhq-7.11.4.ebuild 11337 SHA256 c2fae88e4a2ffc3aa16e4feaa56ad5e3ed7aaf891707db49296f77585dde5c56 SHA512 2cd81ec23f75846cc984961edc707ffa4aa837e7e0ca0aafac48e24616f5661aebc0912c5c191485465cc6a5c92edde6eda1b0ff7d79eaaf3688df1a4150cdca WHIRLPOOL c0c95e58f21d5496bc37654a67626eeb1fc7c660f14431fbf948dd2bb71a5fab409c69688dd44456fdc78d0456b24be978f732809305631e10b253a544586561
EBUILD gitlabhq-7.12.0.ebuild 10919 SHA256 fa98601a4251830318fa9b4b2513cc02459db8e5ee04bac7bfb6326ce37f69bc SHA512 1661135126472f1ae209be8d930c4ab870bc14a297c690e3feb02e3561ab28cdbcabf61f4b377f11a5c8166fb7e88ede505ce8fa8f94fcaacecb9e52a8296799 WHIRLPOOL 3c1878de816e92a5aa3dbdabb9ab2f0a84a8c32a596ea4a7a4aee2e1f497ea1a5cf2c8c91ec691229323a56a0d3f2a7d03cf4f9868746686ea3f0b82a75c5e81
EBUILD gitlabhq-7.8.1.ebuild 10966 SHA256 b5d3b822a4ce401b50909f0663bef4dacf7c9673c51bbbe2f600533f3bf7c365 SHA512 630b0b2bcda6fb7c5b407b4c094e35ad9de74ea9e6fd959f914f9944cd543ced2c3f9b1e8d3f98c6d3f1e0a3f6873e4ca64817ae3fe2aed61c4e656995e8ef62 WHIRLPOOL 3cede9b536a86cce0cc024a957d7b29c472cf60223ba9321bbe9e4b885cb9a58c3438d07708280a76dafb811551c3576559c4e6ec71b2050c3e81e88f460bce4 EBUILD gitlabhq-7.8.1.ebuild 10966 SHA256 b5d3b822a4ce401b50909f0663bef4dacf7c9673c51bbbe2f600533f3bf7c365 SHA512 630b0b2bcda6fb7c5b407b4c094e35ad9de74ea9e6fd959f914f9944cd543ced2c3f9b1e8d3f98c6d3f1e0a3f6873e4ca64817ae3fe2aed61c4e656995e8ef62 WHIRLPOOL 3cede9b536a86cce0cc024a957d7b29c472cf60223ba9321bbe9e4b885cb9a58c3438d07708280a76dafb811551c3576559c4e6ec71b2050c3e81e88f460bce4
EBUILD gitlabhq-7.8.4.ebuild 11421 SHA256 bb3de388ee40f9d63789c65da6d331f543870e88371c65a1f56ad019bf13d07f SHA512 600e93ceb3b4dbf018197e1462e14501bb6a36e1febead7078743034137e442d9104e505a4de622a6ca6108ef0f2427f4feb08bd2dddf95cae3830b2aa744984 WHIRLPOOL 2d30fe945665abe83ca138a49b18eb808d555b9a1f00e61c197cc3bfbc3167a1b46359e639893628f0dcb2bad871571ba416982685602c5a9195240986083906 EBUILD gitlabhq-7.8.4.ebuild 11421 SHA256 bb3de388ee40f9d63789c65da6d331f543870e88371c65a1f56ad019bf13d07f SHA512 600e93ceb3b4dbf018197e1462e14501bb6a36e1febead7078743034137e442d9104e505a4de622a6ca6108ef0f2427f4feb08bd2dddf95cae3830b2aa744984 WHIRLPOOL 2d30fe945665abe83ca138a49b18eb808d555b9a1f00e61c197cc3bfbc3167a1b46359e639893628f0dcb2bad871571ba416982685602c5a9195240986083906
EBUILD gitlabhq-7.9.3.ebuild 11316 SHA256 491ab8495fe600a625a03826d5f4f0a70cd54781c69b35de4eefaa7d4bbca5d0 SHA512 c80a1a04c3090603bd2f795624a97ed9e69451d4027321ffa7291b252a643a7cc14b50303b5fec0968b79101b3d3c304ff9d3731dd897cfb2e7a0d7fc4ed177f WHIRLPOOL 84dba3eb8abc110fb88b71db1cf4ed1f1085109c6af330094e50a7eedd18ce4721a5157745978a2705a93d1b21d53d57a80acf85a121926259d723235dcce416 EBUILD gitlabhq-7.9.3.ebuild 11316 SHA256 491ab8495fe600a625a03826d5f4f0a70cd54781c69b35de4eefaa7d4bbca5d0 SHA512 c80a1a04c3090603bd2f795624a97ed9e69451d4027321ffa7291b252a643a7cc14b50303b5fec0968b79101b3d3c304ff9d3731dd897cfb2e7a0d7fc4ed177f WHIRLPOOL 84dba3eb8abc110fb88b71db1cf4ed1f1085109c6af330094e50a7eedd18ce4721a5157745978a2705a93d1b21d53d57a80acf85a121926259d723235dcce416

View file

@ -0,0 +1,366 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# Maintainer notes:
# - This ebuild uses Bundler to download and install all gems in deployment mode
# (i.e. into isolated directory inside application). That's not Gentoo way how
# it should be done, but GitLab has too many dependencies that it will be too
# difficult to maintain them via ebuilds.
#
USE_RUBY="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user systemd
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
#SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v7.11.0.rc2.tar.gz -> ${P}.tar.gz"
#RUBY_S="${PN}-7.11.0"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn systemd"
## Gems dependencies:
# charlock_holmes dev-libs/icu
# grape, capybara dev-libs/libxml2, dev-libs/libxslt
# rugged dev-util/cmake, virtual/pkgconfig
# json dev-util/ragel
# pygments.rb python 2.7+
# execjs net-libs/nodejs, or any other JS runtime
# pg dev-db/postgresql
# mysql virtual/mysql
#
GEMS_DEPEND="
dev-libs/icu
dev-libs/libxml2
dev-libs/libxslt
dev-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/krb5
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.6.3
dev-vcs/git
!app-crypt/heimdal"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.9.3-fix-gemfile.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}"
CONF_DIR="/etc/${MY_NAME}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
lib/support/nginx/gitlab || die "failed to filter nginx/gitlab"
# modify default database settings for PostgreSQL
sed -i -E \
-e 's|(username:).*|\1 gitlab|' \
-e 's|(password:).*|\1 gitlab|' \
-e 's|(socket:).*|\1 /run/postgresql/.s.PGSQL.5432|' \
config/database.yml.postgresql \
|| die "failed to filter database.yml.postgresql"
# rename config files
mv config/gitlab.yml.example config/gitlab.yml
mv config/unicorn.rb.example config/unicorn.rb
local dbconf=config/database.yml
if use postgres && ! use mysql; then
mv ${dbconf}.postgresql ${dbconf}
rm ${dbconf}.mysql
elif use mysql && ! use postgres; then
mv ${dbconf}.mysql ${dbconf}
rm ${dbconf}.postgresql
fi
# remove useless files
rm -r lib/support/{deploy,init.d}
use unicorn || rm config/unicorn.rb
}
all_ruby_install() {
local dest=${DEST_DIR}
local conf=${CONF_DIR}
local logs=${LOGS_DIR}
local temp=${TEMP_DIR}
# prepare directories
diropts -m750
dodir ${logs} ${temp} ${temp}/repo_satellites
diropts -m755
dodir ${conf} ${dest}/public/uploads
dosym ${temp} ${dest}/tmp
dosym ${logs} ${dest}/log
# install configs
insinto ${conf}
doins -r config/*
dosym ${conf} ${dest}/config
echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile"
# remove needless dirs
rm -Rf config tmp log
# install the rest files
# using cp 'cause doins is slow
cp -Rl * "${D}/${dest}"/
# install logrotate config
dodir /etc/logrotate.d
cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF
${logs}/*.log {
missingok
delaycompress
compress
copytruncate
}
EOF
## Install gems via bundler ##
cd "${D}/${dest}"
local without="development test aws"
local flag; for flag in mysql postgres unicorn; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_newunit "${FILESDIR}/gitlab-sidekiq-7.service" "gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq-noslot.init
use unicorn && rcscript=gitlab-unicorn.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}"
fi
}
pkg_postinst() {
elog
elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml."
elog
elog "2. Configure your database settings in ${CONF_DIR}/database.yml"
elog " for \"production\" environment."
elog
elog "3. Then you should create a database for your GitLab instance, if you"
elog "haven't done so already."
elog
if use postgres; then
elog "If you have local PostgreSQL running, just copy&run:"
elog " su postgres"
elog " psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\"
elog " NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\""
elog " createdb -E UTF-8 -O gitlab gitlabhq_production"
elog " Note: You should change your password to something more random..."
elog
fi
elog "4. Finally execute the following command to initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
elog
elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and"
elog "you can't login after the upgrade, be sure to read the section about the"
elog "verification of the CSRF token in GitLab's trouble-shooting guide at"
elog "http://goo.gl/5XGRGv."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
einfo "Checking configuration files"
if [ ! -r "${CONF_DIR}/database.yml" ]; then
eerror "Copy ${CONF_DIR}/database.yml.* to"
eerror "${CONF_DIR}/database.yml and edit this file in order to configure your"
eerror "database settings for \"production\" environment."; die
fi
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
fi
local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)"
local git_home="$(egethome ${MY_USER})"
# configure Git global settings
if [ ! -e "${git_home}/.gitconfig" ]; then
einfo "Setting git user"
su -l ${MY_USER} -c "
git config --global user.email '${email_from}';
git config --global user.name 'GitLab'" \
|| die "failed to setup git name and email"
fi
if [ ! -d "${DEST_DIR}/.git" ]; then
# create dummy git repo as workaround for
# https://github.com/bundler/bundler/issues/2039
einfo "Initializing dummy git repository to avoid false errors from bundler"
su -l ${MY_USER} -c "
cd ${DEST_DIR}
git init
git add README.md
git commit -m 'Dummy repository'" >/dev/null
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
if [ "${update}" = 'true' ]; then
ewarn
ewarn "This configuration script runs only common migration tasks."
ewarn "Please read guides on"
ewarn " https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/"
ewarn "for any additional migration tasks specific to your previous GitLab"
ewarn "version."
fi
}
ryaml() {
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
}
exec_rake() {
local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}