added ebuild for gitlab-8.7.0 (digest is missing, thus invalid Manifest) and updated dependencies; cleaned up old ebuilds

This commit is contained in:
Manuel Friedli 2016-04-21 22:43:02 +02:00
parent dfd93e9647
commit 7faf28d8f0
15 changed files with 11 additions and 1475 deletions

View File

@ -1,11 +1,7 @@
AUX gitlab-ci-multi-runner.conf 44 SHA256 0b93ba53d557fbf603b50f6d78eb2c4415b9a79f056142b6edf4a63fc6612d6e SHA512 1f5ff480740b18fc985ae9337b8dc4ddd1bde5253e09042b5542cb9a3db54b9cef1f7b24445c829eb83fcfd8751b693018154f6b97ce0a6e723d5d71d9a27429 WHIRLPOOL fc5218c55917b3303baf649fbafaf1dc50cf52d0ee04852716defe4f21b806f4f313071b1c55920d89da66180405d35da0f7cca73c2617b70bcaa67f725cab2a
AUX gitlab-ci-multi-runner.init 696 SHA256 03fc8cf6f5d8883b69122362202779f1ef8c8bcc5e60b828a97fb4b6b98ba315 SHA512 70e77d175239827df7470d716d59a61147390f9ae3b796f38bfd4edf966dabb09a6be4ed620e34a8eeb1345d7e2c32082dcc00d7857193fc02024b9ba12142b6 WHIRLPOOL 53ce6f85bc624b44242bc424f755414c8303ba953cdbcbc15b5e3be7b67f0438278d1689f7ce2bc2ae5c4a296fd706401988d0f889d8c37eabd7955e6becca91
DIST gitlab-ci-multi-runner-1.0.4-amd64 31999976 SHA256 c73c22e54c1416ede6580d359af0089d9d8c8e461574543d93af2a84c91b6d38 SHA512 d96497fe6ae646d696ede7ede97a2137bb05a43c5b4c6622cb4dd612ae9d24b091ad7287d22121d7418515880f564a8af99f1d8c58ec7ea6e31a54dcb4e9274c WHIRLPOOL af78d6fdb8356062e1a3fe1e66dc3d69e0755f8ac3758884f1069cfd53b9e133f628bf244778eeefe04d227ed56fb96288e954b20d5e95f641d666534ed31926
DIST gitlab-ci-multi-runner-1.0.4-arm 29455296 SHA256 09e17c5f188d99d16acbe06cb01fc39c6856c6f4f8524fa4fd43291ba471beb3 SHA512 f3af90b9884d36853cc5b49b5086bbe5ac97c86b77d07bb3f47cf36c492cc024109ee9cb5135d0d671b5d1cbfb94f7473fd988d9858c6819fd031b5a98c72afa WHIRLPOOL 9107f197164cf2647ccccb4047d0397046ca30ae56be02fe4e8d29ccd2b8d5f0315c0e5fa162e38abce22ddd8ca48d6579f05674478c19b76aa47282268bd15c
DIST gitlab-ci-multi-runner-1.0.4-x86 29555368 SHA256 47098bd380f10069829ec4b0082092324b75267e3321a85bafbdc92dc7858382 SHA512 6ae1a5e0c9e8da14f8ee5be24190e78dd5b8af12b07f622435fb15ad1405cc34749247f2b85519ac7381672a0ce7b7d5d9f4e13db189c56feb04351b060a1fa1 WHIRLPOOL a0a4647854c83a4fc24442c36f90399876d8c6d4df8d60760f10fe8d51088cb74b9087564b489c93dbd0038f3550fc0dc5b2da2eb3b08e372b0d71b9b6f8be62
DIST gitlab-ci-multi-runner-1.1.0-amd64 35139360 SHA256 285c344da3a5af3e52fa589bc4b3a1468b620a1f3fd9a54defcc8b8dd7a39bda SHA512 f0eca543949d2afbb88a130f6dd29dc7fd159d3f3f38697355e917fdee856f3ad920762e3fa4618c9ba3acb6e5d3d79cd18625bc13e722eec3b46bb9675ef172 WHIRLPOOL c5336f684c564e86d8d737e67d9652cfa743d80f31367f5319fd2d411efe792b2646f0ce69c7f1781dd44f2840f844f26c821d4c20dbb0965a684ad38063d64c
DIST gitlab-ci-multi-runner-1.1.0-arm 32259608 SHA256 07c0d40471d6ab09590cc6298d550c863abbedb00cddca90c2e79c2392e537f8 SHA512 bd56bf93a4698720680a3228364cd9f5117b32cbdca23d3757bd1c3e58d8e2eaf7be825c03357594ae9d8052d483da31be5558f8a539d2daa84a849bf0515209 WHIRLPOOL 92aa46cd9e769dd92f18497835354368b72b2e8303ed05bc6032c0a1b0f1a22994dfad30b0a8d8eb7ac5e7080aa30f2fc253709beaa8d8368b53ecc2a26bd202
DIST gitlab-ci-multi-runner-1.1.0-x86 32430208 SHA256 1765f00353104c8137f13a1d2ebbb94b8029fbd051a3bfd9a743e3f87a375eda SHA512 90c8f91515f7bb75408cb5db8b320cf9c7efe6208c32398e2282822968fedc89bcc1e497ab5c0cf83d7ff519cfe88b91758c98a736a6660e0b9d5fcbbf4c7fef WHIRLPOOL 52c5df9f70bf988b7a73f5434b3c0c876aefbdf0d1522cf83abd67c2e0711f36b9683b95a805f87145f3a345282baa20c06918a951aece11da7c2ab39cd7a110
EBUILD gitlab-ci-multi-runner-1.0.4.ebuild 2349 SHA256 6432c48b3a7a36c0b28ccab7fb79382061fa9296df9b6dc9ca32d4caa5f20702 SHA512 2a7674d506e79d8570fa8527dd10b87e775a75b4daf41458bcca28f5ad9863145571d4ebf9d9e0d9df015e48c89a7bd4a05d1bc7928223fdc2b7fd528d5282d8 WHIRLPOOL 6df8346401d631b58a3a6e1ce9f2c0e3e8b871e99880099463dcb9b5639d08b3725c7c83e7f96dfe7e8cba4e60abe77e2afbeb2c7ae8ec13cf02b05d1723fd9f
EBUILD gitlab-ci-multi-runner-1.1.0.ebuild 2349 SHA256 6432c48b3a7a36c0b28ccab7fb79382061fa9296df9b6dc9ca32d4caa5f20702 SHA512 2a7674d506e79d8570fa8527dd10b87e775a75b4daf41458bcca28f5ad9863145571d4ebf9d9e0d9df015e48c89a7bd4a05d1bc7928223fdc2b7fd528d5282d8 WHIRLPOOL 6df8346401d631b58a3a6e1ce9f2c0e3e8b871e99880099463dcb9b5639d08b3725c7c83e7f96dfe7e8cba4e60abe77e2afbeb2c7ae8ec13cf02b05d1723fd9f
DIST gitlab-ci-multi-runner-1.1.3-amd64 35154568 SHA256 0ea28a7d53857d31e736f282c3309a6cb89f63ef636834542098e734c6b7c073 SHA512 57f8ecb233d18cd3ebe48d7c1342cad3129ca171ee5b918323ed04ab9433bc9ac7a770e60be1c722be4b94049484757c6bf08a770362b2a8321bba8fca5ad8f6 WHIRLPOOL 4d653523bafaf62da3ab7bfe4671b3ff13d6126b86daee850eca73beaf5e2877357b3f7327395864e4963babee11d79f7c7776b23e34c9a07b3d2ce7b4767cba
DIST gitlab-ci-multi-runner-1.1.3-arm 32274360 SHA256 6d4bc687580c1847b0bd5a231b5f511bb3dd3ad56bba57551ffd95367398cb56 SHA512 bccebb2311a10e96ad6170e381ab41c3bc4e8127c7605e9ae667363b52e87d37719ddb368eea649cfb765e6a7a5619eb3941ef9aaef685422527175abb9c805a WHIRLPOOL 3eb9f7f9c7792aaa1d983c96a2eb515ae0139f487a69d903038155ba9d188c7f1e6c2d0e5ba69502b8130e3d7fb25c09b629aafa44766f484e469c0915222aaa
DIST gitlab-ci-multi-runner-1.1.3-x86 32445128 SHA256 961a232106d3faaed528d3aabe7b023b8bf1f622bb13dc4408808fe238699cdb SHA512 3dadb3d7bad25029fe42f5136caacf656db9662b52ebc2f94b9a2c844dd922cde87a93682854073a038ff82b3fb5f1310ed10e8bc8b0e19cee6c2d6461736f65 WHIRLPOOL d8d67012a916812a5a01e5749118851ed972fd0a82fdd92a776504ae1e86bec619c29e6cf672d99e94ac7e9f063174882e641a039fa5a67aba6638d966d79f82
EBUILD gitlab-ci-multi-runner-1.1.3.ebuild 2349 SHA256 6432c48b3a7a36c0b28ccab7fb79382061fa9296df9b6dc9ca32d4caa5f20702 SHA512 2a7674d506e79d8570fa8527dd10b87e775a75b4daf41458bcca28f5ad9863145571d4ebf9d9e0d9df015e48c89a7bd4a05d1bc7928223fdc2b7fd528d5282d8 WHIRLPOOL 6df8346401d631b58a3a6e1ce9f2c0e3e8b871e99880099463dcb9b5639d08b3725c7c83e7f96dfe7e8cba4e60abe77e2afbeb2c7ae8ec13cf02b05d1723fd9f
MISC metadata.xml 234 SHA256 f35b97f99a26d73cc441e1d93bfe25aaa4e9f7f6d90c8d05a74f7b7bc5b68472 SHA512 59d8156b3ca3e99c40d5a2a32de7edf2eb53279b2424998862589d6bad77617d23fc852afec0a92f8ac5bb54a88ebc504cc0641029c1936412e90ab03dfdd447 WHIRLPOOL 935a1401910a42f888c991e443a49275ea8b87976c5aa977f670053d97d18754231749749bc92d37d4b5f45ecf65914480942a11b5827b6c08fb24313a428431

