From bb773afb9db0c10e04a2b2712169b135e3fa1b58 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 8 Jul 2017 17:23:38 +0200 Subject: [PATCH 1/3] dev-vcs/gitlab-shell: Add ebuild for gitlab-shell-5.1.1; dependency of gitlab-ce-9.3.5 Package-Manager: Portage-2.3.6, Repoman-2.3.1 --- dev-vcs/gitlab-shell/ChangeLog | 6 + dev-vcs/gitlab-shell/Manifest | 4 +- .../gitlab-shell/gitlab-shell-5.1.1.ebuild | 130 ++++++++++++++++++ 3 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 dev-vcs/gitlab-shell/gitlab-shell-5.1.1.ebuild diff --git a/dev-vcs/gitlab-shell/ChangeLog b/dev-vcs/gitlab-shell/ChangeLog index 80db4b2..0f332f2 100644 --- a/dev-vcs/gitlab-shell/ChangeLog +++ b/dev-vcs/gitlab-shell/ChangeLog @@ -1,3 +1,9 @@ +*gitlab-shell-5.1.1 (08 Jul 2017) + + 08 Jul 2017; Manuel Friedli +gitlab-shell-5.1.1.ebuild: + dev-vcs/gitlab-shell: Add ebuild for gitlab-shell-5.1.1; dependency of + gitlab-ce-9.3.5 + *gitlab-shell-5.0.5 (17 Jun 2017) 17 Jun 2017; Manuel Friedli +gitlab-shell-5.0.5.ebuild: diff --git a/dev-vcs/gitlab-shell/Manifest b/dev-vcs/gitlab-shell/Manifest index c70a294..5a0c5c4 100644 --- a/dev-vcs/gitlab-shell/Manifest +++ b/dev-vcs/gitlab-shell/Manifest @@ -5,11 +5,13 @@ DIST gitlab-shell-5.0.2.tar.gz 79009 SHA256 bb5125f12f2f3fbbb93aa78f6810cd62f97b DIST gitlab-shell-5.0.3.tar.gz 625499 SHA256 41d78fa416170dbf052c59223ae7c6a3b882f789c36ca932d2e36b610e8b0161 SHA512 55354926c4504d196ccf0f269ec93484a18f4915bfbe292c9dcfa43c33ff8310cf5c1d126943d6c7e54f3f77317d9229666887fb825de404b7be0dea24f49a64 WHIRLPOOL 80fe5dcbc00fc2460731dbf3c604ca1646e9be61d1d53c88a53d48d16f97e6ee032fe210bc7a04c4bac1b726542f0eb645c15ec186a1de16256605ff320fdc0b DIST gitlab-shell-5.0.4.tar.gz 626142 SHA256 9947c9cf7e7f2e1c2af696cf4610c6e2ad256dcae42e95cc0c8dc387ad5d07e3 SHA512 2718e99a43ad934dfb6d8b3df47bab0b957fa362c84510434fdd07ed994bf53ab059569ff0da106c8bd5ebc49cc460694ad5fb2fec57f0fb0cbb297609a00d97 WHIRLPOOL 6666d2dcb06c156686080b6a0f489ef03d331bc8f20eeb996fe5ce51aeb25d2f334002c15e235c1ad21d808eee8617aa178a5ad974ea99ec8f89bd2478f7f9eb DIST gitlab-shell-5.0.5.tar.gz 682091 SHA256 c1583e931280e93d59f86a571a628e697d8d073dbfbfd58fa957617581c4edae SHA512 8e22a2bed622c81976b827fac81ca94de7023d710160cb6daa24d24269b068292ee2e36a5917bb5399340661a28f6480ac40c0a5253f71bd36b8bd78a56c7380 WHIRLPOOL 76503debe3baeded25067b6fcc1c9b5f103a7fb21035521bc3ab8b89547a566b557f38c073deb7d8a0867f1225edfe4d5587d14570ca2889812d3da73b4bf5c9 +DIST gitlab-shell-5.1.1.tar.gz 688960 SHA256 33a4b79b0b06ad935a4bcf1ad41ab88882eb31b349cca007f1e60f3eb5826a06 SHA512 a247e37bfd7b8fe28fe68f3b9d401ccfe534bd4221bce2cda092f6a72a6926f49944f4a008c71636426ca1f7ae6033f53035bc10a8d8121c8093e09abfc675f4 WHIRLPOOL 29aaa30c73997a28cdb68485087a36c6c8109b9f909e2776899f1094a17dcbc6189ed759f9acc81caa6cda516b44f89ad36567bd9f96ec6802e4553182607e20 EBUILD gitlab-shell-4.1.1.ebuild 3653 SHA256 06702f4658b8ac1bada6b322b833f65270656730417d8c9bb000ab1fb23af8f0 SHA512 dc63160d98dabfcbaa9982fe841fd581a1b1b2a968e7c7bd1ee336e449214fa89da33477f0d4744941ee3ecb8688386883a5923e78025bdcfd1556e68ea7371c WHIRLPOOL cd59e133d1d02f082f10312b358c6c8718898aa008a967fc85934656500ceefc44a6affae286123c481aa902fa51cdb7e7f98788057fdd08304ed99f643ef27c EBUILD gitlab-shell-5.0.0.ebuild 3653 SHA256 47e19d88939c146c5a7826ca538dba2caee3bc32944eab5b80d54ddbd4c196fc SHA512 1765624d95c14e2888f3e12be05ee727bae036265fc3c9bcfe17b509c0656de72728dcb580952d2a666b3fc99c3640f43862a9ea449599aeaa7cdb2509406347 WHIRLPOOL 2b935404098f288e729c3957007cc663afc3e76a4e04f536d5c7373cbae6857abb5a5cbd2d226355777e4af954a032e9b17211657d83a71bd2eef847028aea64 EBUILD gitlab-shell-5.0.2.ebuild 3653 SHA256 9ed7d4b6dc1ca2d6ee0c928cfd9f33da45a09a070f781d33f217a4dc80296c5a SHA512 571e8c8cd6782f7d955d8d7ff481424c8aa2bea6ab2d702036f991065f75d8e08f26b1004a91a88e2a6add8d64018cec3bb7de131635b264ad7990c392467e1c WHIRLPOOL 491af5dd4248e2728048e51d21a12768966201a93731df7743baa24ccde12228c15c9288be7cefb9b29f3ed83f27729a6f1146506365ef14d3d516b7acaf6862 EBUILD gitlab-shell-5.0.3.ebuild 3653 SHA256 e2c2cfb805378a6cd7e87d536a43c1d96ae489ce66b8168e6cbc42b703736c0e SHA512 65093fb42096002f2f715b18561f11cfb8afbc36188514a2d95023be53025946928e4e712d03d470d0bf52e6d0ecf8d0438b29cd5c55e162d85a15963e430b48 WHIRLPOOL 3278d0eea3f614f726d0df8d0e6a2f49c1e9d4341829f65fc29aa94544470b5b36ee7ce0d464af2b3b535f3f2f10c16c11d3c39dc87c34f9fbb693f61e9ffa3b EBUILD gitlab-shell-5.0.4.ebuild 3653 SHA256 c3e2b2dbb4c6b29bf46442791caee2116be2c698a9cbec9d91ac58b1a5d98adb SHA512 035508013085da402a5926faa5da6b6ac6ac726169122766e381096b316b13e887e99f178a8980d831d0a788549e26b07bdae284bc3a90b3a21b534071239581 WHIRLPOOL 807caff4227ea9fdb853a0e5622dea4d4e8b66c3c8dd86d98aedc14f20f00eeabdc1620ffded43cdb4c6b4009e96528bf1dae784256e40f034cd78d6460348b5 EBUILD gitlab-shell-5.0.5.ebuild 3646 SHA256 aad0fca138202ef4f5e7885bf3edbe78fb0e524b263b7e770d4051b28e1cd5b1 SHA512 280fd3dc3da459882344eeebf8937fec8eedf50580b1a1fd1759d9e61e85b418407d6a7264acca8926201e1b29dc401f1226d7dd0496a26783c6ec09b7a97e68 WHIRLPOOL 1590459dfce361c2d049f431fee9b6cff435ac06ba1a126fb76688c4d4e7100b848e9e1875d18620ff0036b58afe78a743ac55793f79ca9c6bb1dca231ba7b03 -MISC ChangeLog 3126 SHA256 ff668f4ed3220cad60a61dcb32c09e134688774cad1fbf04793ab2e81bf38569 SHA512 35111c684523665a3da284320b1bd5012a36129bc1bd0fc3ebdd1561a130664196c80fac4302b14278dd29d982cc3d58aaab2c405d645b93c4e92a563d129746 WHIRLPOOL b955900f481159356154667945a3fa8f9dc738a4360ea348fe5087aa6ddba308a8a70968adcad670cff5f2bdb9a8b46ec2c1f823f200eac720c0387ed1d4c501 +EBUILD gitlab-shell-5.1.1.ebuild 3646 SHA256 137913363961638e2ef0178f5a4f024cec0e3f44b5c48fa1e1e9cc77bc1e93e0 SHA512 8995e8250f592bf11ff73e24bcef4beb74faf8932729f4702be237810f9ca320c56c9d1abead8c147099b894f0af22242bfcfaf6343367d7ed7baeb80abacba3 WHIRLPOOL f2974dd7604f6142caf75e23a625f77acba2e5928b8e4a96d6e1f10157d66ad013b85a45b1cdc58b1ab55765adc889545e4482d6a3d1163f112161f102171b4f +MISC ChangeLog 3333 SHA256 8b9d10449391567a3d4bc9cda46281ab816f158c5a42e13a1282186dce2aab8d SHA512 358944659e77ccbb768bf32573ab1c66b152fa096791f07bf192cddf575f255a1dcc8d196cffeb09d94129bdd1ade7bd4ba035d3ca443e464e6c37915eac7354 WHIRLPOOL a5b9bb8773cafbb8213c323e5a8e8c8b403130de77cefe5418c956e85c84334d51ce157fd93af32b8da41971a0752bfe259996fce933d60bbe74a3c740556d7f MISC metadata.xml 248 SHA256 7b43be15755627edf5c12cf1b50c607d781558640bf8375d685d51d7ade99a32 SHA512 29f9b96b0a77546cce6a8bffd82fae2fd0939d32a7a05ffd0d91f9250a019a3ddaa599b93988c82daabb9c4c4b284dd947e2c47f6ca7727b8539cffa91bcb8c2 WHIRLPOOL 993013c9878ead35469db13d3072f694a341ee654182e0c31d0678f5dd6de4bdc8d59a0b7bb6d685dc41ea6b55dac518cd8034131baea8002170c680e50304d1 diff --git a/dev-vcs/gitlab-shell/gitlab-shell-5.1.1.ebuild b/dev-vcs/gitlab-shell/gitlab-shell-5.1.1.ebuild new file mode 100644 index 0000000..00bf537 --- /dev/null +++ b/dev-vcs/gitlab-shell/gitlab-shell-5.1.1.ebuild @@ -0,0 +1,130 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="5" + +USE_RUBY="ruby23" + +inherit eutils ruby-ng user + +MY_PV="v${PV/_/-}" +MY_GIT_COMMIT="0a64624152735766c428d1532e434dd0bf5a9748" + +DESCRIPTION="SSH access and repository management for GitLab" +HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-shell" +SRC_URI="https://gitlab.com/gitlab-org/gitlab-shell/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz" +RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~arm ~arm64" +IUSE="" + +DEPEND="" +RDEPEND=" + >=dev-vcs/git-2.7.4 + dev-db/redis + virtual/ssh" +ruby_add_bdepend " + virtual/ruby-ssl" + +MERGE_TYPE="binary" + +RUBY_PATCHES=( + "${PN}-4.1.1-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}." +} From 8efa7d7d6fab78bbd3fac27bdfe1b754c96c3287 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 8 Jul 2017 17:26:02 +0200 Subject: [PATCH 2/3] www-servers/gitlab-gitaly: Update ebuild for gitlab-gitaly-0.11.2 in preparation of the addition of gitlab-ce-9.3.5 Package-Manager: Portage-2.3.6, Repoman-2.3.1 --- www-servers/gitlab-gitaly/ChangeLog | 7 +++++++ www-servers/gitlab-gitaly/Manifest | 8 ++++--- ...italy-0.11.2-fix-config.toml.example.patch | 21 +++++++++++++++++++ .../files/gitlab-gitaly-0.11.2.conf | 8 +++++++ ...11.2-r1.init => gitlab-gitaly-0.11.2.init} | 2 +- .../gitlab-gitaly-0.11.2-r1.ebuild | 6 +++--- 6 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 www-servers/gitlab-gitaly/files/0002-gitlab-gitaly-0.11.2-fix-config.toml.example.patch create mode 100644 www-servers/gitlab-gitaly/files/gitlab-gitaly-0.11.2.conf rename www-servers/gitlab-gitaly/files/{gitlab-gitaly-0.11.2-r1.init => gitlab-gitaly-0.11.2.init} (89%) diff --git a/www-servers/gitlab-gitaly/ChangeLog b/www-servers/gitlab-gitaly/ChangeLog index bc3b298..3893e66 100644 --- a/www-servers/gitlab-gitaly/ChangeLog +++ b/www-servers/gitlab-gitaly/ChangeLog @@ -1,3 +1,10 @@ + 08 Jul 2017; Manuel Friedli + +files/0002-gitlab-gitaly-0.11.2-fix-config.toml.example.patch, + +files/gitlab-gitaly-0.11.2.conf, +files/gitlab-gitaly-0.11.2.init, + -files/gitlab-gitaly-0.11.2-r1.init, gitlab-gitaly-0.11.2-r1.ebuild: + www-servers/gitlab-gitaly: Update ebuild for gitlab-gitaly-0.11.2 in + preparation of the addition of gitlab-ce-9.3.5 + 08 Jul 2017; Manuel Friedli files/gitlab-gitaly-0.11.2-r1.init: www-servers/gitlab-gitaly: Fix silly, *silly* typo. diff --git a/www-servers/gitlab-gitaly/Manifest b/www-servers/gitlab-gitaly/Manifest index a446b23..ef2c976 100644 --- a/www-servers/gitlab-gitaly/Manifest +++ b/www-servers/gitlab-gitaly/Manifest @@ -1,16 +1,18 @@ AUX 0001-gitlab-gitaly-0.10.0-fix-Makefile.patch 248 SHA256 03b4315da76b4409e990a53edce0cb21828a4c505f11266ca3f77e70e7c9857e SHA512 7aa509cf79a538398e9dc09cf92e34d6a8877da13ad1184e37f5e7ba4c24eb88251f692ebefddd07e3bf157a143d93dffb72ccbdfdd5ab4d52bbcd111e6e9380 WHIRLPOOL a03702f7d744239869249f53c49cfb3f62cbb58f75bc624079aced8219fa3d818d6eee9233953483c48a2138399442b7a89ca4ef1d93b96767e8d471dc5db00e AUX 0002-gitlab-gitaly-0.10.0-fix-config.toml.example.patch 692 SHA256 5f9eda6f748a7622671a41632614e035267520388af90b9c9bddefa2731652f6 SHA512 942c2e012d013d5eca80a679a1ecaf035c1d6b93251c827cf75b31edc5c9e211edf78d41a1148b84142338ae3f19fdd5673b207f18659acfc78982a0a6d4f253 WHIRLPOOL ff414bbfcb1fb6eaae5bc8e5d41cc27e0e93a1b216842d47570f8725988b594ad236c2d33ed8075ecd24f2939c46a2bdb5f77744ed26ab5bd2afcd0a9a93201d +AUX 0002-gitlab-gitaly-0.11.2-fix-config.toml.example.patch 700 SHA256 7f5c3f840581c2c2e98741ad6fcb9b486948dbcd80f52f4c45538b9fe9009087 SHA512 e89636c4e38697fad62553e8b07677fdc0fef5b83249ce79f748e1da7300c28514cdbf7a182232ced95222c9578cc9028de5e039b82f31175c22d840c83c0286 WHIRLPOOL 2b9c2b2b96da648b5f71a4ee8940c2a0a148e9005178e012afc73dd7709a5c407e04240adfb96a4ea3d2384248a23682a8d5727c967ddd5368f0d2d3b38d24e5 AUX gitlab-gitaly-0.10.0.conf 281 SHA256 54a309ecd95a0c907951a36db5542678f9e68c7e354dcc3278882512a82c5a99 SHA512 23875632a1c523eea855c10b03dab4a2aa38cc8de6be070df4ba8c85360edf8c5c2a636601f05004f62792c9e4304822c679841180b9a23c963de76a7c770873 WHIRLPOOL fac7949ddc161d2df6d4f0168029c405a0b68f64fee9cedf167bdab9ea55de1e52735476402e878f67339f969e40bd341cd21f31c99dd86d997df08a3ce8f217 AUX gitlab-gitaly-0.10.0.init 592 SHA256 31889dd48b19bd84aaeb64f943ea9ff173b7a2291b3f0dd465c08256d2aee9ee SHA512 81db4434946691a714945e2fab06e302c0994805b4b285e916363461160b30c919e9373d10e293eb2163dc46f132d1c6f4a5c9ab50cad3933827833d48a2832b WHIRLPOOL 1d7287c5dd41a8c63070467640bcf6f5c5fd66a03e7a75ddc000ab67860dd1f76098a78edc36af64ebd34deda103f2284bebcb153906a79310ac9808cfe75a76 -AUX gitlab-gitaly-0.11.2-r1.init 631 SHA256 98c1b8db2fd54d968b58a1c5a766090e85010b2da3af22232adcb16743f46207 SHA512 b018e11b2177f4869aa5bc87c92669d312a25d1619addd134f022a33afba7867bfd21096dec74d435bf41c0eefa5d539d39d6b6ad3322125b9f4ec72be70b07c WHIRLPOOL 42f42c9d37eb5ea9dc0fd5116caec9ca6b7d4389a42a5ca5cc8399e4b9e02c80b4bd97462fb0b4dc5f26b9733a8f3cab4d6c6ef7a9dfba5121b8f8191322e9cd +AUX gitlab-gitaly-0.11.2.conf 289 SHA256 da2640e0ac6a3f356d68f2825c78a1965703df292cd6631b2e884e1a9c7ecc87 SHA512 86f2b4dd283de117c3a371a98a1472d248a21a2c931be6644bec2406249e000fe2e55d031b523d6e64fa2eaa3addad27704f338f65cad6b559680c5c327b9614 WHIRLPOOL 18cb38b35c9a79c6eaaa15ed9bbbeb6dc502a0291f3bff2bf1f59a950556c4c3fd3742a4097ab784c1e9a12d2209b336f2bf688b0888e13bb1b7f78219bb6d87 +AUX gitlab-gitaly-0.11.2.init 631 SHA256 32257b9e72c2ee201e5104f6eafc134920237f0f5465110edda4778dd92c17a2 SHA512 a0bf57f392a75b1a2875837ec1ad47b61317c6ae530d12e60ae3f62f69b0fb8ef48499b31751fab788df1a6ab842926a73443795a5888258f62e473e2953299a WHIRLPOOL 8185d1927c021be4b3de7c4e0228c68cba558b35c0894c6b17de7f24ebc42dd771593b2d9169f27c5a1ada90e14b2fdb651521ddf39660a77dece586c7f1d348 DIST gitlab-gitaly-0.10.0.tar.bz2 693273 SHA256 44a4a68beb75b464b35fd003cf47a9bc483bb6bbcc8ab4bd4ef87a75329a3747 SHA512 1d7b2d38d68ceaacde03d0ba2cbec19f730527af6a0d56fd92c03f41a4d11c4e5db5c5cc2bd363a8ccfc0f5bf3fb678aec4b17e5996ccc7f1898a78e4598cc1a WHIRLPOOL 737ff05c6992e90eab9ba38a721cf699d87ea1ef84005dbaa16d37ef3c33cec9607571b0421412bba3efd2bf88267ff7d624e57ac92cc08b14c3b8801779c455 DIST gitlab-gitaly-0.11.0.tar.bz2 1446943 SHA256 fe4b57fbc05038eb297fa650dd41c1ae6049fc974f43aa7b4993f500627d9e5c SHA512 396d680b66812a7be1dfb9d54d24c0b06c5b70b7bc94c9cc4de8c5e7ccc875682efafa063370d1b2e352458e8bc24db77ca7ad127e4c5af37e5e6c415ce3a7ac WHIRLPOOL 6050a67cb97c9f4072ae81a5c5364bd910c15f54853e974e7f62fee8a95ca9c38ed1fc550f4df71fbecd8b314aacad77cf24b67fcd6bf340c68a3db3fe74854c DIST gitlab-gitaly-0.3.0.tar.bz2 621097 SHA256 60404ae78b6551e7258a30fa615d7d8c200b84f161ecf904e034db3839391766 SHA512 ad50d15f4a97bf5dd2cc64830840041d8537bd251176eb8964cda3fdb6ef6e1bf3c8b7773516c6e1d51005cc0a718a1bc3ca95fc9ee5d0826c3f9690e1235bb6 WHIRLPOOL 364cdc3407d5fef6ac48a67f8bdd477b75300069be2cbf2567aa73ea7406256ea3c15a27c7a13f92d17c6b63f5923d4e737437bdd3a1e8b808de1832cc9c1af8 DIST gitlab-gitaly-0.6.0.tar.bz2 687192 SHA256 ead87c0da129c075011a55e5b2138febf11fd5146dd62763fc9d4b5d8725840d SHA512 f1e8e337192af02b42087604eb90fab3af73ef3753a07af368b1784462a0c1f8b1d166952b8d4e9c25c93228625195be42b4d3dfad0a70bea0520956acf2522f WHIRLPOOL 283899fb6c3fed332731d06ea42cf76ee5de433849b0784eb78b76391d15ca5feeb36fa9d28f3a90962f378c1c485eb0653a62090dbb6aae8bc87965d534da34 EBUILD gitlab-gitaly-0.10.0.ebuild 1611 SHA256 dc246485ca030c1e9700a8e7707f5e1fafebffd88f7ab12399c12076ee67632a SHA512 ed5e46fa20bfeb81da16f8fb0b702b7d8f71ca5d35f81456fd2ee31eec781cae75e14081b2eeaae3959d6b5db7eb5ed84398c90c6f687b0a3dbf9e602b7cb8f6 WHIRLPOOL 7c6cbdd81e2da6f659482db204433430e2bb947175a56b85addd688dc511cae7dea45a99796c14c6cb2d352fb868752bafc14af34f100d538b5b40bebe2a0846 EBUILD gitlab-gitaly-0.11.0.ebuild 1613 SHA256 6a93e81f94c7af310e4076fa7c81d93d5b4ed3a8c0a2812a58fab96bd6c318ce SHA512 0e2732f634de08a243b57b3766a3b1f3c7d7eafafbf40f72d87dfdbb51aad963aec45899d14a9114f43415dd5dde6734f5619613127485fbc64440b17734db8f WHIRLPOOL 750c4bd7349bd9ced835b3315e31d25ddc0e7fd7ba523ebe31feee86c19b1e0ef7f8e9f1c8fb483fb6b7b246db76ba195a3f48f4b834ff727ce3c2a7512f218e -EBUILD gitlab-gitaly-0.11.2-r1.ebuild 928 SHA256 d0cc04e832356a9a55a0ea5b52ddf971a97c601b9e81b68608ca4505f7ca338f SHA512 25d40a8f201c6732fef0789bd1cf5cf249385dfdc9fcb71d9cd86a0c704e409876895082d1e8ef40abdffb8abb61ded7eb7e025aaabdc6c09b4c414e4f430acc WHIRLPOOL 8cea0bc66ae32692e2e12793f9919e96a424e1d6ba98e4d543c47bc5a4f5d1ca5cb31b0416e10c1bb3cf4ee9d7023f978f5a871fbade4751682ba4f47614c4ff +EBUILD gitlab-gitaly-0.11.2-r1.ebuild 925 SHA256 5a12499e0abada1e9351fcc25cf2dc882f577d9a0cdcd63a7f1819001664faeb SHA512 9752b120d754e95d96a432315171503329c9562448aad498d3aac091be12fcfbf2c617d74430f6578dbcea613981608d8369acc388f0238a4d29ab7c978c2a28 WHIRLPOOL af91a99bd879fac0fe1c29e5d9fb7a93ca8939bfb0bbf51ea9ddd43dd46867e8e918d1598176d3c85b53e6b9b27d07ff325d5856a3106e2402071870e886c059 EBUILD gitlab-gitaly-0.3.0.ebuild 1611 SHA256 d4a80bcc6b9f1f6de0308e02fce0927e10c83620bc546ccc5b2ac8166b7cd5f0 SHA512 28ddef1dd80ce57a978e81048e7f07598dd83c83e0fdf4b6dbf01ff543d4abb4de437e658b07b3d60757163ed30e970327403ffd057e1d737d3dd8e23a534d38 WHIRLPOOL 3f42b071f5acaff80072a5708e50fcd8b4a397a6f2e5772f7234fbba3f606c89664433328495f59a84f5f5468503c11961b2d455878e2f445142778c7645397d EBUILD gitlab-gitaly-0.6.0.ebuild 1611 SHA256 dc246485ca030c1e9700a8e7707f5e1fafebffd88f7ab12399c12076ee67632a SHA512 ed5e46fa20bfeb81da16f8fb0b702b7d8f71ca5d35f81456fd2ee31eec781cae75e14081b2eeaae3959d6b5db7eb5ed84398c90c6f687b0a3dbf9e602b7cb8f6 WHIRLPOOL 7c6cbdd81e2da6f659482db204433430e2bb947175a56b85addd688dc511cae7dea45a99796c14c6cb2d352fb868752bafc14af34f100d538b5b40bebe2a0846 -MISC ChangeLog 1165 SHA256 00b2944d5fa641f9a0d89e98532d73a73c966b8b5ceac1f7ef3dd203647cc03e SHA512 f1c63e3da739b211f1dd51b34dc6b430b41bce0ff0a97f8c8b3f5daa8f1e7cd4fc71ce0615a97a694d40a6f8907efe569dce10efae4fa185411bfa022364446c WHIRLPOOL 0f66fd439a16fb17e2087cc00b20b52dff2a5618912ff2f729d25c53923235b41336127b48535f82ffac884aea27365c2f974504b813d01f14a7d92ba59ef4d4 +MISC ChangeLog 1545 SHA256 564ba53f13b6525862eadb30b9eca08dae900582f165fbf251c3a25738a476fd SHA512 48a2c9cbc0546c8fd6fdd1d3582002efa44b1ae6a1d89947a1a8bf64c42a5016bce77b9bbb5fa08e1eab8f6a653915eb3f22ab2724a3f644a7bdf4f94694b75f WHIRLPOOL 415e4c103b83dfb0dcf84f01faa45685faea9601e261a2ce280537a10dc63d68f83374d0a65b17f93bac409aa2ea20ec77e7c13f16702df4a4b0a0e65d3671f6 MISC metadata.xml 248 SHA256 7b43be15755627edf5c12cf1b50c607d781558640bf8375d685d51d7ade99a32 SHA512 29f9b96b0a77546cce6a8bffd82fae2fd0939d32a7a05ffd0d91f9250a019a3ddaa599b93988c82daabb9c4c4b284dd947e2c47f6ca7727b8539cffa91bcb8c2 WHIRLPOOL 993013c9878ead35469db13d3072f694a341ee654182e0c31d0678f5dd6de4bdc8d59a0b7bb6d685dc41ea6b55dac518cd8034131baea8002170c680e50304d1 diff --git a/www-servers/gitlab-gitaly/files/0002-gitlab-gitaly-0.11.2-fix-config.toml.example.patch b/www-servers/gitlab-gitaly/files/0002-gitlab-gitaly-0.11.2-fix-config.toml.example.patch new file mode 100644 index 0000000..2dd2708 --- /dev/null +++ b/www-servers/gitlab-gitaly/files/0002-gitlab-gitaly-0.11.2-fix-config.toml.example.patch @@ -0,0 +1,21 @@ +diff --git a/config.toml.example b/config.toml.example +index 3a987f9..801d192 100644 +--- a/config.toml.example ++++ b/config.toml.example +@@ -1,6 +1,6 @@ + # Example Gitaly configuration file + +-socket_path = "/home/git/gitlab/tmp/sockets/private/gitaly.socket" ++socket_path = "/run/gitlab/sockets/gitaly.socket" + + # # Optional: listen on a TCP socket. This is insecure (no authentication) + # listen_addr = "localhost:9999" +@@ -12,7 +12,7 @@ socket_path = "/home/git/gitlab/tmp/sockets/private/gitaly.socket" + + [[storage]] + name = "default" +-path = "/home/git/repositories" ++path = "/var/lib/git/repositories" + + # # You can optionally configure more storages for this Gitaly instance to serve up + # diff --git a/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.11.2.conf b/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.11.2.conf new file mode 100644 index 0000000..26c2331 --- /dev/null +++ b/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.11.2.conf @@ -0,0 +1,8 @@ +CONFIGFILE=/etc/gitlab/gitaly-config.toml +RUNAS_USER=git +RUNAS_GROUP=${RUNAS_USER} +LOGFILE=/var/log/gitlab/gitlab-gitaly.log + +# This must match the setting in /etc/gitlab/gitaly-config.toml +# If not using a socket, simply comment out or delete the next line. +SOCKETDIR=/run/gitlab/sockets diff --git a/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.11.2-r1.init b/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.11.2.init similarity index 89% rename from www-servers/gitlab-gitaly/files/gitlab-gitaly-0.11.2-r1.init rename to www-servers/gitlab-gitaly/files/gitlab-gitaly-0.11.2.init index 094d176..0f82d6a 100644 --- a/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.11.2-r1.init +++ b/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.11.2.init @@ -4,7 +4,7 @@ start() { ebegin "Starting gitlab-gitaly" checkpath -f -m 640 -o ${RUNAS_USER}:${RUNAS_GROUP} ${LOGFILE} - [ -z "${SOCKETDIR}" ] || checkpath -d -m 755 -o ${RUNAS_USER}:${RUNAS_GROUP} ${SOCKETDIR} + [ -z "${SOCKETDIR}" ] || checkpath -d -m 700 -o ${RUNAS_USER}:${RUNAS_GROUP} ${SOCKETDIR} start-stop-daemon --start --exec /usr/bin/gitlab-gitaly --pidfile /run/gitlab-gitaly.pid \ --make-pidfile --background --user ${RUNAS_USER}:${RUNAS_GROUP} --stdout "${LOGFILE}" --stderr "${LOGFILE}" \ diff --git a/www-servers/gitlab-gitaly/gitlab-gitaly-0.11.2-r1.ebuild b/www-servers/gitlab-gitaly/gitlab-gitaly-0.11.2-r1.ebuild index fbb9465..f5b3267 100644 --- a/www-servers/gitlab-gitaly/gitlab-gitaly-0.11.2-r1.ebuild +++ b/www-servers/gitlab-gitaly/gitlab-gitaly-0.11.2-r1.ebuild @@ -20,15 +20,15 @@ RDEPEND="${DEPEND}" src_prepare() { epatch "${FILESDIR}/0001-${PN}-0.10.0-fix-Makefile.patch" - epatch "${FILESDIR}/0002-${PN}-0.10.0-fix-config.toml.example.patch" + epatch "${FILESDIR}/0002-${PN}-0.11.2-fix-config.toml.example.patch" } src_install() { # TODO fowners, fperms on config.toml.example insinto "/etc/gitlab" newins "config.toml.example" "gitaly-config.toml" - newconfd "${FILESDIR}/${PN}-0.10.0.conf" "gitlab-gitaly" - newinitd "${FILESDIR}/${PN}-0.11.2-r1.init" "gitlab-gitaly" + newconfd "${FILESDIR}/${PN}-0.11.2.conf" "gitlab-gitaly" + newinitd "${FILESDIR}/${PN}-0.11.2.init" "gitlab-gitaly" into "/usr" newbin "gitaly" "gitlab-gitaly" } From f75090e5dae7df2c3a01424d54e6fbc20000d9d7 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 8 Jul 2017 17:28:13 +0200 Subject: [PATCH 3/3] www-apps/gitlab-ce: Add ebuild for gitlab-ce-9.3.5 Package-Manager: Portage-2.3.6, Repoman-2.3.1 --- www-apps/gitlab-ce/ChangeLog | 7 + www-apps/gitlab-ce/Manifest | 6 +- .../gitlab-ce/files/gitlab-9.3.5-sidekiq.init | 64 +++ .../gitlab-ce/files/gitlab-9.3.5-unicorn.init | 145 ++++++ www-apps/gitlab-ce/gitlab-ce-9.3.5.ebuild | 413 ++++++++++++++++++ 5 files changed, 634 insertions(+), 1 deletion(-) create mode 100644 www-apps/gitlab-ce/files/gitlab-9.3.5-sidekiq.init create mode 100644 www-apps/gitlab-ce/files/gitlab-9.3.5-unicorn.init create mode 100644 www-apps/gitlab-ce/gitlab-ce-9.3.5.ebuild diff --git a/www-apps/gitlab-ce/ChangeLog b/www-apps/gitlab-ce/ChangeLog index 5157790..80ac07a 100644 --- a/www-apps/gitlab-ce/ChangeLog +++ b/www-apps/gitlab-ce/ChangeLog @@ -1,3 +1,10 @@ +*gitlab-ce-9.3.5 (08 Jul 2017) + + 08 Jul 2017; Manuel Friedli + +files/gitlab-9.3.5-sidekiq.init, +files/gitlab-9.3.5-unicorn.init, + +gitlab-ce-9.3.5.ebuild: + www-apps/gitlab-ce: Add ebuild for gitlab-ce-9.3.5 + *gitlab-ce-9.2.7 (08 Jul 2017) 08 Jul 2017; Manuel Friedli +gitlab-ce-9.2.7.ebuild, diff --git a/www-apps/gitlab-ce/Manifest b/www-apps/gitlab-ce/Manifest index da663f6..0891f42 100644 --- a/www-apps/gitlab-ce/Manifest +++ b/www-apps/gitlab-ce/Manifest @@ -13,6 +13,8 @@ AUX 06-gitlab-ce-8.17.0-fix-webpack-config.patch 614 SHA256 0c1cdc25032322eff6c2 AUX gitlab-8.13.0-sidekiq.service 990 SHA256 183ccbdb19a3dcc74cf1f1f865bf396466e06f7408ff7d3e92359b2a0e83f24c SHA512 c356baf65337739b08a0a4bfe24d3b68f557e9d6d95f479b39ec954ee6c2077e380f99d1e9e9390f5b038e093c0a46562f651512a6578dfa86977580159470a2 WHIRLPOOL 81d9ea9febf47d5fdb9c49a54bbc499bd796fc56bc1c16404fe4c74d00c4bb9fa9631e4cd4cf88d3c30a44c04b74b35a61cd4da9f2139a4abf61e758b4e5949a AUX gitlab-8.13.3-sidekiq.init 1459 SHA256 fdf808f9c0a92d7a77ae8be27c8fc11cec571ec6b5b94e31639028eec19546f1 SHA512 ec2130483b603f2be423c288fd0d55615c831ce995a8a5509f0240f149b3464d8f0a75cade1c736d085fb5f898d109368af62d8fdfb280aa00c4df8c06abb1e9 WHIRLPOOL d3493ac268257386e22c677337c8f9b1050212fce4aa855119b2ccd5f56850a5288d0cdd74e3c2f34552f59f9431c9ab5080e372766b88de003cad5dab015100 AUX gitlab-8.13.3-unicorn.init 3562 SHA256 f4ae5b785d61fb2c463b2405533d5e9a2209bbff7a085106b463f59505123287 SHA512 4af87415da7e482725a6f97f5e2ffafe0d16784cdcf3f877c99b5f646832c14dd1b3e875ec00e57560060bf3c049dd7fd0aeb7452db1100740e6b17dc29fdfb6 WHIRLPOOL a63d236a76bcbbd6e39268c76a7fbb75f4b9e5488d0cbc0bb2973ae09753f11d1863e477fe88f6c652370c19c3a0f037f99cc681b91679eb4da992db5e2eff20 +AUX gitlab-9.3.5-sidekiq.init 1464 SHA256 dc1d9a58845a699d5b797f476597e7d7a7171eb842b05639cd2e235c70a26edf SHA512 fe00243c815b0e4f826aada4f02c70659872673a36fe92ea1b72a94a21bacfb097260ac1623cc1fc9c74566fe5c6068a456c9dc6e1e1c02f42e86fd162573713 WHIRLPOOL 6d8618e1e0a14030c73840f58d6dd5f7ef221f448799c92978c42d6bd71bfd072f15508df931f408ede91158079cef7039e9e725cb217629a8b7e19f6c706978 +AUX gitlab-9.3.5-unicorn.init 3748 SHA256 2fb8d62e52b2e59bed92de55834421b3858ca385c20ed7532f78a3c4cd6ba2c9 SHA512 6f7a6cded598f3f8174a4d39f06f1994aa77b22cb90fa7f1bb6f82919c9856c3eae1623f57636f2ee564b2bf6c660c82dd104e3c59455946db42e6cf44079ccb WHIRLPOOL f39d37b2f83046234616d056d046c844e24ccf434c96bc298acd0f53fcf0be57fc64352bfd66e45083f87e6be0ed817c89630309deee5f142c9343a46014a166 AUX gitlab-mailroom.service 773 SHA256 39cea460db7fc505b136a2106902d0515890180e74913bf364aa499368fc5f2e SHA512 f82c63a180add1103e2bd115e67826ad7362a844991ef16f1de7fc6c78bf1955155ecf278fc0d759e674ab85736f3ba2a6650d00e9b3ce683316875efd9efa3c WHIRLPOOL 683c67b12f9666d1c1df5ec61e0072acaecd3aff43d0ff475037e178bc58fd9036ae6d8cd45e922098c842abd057231afd4767ce229d4581356f153b48a06208 AUX gitlab-unicorn.service 773 SHA256 010c9e223a30400d9155b39499eb0d7efad23b66baab9fcd9e365c689086b9bd SHA512 0bf9630aa91ed8f590a7bfa42d09b7ba33f6342b43b3d191c792c11157f8926c2a2ac2390eebd8179637e29b5bf68233d4699d62463497a0fd45b9bdbdd9167b WHIRLPOOL fbc709a5550dcc548a35c22c812dafe52ee507f5678b57c22c709ee89a399ae9109e2f56b7a13135d4140f1e024ebc4effe4aa4de13e0f36691da2a0737d9792 AUX gitlab-workhorse.service 930 SHA256 09348a52fec333b4b19828752e0484400c1efa9dfb644723fcf8e80537e294b6 SHA512 6332024fe0049287899cf482b6e4439e9dd90da14e489d08aa8e5e79cb7872efcc517d99b69fa23b011b382acb1e5926496a78f08af5d2d64daa515b869a0c6a WHIRLPOOL 3749c6719b2a35c7de29763cd616e1e9cc30a85aa1630ffc46440334459b5922503d52629556c125a6dd6574bdc5f23f1b2a7f2a85e2270a415b22246e0b6bae @@ -24,6 +26,7 @@ DIST gitlab-ce-9.0.10.tar.gz 26364880 SHA256 4034125e6be2bd43bfab5e5d16074f6df0f DIST gitlab-ce-9.1.7.tar.gz 30517778 SHA256 24506445bb484fe568b357d8d8ac32f54f54f543ae623609bb720381d96e6358 SHA512 454e0afcde9a613d780e2031632d424bb316e68472329303080eecf1876fe7b5bd964ecd623bb5ed2e2be4666ebb90f17e790406a5622f81e8c52e320e4e5c81 WHIRLPOOL e0e5b89754a86bdf7cc472cfbe7ec91a5f752f836f5de34b6db4bb4315ddd2a337768b7af7a3e0b86f1a2bd8b9bd95692fab434b8aa98ca96b962a3bfffe82be DIST gitlab-ce-9.2.7.tar.gz 30988513 SHA256 c9a7beeb63569f9e22e330418772464179f734b201e44114851407e552705527 SHA512 2dc3a09baeff0ef3e9a2103c1eb468ae3936e2858b9c7462b95ced1f705ee8f00e3d4996298df0b14bc51f1c3c002b1da56ea6b636821c4e5916077dd3a9cb0a WHIRLPOOL 3f6ddba36a8b99227df8c3519ef306b8338956bf14adba5c08d06bd1df689966739f4a03eaaaf9d69076a636085ee829e2fd0f0c6b6ee90bc2a6e7e8db5ccb6b DIST gitlab-ce-9.3.0_rc2.tar.gz 31567867 SHA256 fbd93af8281b2460a9600a84b24b007e4557da49f8d118387724c8166236220c SHA512 942e3e1ec856b0ff3dedcfcb7b8cdee51e7d44779024acaa69ce7d415d08bb1ee785bcd265d1f9f08790c8e9508779b7f9cc8a40acf417cbc0e94f3a98f1fb64 WHIRLPOOL 1f210495ac3632f88c663ae9dd936bea5e556012a5b5dfe598425046f845d0467c17b92abd24924dc720c3877f8b6ef65e6b551ad9b2c3486dc27eee430a6a0e +DIST gitlab-ce-9.3.5.tar.gz 31759466 SHA256 fbc19d97602ceb819364f72af61ed93524df9d2cafabf5a0b44072c656a51809 SHA512 c2d44f6eabc9d4083ffbdf07380b506a258ae484698637cb448f4ede5a22881b3bef3d91cd13db63fc28f2672edd059e31dca06b67f9077704d6b37b9bb15332 WHIRLPOOL f4f224c3ae26030d3d1f776771a0e78262b9b7e321c696d53b75c4ae93d16de30b296253399dd0ed2a9c58bf397ff7422e9d38b25519458556669d7f18cbe000 EBUILD gitlab-ce-8.15.8.ebuild 11986 SHA256 6c86e66d4b568b88dd44ec52401e25c33b2d5e61d9a76e77180320d40ef57132 SHA512 91e1dc1cd8b9b77ea039e7e194b06c44900511b9e7787a714faec14746f96da6d00aa66bd16763732c468d8a46815e29fe761349a0a0d712db21bd4a12d31e06 WHIRLPOOL 50923df1fdda85abf7c7984a49d73d6486628439612de18ec3914274f3a053ce98ffbffec0f6ca9f2f9ba1ca9491467de0762d2d4a31ea480f32eb68222c79f9 EBUILD gitlab-ce-8.16.9.ebuild 11986 SHA256 21a0d7336a0a022db75ded6f29fe12d64012bd20a46e538ce0940a3c7e402a11 SHA512 c8e3ff6de9d97e25300315e967b7bcfc7d4aa5bc3e78aa45564e12bb673fbf79c9ba454174fe4f362d9d58575611debf797b52685b2061ac3053113390401a5c WHIRLPOOL 4644465cfcaf81184c62acf888ced3f16ccffc9de84fac7774a5463a778684c051580dd1f273546b9be8a0ace83243abc06e1e5ba042b18a10f7d352783a995f EBUILD gitlab-ce-8.17.6.ebuild 12932 SHA256 e5f7cc94653a6c55627264e02116d43febdcc58bd60ccf9f7c5fecf9476d1b0a SHA512 65fc18401842e1c1176d8178acff3ca48f1fe80ee8869b7263cd1819ced46bb8d1c2771226d9f7c9c5507ef120d69d66114605d8ed7b3923e5f9a61e2cc0125d WHIRLPOOL 3c979ba2e30fbb3c628063f71e3a8b12183632413f4342b81298e4fd4847e8a583adab16c202340d89fde010097f140005ae564c0d52fefb0fcb57b67ede398d @@ -31,6 +34,7 @@ EBUILD gitlab-ce-9.0.10.ebuild 13094 SHA256 3095dbce78328f513eaf599486af63ae3836 EBUILD gitlab-ce-9.1.7.ebuild 13250 SHA256 be342467f79215ec736c6d1f4d9d26bb679116f422585cceeac90bdf15dedfec SHA512 eca7584067d438b1feeeb56d7ef765af1f96f3fce8098d32e70e4f706c9572a52ffd7d4594c949234a1d25e9f52b220892d656afce4b30ca32ebe51665d0326c WHIRLPOOL 27d89d8d86c583da924bdac4f6db7216be151a55d5b14f7a78dd77417cd643c506c1c2ec652e234df7763472a0cad21794645dd85cfb404276179721649d4077 EBUILD gitlab-ce-9.2.7.ebuild 12995 SHA256 93cb032967c0388d706be2dda0cfca2ca4765c0774e283ab0d61769cf43ddea6 SHA512 b8ecb0a4cc893786d4cd2dd94d53a21c6a8fbec5d181843286584914363f1160361dccfe2f61487f6744f7fb4d42a5efc4085e64bca7b29dea7e4672788c49cf WHIRLPOOL 2d8ada573da9e209e7a0bf3f05aef83e2419c18f4406b3abdbb24a90b488acdbdf7d4406b665a92356b457d100dd46c2a39084f87ba90b23da87392f2f98beb4 EBUILD gitlab-ce-9.3.0_rc2.ebuild 12829 SHA256 6951949f8d98f867746a0128e99ce3baabddecdaa45952565f38a913b2868058 SHA512 3337e413db8680d0d177099425a71c2410afdec9130d57f9c910770aeb12dd7a13c410782f41f8a0cd24d243534d513b66ec4d93eb09c7e15896716863682eb0 WHIRLPOOL 6b9d03912224808065b3bc301f9ce7b82925293db2916cdeb3184b28c0d58fc034b06dda6b43109b251c942d3b4bebd0c4e6bde7c644630baaece585c35ae6d3 +EBUILD gitlab-ce-9.3.5.ebuild 12828 SHA256 88e5bbb069524fa1cb38dce77bd6338f0c7e9474cf733051953340ab25ee6692 SHA512 a15e5d2ba38ae7438978030c52cc91e41cb1ac3bf7a805b97c8e3a17d49c15bd784c8f0024ddd68074f371501e73469b6c5f974741764775b0614736e3e8253b WHIRLPOOL b56a2815557ff59234596fdbd2e20d75c8ea6441eb8d51e5da7dcc92e05b4e56576a74f930d3aa008358389dc06e00efd15ffabb273fb9c87d878a7ebe64bd19 EBUILD gitlab-ce-9999.ebuild 12789 SHA256 27db871b7d51cae37b6802043c82887bb810c1183682ce6c7efe0dc546d9b29e SHA512 99ca91ab0b8045d8bc2cd9d4208ecd4e8eb96c3d01afe49d119bb5677ee88f5f700042f502ab0c446f7acaaaeb7b9758c6d721a91f256eea335eb744a05a4b27 WHIRLPOOL a1e812d1d9562e7febee89e5c847ea0febec360aee38efc5cf779e45b92bb73eff3f066eb90fb96c292e8cfdc2a322bc9222a786796ac0470a221e44369a3270 -MISC ChangeLog 19200 SHA256 db9f337205efe14e3f1eaf70b0969c373f4c8c3373157147472a3c12ba9610cd SHA512 1aa815fb7827127f7f99d0e3b27d7be6334865a1313a5fc87ea13e7aec06447f24d9ba2b4ddab84eb200cb4ec06db49d0546956e49b2b051d5bd54b920a4ad63 WHIRLPOOL a6a9f04d0d930a515cb2c0a6ab594f94ed67b4ffef97bca09f282aea2c4663cbc05ad91a570dfbe0f88d3126759c9f810cb642dfa998b6204c3456ab9907e519 +MISC ChangeLog 19435 SHA256 c81d395d1c8f83931097bc34df25dcbda8e6351186baf397df8eb4051bbc1616 SHA512 1524cbe46461c1a9672213f54dbbf4243a7b5379253401fe87aba17e23eae7a6f2b0709a49afcc24f963d4591637a7fc969406b98fb3e80200440de95a1b2390 WHIRLPOOL 94d7ba2ae1aad389da9142d3cca03e1853223fd564d17af643dc0bc336975237e11536f74a278815c59e027950cd35a2122b1244f2a3e598d11ebbedee5958b9 MISC metadata.xml 801 SHA256 3dc7486a12903f47f65968d524c93500ba30a4a09fa57e5a9dacf356509b44bb SHA512 e132754b72e64246531fa883400a0cf1a473ac5a6a49623db58ccf118a038b7cf37df03d9550f37b4a25f9ddbb1dcc5652ec9a4f2259d8e3ce202692c4025f41 WHIRLPOOL e9d961681fd790008eaf80fa07ce2c55a00a58f2e920d759793783ca8c8f508602a777e94c0cb65fe87c7dbef0cabdf26e4f4082584421097d939cbab20c4ac6 diff --git a/www-apps/gitlab-ce/files/gitlab-9.3.5-sidekiq.init b/www-apps/gitlab-ce/files/gitlab-9.3.5-sidekiq.init new file mode 100644 index 0000000..f399a1f --- /dev/null +++ b/www-apps/gitlab-ce/files/gitlab-9.3.5-sidekiq.init @@ -0,0 +1,64 @@ +#!/sbin/openrc-run + +extra_started_commands="check" + +name="GitLab Sidekiq" +description="Sidekiq for GitLab" +description_check="Runs sanity checks" + +: ${gitlab_user:=@USER@} +: ${gitlab_base:="@GITLAB_BASE@"} +: ${rails_env:=production} + +: ${sidekiq_pidfile:="/run/gitlab/pids/sidekiq.pid"} +: ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"} +: ${sidekiq_config:="/etc/gitlab/sidekiq_queues.yml"} + +sidekiq_command="/usr/bin/bundle" +sidekiq_command_args="exec sidekiq -C ${sidekiq_config} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}" + +check_command="sudo -u ${gitlab_user} -H /usr/bin/bundle" +check_command_args1="exec rake gitlab:env:info RAILS_ENV=${rails_env}" +check_command_args2="exec rake gitlab:check RAILS_ENV=${rails_env}" + +depend() { + need redis gitlab-workhorse + use net +} + +start() { + checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")" + + ebegin "Starting ${name} - Sidekiq" + + start-stop-daemon --start \ + --background --quiet \ + --chdir "${gitlab_base}" \ + --user=${gitlab_user} \ + --pidfile="${sidekiq_pidfile}" \ + --env RAILS_ENV=${rails_env} \ + --exec ${sidekiq_command} -- ${sidekiq_command_args} + eend $? +} + +stop() { + ebegin "Stopping ${name} - Sidekiq" + start-stop-daemon --stop \ + --pidfile=${sidekiq_pidfile} \ + --exec ${sidekiq_command} + eend $? +} + +check() { + ebegin "Running sanity checks for ${name}" + + cd /opt/gitlab + + ${check_command} ${check_command_args1} + + eend $? + + ${check_command} ${check_command_args2} + + eend $? +} diff --git a/www-apps/gitlab-ce/files/gitlab-9.3.5-unicorn.init b/www-apps/gitlab-ce/files/gitlab-9.3.5-unicorn.init new file mode 100644 index 0000000..dea992f --- /dev/null +++ b/www-apps/gitlab-ce/files/gitlab-9.3.5-unicorn.init @@ -0,0 +1,145 @@ +#!/sbin/openrc-run + +extra_started_commands="restartsidekiq check" + +name="GitLab" +description="GitLab on Unicorns" +description_restartsidekiq="Restarts Sidekiq only" +description_check="Runs sanity checks" + +: ${gitlab_user:=@USER@} +: ${gitlab_base:="@GITLAB_BASE@"} +: ${rails_env:=production} + +: ${server_pidfile:="/run/gitlab/pids/unicorn.pid"} + +: ${sidekiq_pidfile:="/run/gitlab/pids/sidekiq.pid"} +: ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"} +: ${sidekiq_config:="/etc/gitlab/sidekiq_queues.yml"} + +: ${mail_room_pidfile:="/run/gitlab/pids/mail_room.pid"} +: ${mail_room_logfile:="@LOGS_DIR@/mail_room.log"} +: ${mail_room_config:="/etc/gitlab/mail_room.yml"} + +socket_dir="/run/gitlab/sockets" + +server_command="/usr/bin/bundle" +server_command_args="exec unicorn_rails -c ${gitlab_base}/config/unicorn.rb -E ${rails_env} -D" + +sidekiq_command="/usr/bin/bundle" +sidekiq_command_args="exec sidekiq -C ${sidekiq_config} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}" + +mail_room_command="/usr/bin/bundle" +mail_room_command_args="exec mail_room -q -c ${mail_room_config} >> ${mail_room_logfile} 2>&1" + +check_command="sudo -u ${gitlab_user} -H /usr/bin/bundle" +check_command_args1="exec rake gitlab:env:info RAILS_ENV=${rails_env}" +check_command_args2="exec rake gitlab:check RAILS_ENV=${rails_env}" + +depend() { + provide gitlab + need redis gitlab-workhorse gitlab-gitaly + use net +} + +start() { + ebegin "Starting ${name} - Unicorn servers" + + checkpath -d -o ${gitlab_user} -m755 "$(dirname "${server_pidfile}")" + checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")" + checkpath -d -o ${gitlab_user} -m755 "$(dirname "${mail_room_pidfile}")" + checkpath -d -o ${gitlab_user} -m700 "${socket_dir}" + + start-stop-daemon --start \ + --chdir "${gitlab_base}" \ + --user=${gitlab_user} \ + --pidfile="${server_pidfile}" \ + --env RAILS_ENV=${rails_env} \ + --exec ${server_command} -- ${server_command_args} + eend $? + + ebegin "Starting ${name} - Sidekiq" + + start-stop-daemon --start \ + --background --quiet \ + --chdir "${gitlab_base}" \ + --user=${gitlab_user} \ + --pidfile="${sidekiq_pidfile}" \ + --env RAILS_ENV=${rails_env} \ + --exec ${sidekiq_command} -- ${sidekiq_command_args} + eend $? + + if [ -e /etc/default/gitlab ]; then + . /etc/default/gitlab + if [ "${mail_room_enabled}" == "true" ]; then + ebegin "Starting ${name} - mail_room" + + start-stop-daemon --start \ + --background --quiet \ + --chdir "${gitlab_base}" \ + --user=${gitlab_user} \ + --pidfile="${mail_room_pidfile}" -m \ + --env RAILS_ENV=${rails_env} \ + --exec ${mail_room_command} -- ${mail_room_command_args} + eend $? + fi + fi +} + +stop() { + ebegin "Stopping ${name} - mail_room" + start-stop-daemon --stop \ + --signal QUIT \ + --pidfile=${mail_room_pidfile} \ + --exec ${mail_room_command} + eend $? + + ebegin "Stopping ${name} - Sidekiq" + start-stop-daemon --stop \ + --pidfile=${sidekiq_pidfile} \ + --exec ${sidekiq_command} + eend $? + + ebegin "Stopping ${name} - Unicorn servers" + start-stop-daemon --stop \ + --signal QUIT \ + --pidfile=${server_pidfile} \ + --exec ${server_command} + eend $? +} + +restartsidekiq() { + ebegin "Restarting ${name} - Sidekiq: Stopping" + start-stop-daemon --stop \ + --pidfile=${sidekiq_pidfile} \ + --exec ${sidekiq_command} \ + --progress \ + --retry 180 + + eend $? + + ebegin "Starting ${name} - Sidekiq" + + start-stop-daemon --start \ + --background --quiet \ + --chdir "${gitlab_base}" \ + --user=${gitlab_user} \ + --pidfile="${sidekiq_pidfile}" \ + --env RAILS_ENV=${rails_env} \ + --exec ${sidekiq_command} -- ${sidekiq_command_args} + eend $? +} + +check() { + ebegin "Running sanity checks for ${name}" + + cd /opt/gitlab + + ${check_command} ${check_command_args1} + + eend $? + + ${check_command} ${check_command_args2} + + eend $? +} diff --git a/www-apps/gitlab-ce/gitlab-ce-9.3.5.ebuild b/www-apps/gitlab-ce/gitlab-ce-9.3.5.ebuild new file mode 100644 index 0000000..f8117e8 --- /dev/null +++ b/www-apps/gitlab-ce/gitlab-ce-9.3.5.ebuild @@ -0,0 +1,413 @@ +# Copyright 1999-2017 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="ruby23" + +inherit eutils ruby-ng user systemd + +MY_PV="v${PV/_/-}" +MY_GIT_COMMIT="0c9ceb3fd6094077cc5068970dedd4435db80000" + +GITALY_VERSION="0.11.2" +GITLAB_PAGES_VERSION="0.4.3" +GITLAB_SHELL_VERSION="5.1.1" +GITLAB_WORKHORSE_VERSION="2.1.1" + +DESCRIPTION="GitLab is a free project and repository management application" +HOMEPAGE="https://about.gitlab.com/" +SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz" +RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}" + +RESTRICT="mirror" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~arm64" +IUSE="kerberos mysql +postgres +unicorn systemd pages 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-4.3.0 + >=sys-apps/yarn-0.17.0 + 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-${GITLAB_SHELL_VERSION} + >=dev-vcs/git-2.8.4 + ~www-servers/gitlab-workhorse-${GITLAB_WORKHORSE_VERSION} + kerberos? ( !app-crypt/heimdal ) + rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 ) + pages? ( ~www-servers/gitlab-pages-${GITLAB_PAGES_VERSION} ) + ~www-servers/gitlab-gitaly-${GITALY_VERSION}" +DEPEND=" + ${CDEPEND} + ${COMMON_DEPEND}" +RDEPEND=" + ${COMMON_DEPEND} + >=dev-db/redis-2.8 + virtual/mta + systemd? ( sys-apps/systemd:0= )" +# required bundler >= 1.15.0 +ruby_add_bdepend " + virtual/rubygems + >=dev-ruby/bundler-1.13.7" + +# +# 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=( + "01-${PN}-8.7.5-fix-sendmail-config.patch" + "02-${PN}-9.0.0-fix-redis-config-path.patch" + "03-${PN}-9.2.2-database.yml.patch" + "04-${PN}-9.3.0-fix-check-task.patch" + "05-${PN}-9.0.0-replace-sys-filesystem.patch" + "06-${PN}-8.17.0-fix-webpack-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}" + +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|${run_path}|g" \ + -e "s|/home/git/gitlab/log|${LOGS_DIR}|g" \ + -e "s|/home/git/gitlab|${DEST_DIR}|g" \ + config/unicorn.rb.example || die "failed to filter unicorn.rb.example" + + sed -i \ + -e "s|/home/git/gitlab/tmp|${run_path}|g" \ + 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}"/ + 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 + + ## RC script ## + + if use systemd ; then + ewarn "Beware: systemd support has not been tested, use at your own risk!" + systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "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-9.3.5-sidekiq.init + use unicorn && rcscript=gitlab-9.3.5-unicorn.init + + cp "${FILESDIR}/${rcscript}" "${T}" || die + sed -i \ + -e "s|@USER@|${MY_USER}|g" \ + -e "s|@GITLAB_BASE@|${dest}|g" \ + -e "s|@LOGS_DIR@|${logs}|g" \ + "${T}/${rcscript}" \ + || die "failed to filter ${rcscript}" + + newinitd "${T}/${rcscript}" "${MY_NAME}" + fi + + # fix permissions + fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs} +} + +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 + if use mysql ; then + ewarn "PLEASE also read this document about needed migrations on MySQL:" + ewarn "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md" + ewarn "Failing to follow those instructions may make the config phase fail!" + fi +} + +pkg_config() { + 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 + + 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 + + su -l ${MY_USER} -c "git config --global repack.writeBitmaps true" + + # determine whether this is an update or a fresh install. we do this by + # checking whether the ${DEST_DIR}/.git directory exists or not + # + if [ -d "${DEST_DIR}/.git" ]; then + local update=true + else + local update=false + fi + + ## Initialize app ## + + local RAILS_ENV="production" + local RUBY=${RUBY:-/usr/bin/ruby} + local BUNDLE="${RUBY} /usr/bin/bundle" + + # FIXME: this line existed in older ebuilds, but the variable is + # never used. what was it for!? + # local dbname="$(ryaml ${CONF_DIR}/database.yml production database)" + + if [ "${update}" = 'true' ]; then + einfo "Migrating database ..." + exec_rake db:migrate + + # https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496 + einfo "Migrating iids ..." + exec_rake migrate_iids + + einfo "Installing npm modules ..." + exec_rake yarn:install + + einfo "Cleaning old precompiled assets ..." + exec_rake gitlab:assets:clean + + einfo "Cleaning cache ..." + exec_rake cache:clear + else + # 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 + + einfo "Initializing database ..." + exec_rake gitlab:setup + + einfo "Installing npm modules ..." + exec_rake yarn:install + fi + + einfo "Precompiling assests ..." + exec_rake gitlab:assets:compile + + 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 + if ! use systemd ; then + elog "You may also run" + elog " /etc/init.d/gitlab check" + elog " for convenience." + 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} NODE_ENV=${RAILS_ENV}" + + echo " ${command}" + su -l ${MY_USER} -c " + export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; export NODE_PATH=${DEST_DIR}/node_modules + cd ${DEST_DIR} + ${command}" \ + || die "failed to run rake $@" +}