View File

@ -1,100 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
inherit eutils user
DESCRIPTION="GitLab CI Multi Runner is the new build processor needed for GitLab CI >= 7.12"
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-ci-multi-runner"
SRC_URI="x86? ( https://${PN}-downloads.s3.amazonaws.com/v${PV}/binaries/${PN}-linux-386 -> ${P}-x86 )
amd64? ( https://${PN}-downloads.s3.amazonaws.com/v${PV}/binaries/${PN}-linux-amd64 -> ${P}-amd64 )
arm? ( https://${PN}-downloads.s3.amazonaws.com/v${PV}/binaries/${PN}-linux-arm -> ${P}-arm )"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm"
DEPEND="dev-vcs/git"
RDEPEND="${DEPEND}
net-libs/nodejs
virtual/mta"
MY_NAME="${PN}"
MY_USER="gitlab_ci_multi_runner"
DEST_DIR="/opt/${MY_NAME}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
RUN_DIR="/run/${MY_NAME}"
pkg_setup() {
enewgroup ${MY_USER}
enewuser ${MY_USER} -1 /bin/bash ${DEST_DIR} ${MY_USER}
}
src_unpack() {
local a="$(usev amd64)$(usev arm)$(usev x86)"
mkdir -p "${S}"
cp "${DISTDIR}/${P}-${a}" "${S}/${PN}"
}
src_prepare() {
chmod +x "${S}/${PN}"
}
src_compile() {
# nothing to compile, binary all-in-one goodness! (?)
:
}
src_install() {
local dest=${DEST_DIR}
local conf="/etc/gitlab-runner"
diropts -m755
dodir ${dest}
exeinto ${dest}
doexe "${S}/${PN}"
disopts -m750
dodir ${conf}
dosym ${conf} ${dest}/.gitlab-runner
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${conf}
## RC script ##
local rcscript="${MY_NAME}.init"
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}"
newconfd "${FILESDIR}/${MY_NAME}.conf" "${MY_NAME}"
}
pkg_postinst() {
elog
elog "If this is a fresh install of GitLab CI Multi Runner, please configure it"
elog "with the following command:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
}
pkg_config() {
einfo "You need to register the runner with your GitLab CI instance. Please"
einfo "Follow the instructions on"
einfo
einfo "https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/linux-manually.md"
einfo
einfo "Perhaps I'll improve the ebuild later ... kthxbye."
}

View File

@ -1,8 +1,6 @@
AUX gitlab-shell-2.0.0-config-paths.patch 1356 SHA256 442a8e18b4d8e6092db0d39659cba5e41404e90f21070ed50b5460177f28f1b2 SHA512 0445cd42086b2d77825c487d604ddcb11f8fdf4eb8dcdfa1fe1b8e8c24d7b8f273834dbec0bfbb763a35a74605d558cc8d3feaa056eb02a113d18124a764551e WHIRLPOOL 0e3367b229ea4f13818fe2e485dc8da83ad695aec496881cb5eb918b183029b0013518ca64acba1568d93dc418dfaf083c2a86b9f2e3adf9fe15cad038011b30
DIST gitlab-shell-2.6.10.tar.gz 35574 SHA256 c83f1cc9371f90fd0c9907c5cc7e64ba77dff228bb3d427afda999f583ba59a5 SHA512 f03b0d4b1e4b6f3e934acd29ca4e7fb478e7891e31d7fa8e6dfb7cb0d4b1dadd14a88254262d2e71691e01742610a86de1039fd738bde0ba05d6d19fe17fbf10 WHIRLPOOL 6c787b5bdfc6fa0e3ce66a4915d3737fa8fc1f47c1be44c0cecdda802e1bee1cf11f0154d6bb63e799458368bc71553f316024895b2465016d699f597cdfb851
DIST gitlab-shell-2.6.11.tar.gz 36109 SHA256 58a2b9f1816bed89e084242308901ab7e468ebc0b27c5917c7b33427a63bfc5a SHA512 a65124fe3d732e061cedc734bad346c583f39a213cf4367eda5614952b904b65e57936c0f17d67f1d96807dd4f29070f67eea4de5729c50deee49d1cb5a57fa5 WHIRLPOOL 6ffa9ad111c70270fba0ac71d03843ec956d3635e9f27ea16ec2b3b8c5a1a4baf73280aaaee91f5a5f6696a7dc696265b88c8c9d34ff0a9107a43b0507b32f23
DIST gitlab-shell-2.6.12.tar.gz 36201 SHA256 b8d88ffe414d9e61ad4fd3942d19675de03521ce32a56558fc860ac2840ff98e SHA512 b22af5983d2406834e486a784958eadef501020165d7f3c4162a248afa4b9a42ce8169e0a6c7fd35d9e5160a0634d01e3a44e3d3a4231918ddb1a308f2de0415 WHIRLPOOL c40325cbfeef2e06e3f3724d0bb8bad3fb7380079e7ea453b75826206c0d202f235c6dc02bfe7fd469f64cc72018c9de6620fbdca589f7b4ba6ee8c821031176
EBUILD gitlab-shell-2.6.10.ebuild 3516 SHA256 fbb3c7c08b5ebf3d4543701e9df739c22cc75c41932fa1dfbe3e691bcb97cd47 SHA512 8d40e7b6c83ee242dd21a176eb729e6d72fbc74c79ecad9c2e3f4df81022d9989044ee789364dece11eb4b2d07d3e60e5be8d8378dc0ad3751ed9cf78efa39f8 WHIRLPOOL d191fb8efe6ad3272e612032febed5104bc1fc12d075191ad4b7b6a36190e16ad4b09dcbb08a00cc0933890cd62d9d96facb2b9b5f2024d45f54587dc8e3ce0c
EBUILD gitlab-shell-2.6.11.ebuild 3516 SHA256 5ae386bd0f8960b1d068530a5b8502651c76cb43195502f76551a4249a510efc SHA512 ed9d009a894ee3ae2f1d140aec64f8c9ad4013178419f87f96e57f5cda4dbd7b099436568cf3d718d25753e405d859bb7bc8aea2c4683a14b024b942503eaa13 WHIRLPOOL b325873e31a1b5b8afaa4ba3678ae8435c20678b5ad720482283f48ba217f48cfe50c533b13c7e9bfb4e32719dc8155512d743b7f7db3dae6262e07612519331
DIST gitlab-shell-2.7.2.tar.gz 37901 SHA256 2cb4bac3d5888154f39a51b717ad2ae0795c6c59ecbc97deb9c94f51b1c9af27 SHA512 7b28d6593f8752e79f78f24c1be216eb94a5bed827e12ef96fe3f04f57e55e9eabfcf66259df8191d5eee7932a788d0f9f36e4d1658a296547c4c9021f6d7662 WHIRLPOOL c1211d5195e9c92325dc0cc706cbfad29f3df91ce63e8926bb91112846739f65249fcec511c54fc1c52cb8ac123f695010ffbc360e11c5ab7e289c93902cb2fe
EBUILD gitlab-shell-2.6.12.ebuild 3516 SHA256 5ae386bd0f8960b1d068530a5b8502651c76cb43195502f76551a4249a510efc SHA512 ed9d009a894ee3ae2f1d140aec64f8c9ad4013178419f87f96e57f5cda4dbd7b099436568cf3d718d25753e405d859bb7bc8aea2c4683a14b024b942503eaa13 WHIRLPOOL b325873e31a1b5b8afaa4ba3678ae8435c20678b5ad720482283f48ba217f48cfe50c533b13c7e9bfb4e32719dc8155512d743b7f7db3dae6262e07612519331
EBUILD gitlab-shell-2.7.2.ebuild 3516 SHA256 5ae386bd0f8960b1d068530a5b8502651c76cb43195502f76551a4249a510efc SHA512 ed9d009a894ee3ae2f1d140aec64f8c9ad4013178419f87f96e57f5cda4dbd7b099436568cf3d718d25753e405d859bb7bc8aea2c4683a14b024b942503eaa13 WHIRLPOOL b325873e31a1b5b8afaa4ba3678ae8435c20678b5ad720482283f48ba217f48cfe50c533b13c7e9bfb4e32719dc8155512d743b7f7db3dae6262e07612519331
MISC metadata.xml 234 SHA256 f35b97f99a26d73cc441e1d93bfe25aaa4e9f7f6d90c8d05a74f7b7bc5b68472 SHA512 59d8156b3ca3e99c40d5a2a32de7edf2eb53279b2424998862589d6bad77617d23fc852afec0a92f8ac5bb54a88ebc504cc0641029c1936412e90ab03dfdd447 WHIRLPOOL 935a1401910a42f888c991e443a49275ea8b87976c5aa977f670053d97d18754231749749bc92d37d4b5f45ecf65914480942a11b5827b6c08fb24313a428431

View File

@ -1,126 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
USE_RUBY="ruby20 ruby21"
inherit eutils ruby-ng user
DESCRIPTION="SSH access and repository management for GitLab"
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-shell"
SRC_URI="https://github.com/gitlabhq/gitlab-shell/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm ~arm64"
IUSE=""
DEPEND=""
RDEPEND="
>=dev-vcs/git-2.7.3
dev-db/redis
virtual/ssh"
ruby_add_bdepend "
virtual/ruby-ssl"
MERGE_TYPE="binary"
RUBY_PATCHES=(
"${PN}-2.0.0-config-paths.patch"
)
GIT_USER="git"
DEST_DIR="/usr/share/${PN}"
DATA_DIR="/var/lib/git"
LOGS_DIR="/var/log/gitlab"
CONF_FILE="/etc/gitlab-shell.yml"
pkg_setup() {
enewgroup ${GIT_USER}
enewuser ${GIT_USER} -1 /bin/bash ${DATA_DIR} "${GIT_USER}"
local git_shell=$(egetshell ${GIT_USER})
if [ ! ${git_shell} -ef '/bin/bash' ]; then
ewarn "User ${GIT_USER} already exists, but with the shell ${git_shell}."
ewarn "Changing shell to /bin/bash ..."
usermod -s /bin/bash ${GIT_USER} \
|| die "failed to change login shell for ${GIT_USER}"
fi
}
all_ruby_prepare() {
# fix paths
sed -i -E \
-e "s|/home/git|${DATA_DIR}|" \
-e "s|[\# ]*(log_file: ).*|\1\"${LOGS_DIR}/gitlab-shell.log\"|" \
config.yml.example || die "failed to filter config.yml.example"
sed -i \
-e "s|File\.join(ROOT_PATH, 'config.yml')|'${CONF_FILE}'|" \
lib/gitlab_config.rb || die "failed to filter gitlab_config.rb"
}
all_ruby_install() {
# install lib
insinto ${DEST_DIR}; doins -r lib LICENSE README.md VERSION
# install scripts
exeinto ${DEST_DIR}/bin; doexe bin/*
exeinto ${DEST_DIR}/hooks; doexe hooks/*
exeinto ${DEST_DIR}/support; doexe support/*
# create symlinks to bin
local name; for name in $(basename -a bin/gitlab-*); do
dosym "${DEST_DIR}/bin/${name}" "/usr/bin/${name}"
done
insinto $(dirname ${CONF_FILE})
newins config.yml.example $(basename ${CONF_FILE})
# create symlink for .gitlab_shell_secret
einfo "creating symlink for .gitlab_shell_secret"
TOKEN_FILE="${DEST_DIR}/.gitlab_shell_secret"
dosym /opt/gitlab/.gitlab_shell_secret "$TOKEN_FILE"
# prepare directories
diropts -m750; dodir ${DATA_DIR}
diropts -m770; keepdir ${DATA_DIR}/repositories
diropts -m755; dodir ${LOGS_DIR}
# GitLab stupidly expects that gitlab-shell is in home of git user...
dosym ${DEST_DIR} ${DATA_DIR}/gitlab-shell
# fix permissions
fowners -R ${GIT_USER}:${GIT_USER} ${DATA_DIR} ${LOGS_DIR}
}
pkg_postinst() {
# check git home directory
local git_home=$(egethome ${GIT_USER})
if [ ! "${git_home}" -ef ${DATA_DIR} ]; then
ewarn "An authorized_keys is configured to be inside ${DATA_DIR}/.ssh,"
ewarn "but HOME of ${GIT_USER} user is located in ${git_home}. You must"
ewarn "either change the authorized_keys location in ${CONF_FILE},"
ewarn "or change home directory of ${GIT_USER} user to ${DATA_DIR}"
ewarn "and move ${git_home}/.ssh here."
ewarn
fi
local auth_dir="${git_home}/.ssh"
elog "Initializing authorized_keys file in ${auth_dir}"
mkdir -p ${auth_dir}
touch ${auth_dir}/authorized_keys
chmod -R u=rwX,go=- ${auth_dir}
chown -R ${GIT_USER}:${GIT_USER} ${auth_dir}
elog
elog "GitLab Shell was initialized. Repositories are located in"
elog "${DATA_DIR}/repositories, scripts in ${DEST_DIR}/bin."
elog "All gitlab-* scripts was symlinked to /usr/bin to be on your path."
elog
elog "You should change your gitlab_url in: ${CONF_FILE}."
}

View File

@ -2,8 +2,6 @@ AUX fix-Makefile-0.6.5.patch 377 SHA256 e96f13b11f1e05042542dd9bbf507954634b2367
AUX fix-Makefile-0.7.1.patch 377 SHA256 10fa5bfbf9d61de4f07d0f117a0d2e2498f97b7a23a04f37e0a0bcfdf87c69c1 SHA512 c25175937b18a153f63990d37fb3161aa55428df3f7f3d9e1bc22836c055511cee649a998239c9765adbc1273ba8059ac2b1b1e2b3c4d016d762ccb78834a5bf WHIRLPOOL 85ecc6518b540a8cee0189e67c0cf3b67ca1943e4ed3433ea6827fe37fda11d1ac741b142d7d43ccc2afe5d4b85b6a02b9c603c21bc4df1b107e4a411cafc898
AUX gitlab-workhorse.conf 248 SHA256 6d11d63aa869cfd8c6f77c3a875984c226db633be899ad7ce97fafe94236eee7 SHA512 234213c8361702bdfeea40bd306b5899de19f34ce985e090a86e01aa601cf4ed23da4dfb75f74fe5986bbea5535a7a6a745406b4f67f79d352bd1c863777c7f1 WHIRLPOOL 8ac1134cde3aee942466d206e703ebd5330f83537d7e29641447f812d857bcc57b07fbf82eab086c0d622750694f64fabf8ffca2ba26a725f61b40fd1941e963
AUX gitlab-workhorse.init 653 SHA256 f38c37ed818cb8c25fb800bfcb5448f659e876b78ea33ea7a1ba3c80e73ea95e SHA512 2667997def39e6dc17e6a1d9be06d6e855d5d3e956e64d93bb3e74bbad0a1d427dc034f9c139f3b05e2666abab014404b2c8013c5347f4ec25fbf5ef86e7e88e WHIRLPOOL 63cd7ff80d88676b44c2d6ccdadf74907d5f8e4268f03ee11775c423bf95955f9d3aaeedd79fa6e0486b2d225336eb2ffa165dd7b9ac87ed0c2d403dc7e5afb4
DIST gitlab-workhorse-0.6.5.tar.bz2 26694 SHA256 89deb66ea0a0e4ce80d933ef18778eb28a37bc7f427188313db8f50cf5c78172 SHA512 ac7475f7557dce4807bdc74f0d5c873d0bc602ded7df8a88a3a453ef4814ba493b539faddec13e771dabade8919079597c7147f13c3d6b9a3606b52a7b3536ae WHIRLPOOL d059a346f594bb623ec5bd7aa90660326ac2c36d07536ef43939a38d2d19afb0126e10bced5486a44ac652ace4de95880e84963ab45f0603d8049c106664395e
DIST gitlab-workhorse-0.7.1.tar.bz2 26792 SHA256 3f00a7813d84a86980d739fad30e527257ff186fd0e3df069d42760b6b056ae7 SHA512 7d9a02a37a6e4612c07a7ced022151a19d783e902fa21bd1a401066101ff07e61ed281217bf01bd7f51ae5cd329eea212ebff1c01d30e80d52d4a8b71bb94eb3 WHIRLPOOL edf291bbf981b58543169c839b449e92b95ecfda0be127429c6490981380e00e1cefc0a0684dc38dbe9f573e93e37f51f0d4b5385418b10af16a5a12c77f9b80
EBUILD gitlab-workhorse-0.6.5.ebuild 878 SHA256 2fc488ef3b608ffca8c1f78dec86ecfdb4da47dfec806d8b8be6d093759d8e98 SHA512 8274571754abae349a7f8f9761559d00981e9445f074e296b7989ee593def4347ffe9b2e0c866703033cd794a1c24bfeb02f6ec80c262d0f25dbca21dd3786ff WHIRLPOOL b25e5430f51a8b1467188736e054e47429ea63ac7851819b65de94a47f66312979958cb2e540c990d640ef767a8a1bb7e5f5f4478ae3638eb7bb4e1c67fc5f13
EBUILD gitlab-workhorse-0.7.1.ebuild 854 SHA256 c9e78983856490f7b638453356da30d6396f96ea3960f990e9cbb5dbef249eef SHA512 3c490abda76ed861ac7c126a656b91c4dac72f70ac99688865ec8a90a5aabb34f6d767899445510b9bbbc4edd30ba6b756668bb8d7c529dc000ba7fd570801e1 WHIRLPOOL e03f624cb7eceb56d45e638f772b935086bda3c21ec9e7e804aaf2449a2f6546da6d3143fe8499343b0fa7dc489a9413f1720a757d09e0803d8105af34116151
MISC metadata.xml 234 SHA256 f35b97f99a26d73cc441e1d93bfe25aaa4e9f7f6d90c8d05a74f7b7bc5b68472 SHA512 59d8156b3ca3e99c40d5a2a32de7edf2eb53279b2424998862589d6bad77617d23fc852afec0a92f8ac5bb54a88ebc504cc0641029c1936412e90ab03dfdd447 WHIRLPOOL 935a1401910a42f888c991e443a49275ea8b87976c5aa977f670053d97d18754231749749bc92d37d4b5f45ecf65914480942a11b5827b6c08fb24313a428431

View File

@ -1,38 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
inherit eutils user
DESCRIPTION="This is the new backend for Git-over-HTTP communication needed for GitLab >= 8.4"
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-workhorse"
SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.bz2?ref=${PV} -> ${P}.tar.bz2"
S="${WORKDIR}/${P}-8a339b468723d371ab408b528c5882481247f75e"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm ~arm64"
DEPEND=">=dev-lang/go-1.5.1
!dev-vcs/gitlab-git-http-server"
src_prepare() {
epatch "${FILESDIR}/fix-Makefile-${PV}.patch"
}
src_install() {
local dest=/usr/bin
diropts -m755
dodir ${dest}
exeinto ${dest}
doexe "${S}/${PN}"
## RC script ##
newinitd "${FILESDIR}/${PN}.init" "${PN}"
newconfd "${FILESDIR}/${PN}.conf" "${PN}"
}

View File

@ -7,17 +7,9 @@ AUX gitlab-unicorn.init 2553 SHA256 9f6d3276d52589a5224c1a9b5a117a0d5d3e83317d75
AUX gitlab-unicorn.service 773 SHA256 010c9e223a30400d9155b39499eb0d7efad23b66baab9fcd9e365c689086b9bd SHA512 0bf9630aa91ed8f590a7bfa42d09b7ba33f6342b43b3d191c792c11157f8926c2a2ac2390eebd8179637e29b5bf68233d4699d62463497a0fd45b9bdbdd9167b WHIRLPOOL fbc709a5550dcc548a35c22c812dafe52ee507f5678b57c22c709ee89a399ae9109e2f56b7a13135d4140f1e024ebc4effe4aa4de13e0f36691da2a0737d9792
AUX gitlab-workhorse.service 930 SHA256 09348a52fec333b4b19828752e0484400c1efa9dfb644723fcf8e80537e294b6 SHA512 6332024fe0049287899cf482b6e4439e9dd90da14e489d08aa8e5e79cb7872efcc517d99b69fa23b011b382acb1e5926496a78f08af5d2d64daa515b869a0c6a WHIRLPOOL 3749c6719b2a35c7de29763cd616e1e9cc30a85aa1630ffc46440334459b5922503d52629556c125a6dd6574bdc5f23f1b2a7f2a85e2270a415b22246e0b6bae
AUX gitlab.conf 27 SHA256 cd9be088bbb67a5400407fc6f63c061eb224f16748b7d0812ff2c101f43ca263 SHA512 909c49fee6d050c1e94b2559ff2a9d54c5c346492be0e2920b50d56d69eaddbed67e3ac12e012d2a9601b5596640ebf33c8dc68fc588a03ca370d963294be37f WHIRLPOOL fa436e8d7d2643d450259d26b6e7b24dae69df47ed22e5ef2a567f37aa785fbf3b0eb1129ae7c8bf8986c29559fc3b744a34064375e5245dce2b10053cd715d9
DIST gitlab-ce-8.5.8.tar.gz 15180480 SHA256 dd531c7b62a6b3b2377ec79f0735f83cdb379868f4ae24befd10f13797a80c7e SHA512 8a44c8c1dd13a8ba8452cdaef68978a2557f7c47cbeab37fb67c3616ec041b50bf2b02ece8e4c66222b4f705b59ad80c9ee46284f03d6adffc193d3eb9e74d38 WHIRLPOOL 710d11dd0c309a29e241989be310c82786b89b66f73e0e8d9431c6b3bbe161f725fad209c8cfd3f5cbcff91920c94ec857fb54b2ce4fc46c3ffe337935232e14
DIST gitlab-ce-8.6.1.tar.gz 16086639 SHA256 ee0c9695ae3a58d186385b9295ed6be08ea03b94fd4fe1c1716ede0ab72052c8 SHA512 198ee12fbc0405014ca366ec4aac156aaabf09d8a284317a6f72930d3dc572da9d04556c1d512728549e5e7f4411b06c783ff7a85c4df64db514ed5ad7399e95 WHIRLPOOL 8909577f7d08aef1841663959fa2dc43d8cceb46f14e48cd1f89cc88a30547915516ab2f58260674ce94eb21b762f970d8b9eaf414abd864abde12d67f2f677b
DIST gitlab-ce-8.6.2.tar.gz 16087287 SHA256 151ff8aef86d028a99405e41d0d420bcd5cd040ac1fc3e1ce11253633ec393aa SHA512 010435d69dbb14fc5e19a28ef69e0f4a770ffff2d25b0616902e9819238dd18e92bc813455f0f72570cadf12342bc8c1f93432c54152c5ecb166c01dc51bba0c WHIRLPOOL 674adba03d3c42a44b07d6477e74c2c2d74231a18a923f13a8f844f3180a12a55533c102b273e46b3585ebdbca7caab1cdec65c11866f0bac74d10169cef96ef
DIST gitlab-ce-8.6.3.tar.gz 16089181 SHA256 21cee7d5dab49dd30832cc099983ffdd6097e708bfa4dec830b8f8b8258b1124 SHA512 d878d7706de91697917099dcdc98bf60961b0efa452f94ddf55f26bed93b0c02c685adf0d82ecb3bb53809183235522096194edb0140c19d61f3640b7c9fe98b WHIRLPOOL fce0e27a3b9751510e3980dcf62edbd2ce5b387e92b5d165667934b349643a4a80e46e7212c2c6a6a49e60da53bd50611d8c058075427777d7bf19f458734a32
DIST gitlab-ce-8.6.4.tar.gz 16089016 SHA256 e96547444afcb5719f6b84d4ac0b0c09bfb68f8d8d4de7de50790838ad8a9036 SHA512 90994db9dc550d2c161d934926c27ef5c2022c610d416d717df4bc133fceb86cc75bba42ce8aad439d661058c1cee700c9867973e339d14522086a4ae3285818 WHIRLPOOL 7ca83a7debb77135d28772187dcdf6b86ccd020b4a3843964104c5536fa77a14e238c6786c7300918dcfd4719f9100f019a4f69892b17e797ceaf0af891a2d76
DIST gitlab-ce-8.6.6.tar.gz 16092738 SHA256 f133304669238c339bd6e112371e8c50c54c1e7459685c2ff316bf5f7e10958b SHA512 cbf1601e7c16f8154f6d86134d7cc8e80644d28872e81e9e15d039222dc17e544cc0c15b932fd9ad402e3e5919b0f74154cde0b4bd675e070c36de20fa515aa8 WHIRLPOOL a39ea8e31585081420938102a0ba8f89ba0e68ca1c6dd40714bca43a0245846922f7cd47c70c149cd95e6229d0150aa76ddaac467c9308b62d2f7428baa9311c
EBUILD gitlab-ce-8.5.8.ebuild 11796 SHA256 001317396732b276ee64682501b4d7a48a2710a14841f17f0721a43fe6ab6b50 SHA512 4fd18be998439a20b34239666edf25c3d25f0d84eca457c9f2f954966150fb916cb2690cc43b5a954875bf90b6aa578fd6ecfbe2c888c11e5ea82668ae04ef86 WHIRLPOOL c38f4d2d44fbc7944e872f4a2a06f0dbd2f4f712fc495e7e195a36e7d1f8d698c2645b3fa87287237e2debeaee5a1cc69a854b7ff0ff636a2166d0f0ea512f61
EBUILD gitlab-ce-8.6.1.ebuild 12332 SHA256 b87197de266e563287f5750aa65bd7c6ae945c90621d89851d563189f516ae6d SHA512 832e60f771e5476e7d8ca3d604161d37bb3559cf6755386a459ff1e5e3c7832f719411e0472c647cc2f68b55c4f9057acba24b9b3d5a4a34f28c1f05f42c312c WHIRLPOOL 870736d44f6f94050bd6f3453a069da0af4a51d6ac3dcac3bfd9a9e771bebe9bdd84cf17774add3d89684af4367151c07342794885484d4c4c09c2d0695b8959
EBUILD gitlab-ce-8.6.2.ebuild 12332 SHA256 b87197de266e563287f5750aa65bd7c6ae945c90621d89851d563189f516ae6d SHA512 832e60f771e5476e7d8ca3d604161d37bb3559cf6755386a459ff1e5e3c7832f719411e0472c647cc2f68b55c4f9057acba24b9b3d5a4a34f28c1f05f42c312c WHIRLPOOL 870736d44f6f94050bd6f3453a069da0af4a51d6ac3dcac3bfd9a9e771bebe9bdd84cf17774add3d89684af4367151c07342794885484d4c4c09c2d0695b8959
EBUILD gitlab-ce-8.6.3.ebuild 12332 SHA256 d604c907120b37873c20f2e20e603f27e36edd729e1addf7a773d15cc3ad509c SHA512 a613ba77d75f6964e8c8c0fff6c45eef52874dfbed5303004cfc5ecb697134f16aa57f8a29ad0ae46a74035fde4a3de19122af16013db2a9da29cb6b92c82b20 WHIRLPOOL fca18db3b2bc1f5b9e1835555b1766f15142a070374d533e8383c206b4c424568b80bba1b27cf91a6814b4bf287be2c6cdbdadb474770efc396bbdac801089fe
EBUILD gitlab-ce-8.6.4.ebuild 12332 SHA256 d604c907120b37873c20f2e20e603f27e36edd729e1addf7a773d15cc3ad509c SHA512 a613ba77d75f6964e8c8c0fff6c45eef52874dfbed5303004cfc5ecb697134f16aa57f8a29ad0ae46a74035fde4a3de19122af16013db2a9da29cb6b92c82b20 WHIRLPOOL fca18db3b2bc1f5b9e1835555b1766f15142a070374d533e8383c206b4c424568b80bba1b27cf91a6814b4bf287be2c6cdbdadb474770efc396bbdac801089fe
DIST gitlab-ce-8.6.7.tar.gz 16091899 SHA256 2771c5eac15e035eb50bd19da7cdd926499faeaec670827324a1e0f13a8d7e68 SHA512 c6dc93b94fa78f80a66f3f9308f97ded5aa7ae55c82c477573537fd73dd57934b30d477e8f245affef4bafd809b1f3a94c837e3e1c64948cbee03a7c334766cb WHIRLPOOL 6fb2b84545d171f637740c6cc27eddb667afc55690ea735ab330f202e971014de8abffcabe7c60e7072f303a08d3685bfd9c217035482303111e57a94006285d
EBUILD gitlab-ce-8.6.6.ebuild 12332 SHA256 d604c907120b37873c20f2e20e603f27e36edd729e1addf7a773d15cc3ad509c SHA512 a613ba77d75f6964e8c8c0fff6c45eef52874dfbed5303004cfc5ecb697134f16aa57f8a29ad0ae46a74035fde4a3de19122af16013db2a9da29cb6b92c82b20 WHIRLPOOL fca18db3b2bc1f5b9e1835555b1766f15142a070374d533e8383c206b4c424568b80bba1b27cf91a6814b4bf287be2c6cdbdadb474770efc396bbdac801089fe
EBUILD gitlab-ce-9999.ebuild 12336 SHA256 d0eb30c1431baa20639f4b9ecc91ae405da451355bd8d7b610471b2d3596e5d8 SHA512 7a0d30e29068c1ba6b6571d8e28adf75d7b1d559d7eabcec93c24b15fe83c4aadf17f978d48af36534d9594231285635bf6d1fc890ff76a8cda3976c74787cf5 WHIRLPOOL 694871271b4db92cd2802071237131bb20ffc5d2a9b13027576fba21ae0200e9cdc42ba10c25f38ce12239ef038804faba177b3e5c334b44f5fda82196eefd15
EBUILD gitlab-ce-8.6.7.ebuild 12332 SHA256 d604c907120b37873c20f2e20e603f27e36edd729e1addf7a773d15cc3ad509c SHA512 a613ba77d75f6964e8c8c0fff6c45eef52874dfbed5303004cfc5ecb697134f16aa57f8a29ad0ae46a74035fde4a3de19122af16013db2a9da29cb6b92c82b20 WHIRLPOOL fca18db3b2bc1f5b9e1835555b1766f15142a070374d533e8383c206b4c424568b80bba1b27cf91a6814b4bf287be2c6cdbdadb474770efc396bbdac801089fe
EBUILD gitlab-ce-9999.ebuild 12335 SHA256 bee9135491505bf8eca8e49d39639cfba124ea407266c7b59b442a287fcc1cf1 SHA512 e17c76f4c071b60f901e6b91d10c247d0def0420598949b16e4668a1e0756de2f0c1a60da0b73bdc3de30455a47f7bb54143ee25247862917cd7830ac678c88b WHIRLPOOL d0e2d60e581e9e79ec92279744ef4ccea4df211d8750b38218b7bc00d47a566bb0a2142e2b86db0a9aaace61e554a06e53140ccd5a151a07809469ef26ec7edb
MISC metadata.xml 545 SHA256 1b7fc44d811e1ab7638fe4a40253f49d5f1071872d3020c22c4f67662750cb2f SHA512 86f47d297892bccfefa087d93936296f5647993a9ec8e3f47907a6859cbf385e5bc6f00502d7836c9e8d9efef2b6725bf145b0150924c2082b2bd164469ef6ea WHIRLPOOL 6bfb8a55684d68c8bfa6e025a0be965f7b815394ee0896dd2a13cfb524e3cf3f3149acc9072897e30a1842060389576aac07ea8beb4a8b0bfc3e8eab3723f2a1

View File

@ -1,386 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
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="ruby21"
inherit eutils ruby-ng user systemd
MY_PKGNAME="gitlabhq"
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://about.gitlab.com/"
SRC_URI="https://github.com/${MY_PKGNAME}/${MY_PKGNAME}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RUBY_S="${MY_PKGNAME}-${PV}"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm ~arm64"
IUSE="kerberos mysql +postgres +unicorn systemd rugged_use_system_libraries"
## 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/ragel
net-libs/nodejs
postgres? ( >=dev-db/postgresql-9.1:* )
mysql? ( virtual/mysql )
kerberos? ( virtual/krb5 )"
CDEPEND="
dev-util/cmake
virtual/pkgconfig"
COMMON_DEPEND="
${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.6.10
>=dev-vcs/git-2.7.3
>=dev-vcs/gitlab-workhorse-0.6.5
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )"
DEPEND="
${CDEPEND}
${COMMON_DEPEND}"
RDEPEND="
${COMMON_DEPEND}
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-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,mailers,archive_repo,system_hook,project_web_hook,gitlab_shell,incoming_email,runner,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}
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 kerberos; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES"
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
rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git
# 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_dounit "${FILESDIR}/gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq.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 "If this is an update from a previous version, stop your GitLab"
elog "instance and issue the following command to perform all required"
elog "migrations:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog "PLEASE NOTE: It's HIGHLY recommended to backup your database"
elog "before running the config phase. Run these commands (as root):"
elog
elog " cd /opt/gitlab"
elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production"
elog
elog "If this was a fresh install, follow these steps:"
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 initialize the environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
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
elog
elog "If you want to make sure that the install/upgrade was successful, start"
elog "Gitlab now and then run these commands (as root):"
elog
elog " cd /opt/gitlab"
elog " sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production"
elog " sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production"
elog
}
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 $@"
}

View File

@ -1,399 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
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="ruby21"
inherit eutils ruby-ng user systemd
MY_PKGNAME="gitlabhq"
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://about.gitlab.com/"
SRC_URI="https://github.com/${MY_PKGNAME}/${MY_PKGNAME}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RUBY_S="${MY_PKGNAME}-${PV}"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm ~arm64"
IUSE="kerberos mysql +postgres +unicorn systemd rugged_use_system_libraries"
## 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/ragel
net-libs/nodejs
postgres? ( >=dev-db/postgresql-9.1:* )
mysql? ( virtual/mysql )
kerberos? ( virtual/krb5 )"
CDEPEND="
dev-util/cmake
virtual/pkgconfig"
COMMON_DEPEND="
${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.6.11
>=dev-vcs/git-2.7.4
>=dev-vcs/gitlab-workhorse-0.7.1
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )"
DEPEND="
${CDEPEND}
${COMMON_DEPEND}"
RDEPEND="
${COMMON_DEPEND}
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
# fix-redis-config-path:
# Point to the absolute location of redis_config.rb
#
RUBY_PATCHES=(
"${PN}-fix-sendmail-config.patch"
"${PN}-fix-redis-config-path.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,mailers,archive_repo,system_hook,project_web_hook,gitlab_shell,incoming_email,runner,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}
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 kerberos; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
einfo "Cleaning old gems ..."
${RUBY} /usr/bin/bundle clean
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git
# 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_dounit "${FILESDIR}/gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq.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 "If this is an update from a previous version, stop your GitLab"
elog "instance and issue the following command to perform all required"
elog "migrations:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog "PLEASE NOTE: It's HIGHLY recommended to backup your database"
elog "before running the config phase. Run these commands (as root):"
elog
elog " cd /opt/gitlab"
elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production"
elog
elog "If this was a fresh install, follow these steps:"
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 initialize the environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
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."
if use postgres; then
elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the"
elog "`pg_trgm` extension by running the following command as a PostgreSQL"
elog "super user for *every* GitLab database:"
elog " CREATE EXTENSION IF NOT EXISTS pg_trgm;"
elog "For details, see the documentation at the GitLab website."
fi
}
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
elog
elog "If you want to make sure that the install/upgrade was successful, start"
elog "Gitlab now and then run these commands (as root):"
elog
elog " cd /opt/gitlab"
elog " sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production"
elog " sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production"
elog
}
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 $@"
}

View File

@ -1,399 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
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="ruby21"
inherit eutils ruby-ng user systemd
MY_PKGNAME="gitlabhq"
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://about.gitlab.com/"
SRC_URI="https://github.com/${MY_PKGNAME}/${MY_PKGNAME}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RUBY_S="${MY_PKGNAME}-${PV}"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~arm ~arm64"
IUSE="kerberos mysql +postgres +unicorn systemd rugged_use_system_libraries"
## 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/ragel
net-libs/nodejs
postgres? ( >=dev-db/postgresql-9.1:* )
mysql? ( virtual/mysql )
kerberos? ( virtual/krb5 )"
CDEPEND="
dev-util/cmake
virtual/pkgconfig"
COMMON_DEPEND="
${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.6.12
>=dev-vcs/git-2.7.4
>=dev-vcs/gitlab-workhorse-0.7.1
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )"
DEPEND="
${CDEPEND}
${COMMON_DEPEND}"
RDEPEND="
${COMMON_DEPEND}
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
# fix-redis-config-path:
# Point to the absolute location of redis_config.rb
#
RUBY_PATCHES=(
"${PN}-fix-sendmail-config.patch"
"${PN}-fix-redis-config-path.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,mailers,archive_repo,system_hook,project_web_hook,gitlab_shell,incoming_email,runner,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}
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 kerberos; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
einfo "Cleaning old gems ..."
${RUBY} /usr/bin/bundle clean
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git
# 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_dounit "${FILESDIR}/gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq.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 "If this is an update from a previous version, stop your GitLab"
elog "instance and issue the following command to perform all required"
elog "migrations:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog "PLEASE NOTE: It's HIGHLY recommended to backup your database"
elog "before running the config phase. Run these commands (as root):"
elog
elog " cd /opt/gitlab"
elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production"
elog
elog "If this was a fresh install, follow these steps:"
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 initialize the environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
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."
if use postgres; then
elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the"
elog "`pg_trgm` extension by running the following command as a PostgreSQL"
elog "super user for *every* GitLab database:"
elog " CREATE EXTENSION IF NOT EXISTS pg_trgm;"
elog "For details, see the documentation at the GitLab website."
fi
}
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
elog
elog "If you want to make sure that the install/upgrade was successful, start"
elog "Gitlab now and then run these commands (as root):"
elog
elog " cd /opt/gitlab"
elog " sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production"
elog " sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production"
elog
}
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 $@"
}

View File

@ -53,7 +53,7 @@ CDEPEND="
virtual/pkgconfig"
COMMON_DEPEND="
${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.6.11
>=dev-vcs/gitlab-shell-2.7.2
>=dev-vcs/git-2.7.4
>=dev-vcs/gitlab-workhorse-0.7.1
kerberos? ( !app-crypt/heimdal )

View File

@ -52,7 +52,7 @@ CDEPEND="
virtual/pkgconfig"
COMMON_DEPEND="
${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.6.12
>=dev-vcs/gitlab-shell-2.7.2
>=dev-vcs/git-2.7.4
>=dev-vcs/gitlab-workhorse-0.7.1
kerberos? ( !app-crypt/heimdal )