Merge branch '39-gitlab-8-11-0' into 'master'
Resolve "GitLab 8.11.0" Closes #39 See merge request !102
This commit is contained in:
commit
30ad3b4b86
21 changed files with 106 additions and 1785 deletions
|
@ -1,3 +1,15 @@
|
|||
22 Aug 2016; Manuel Friedli <manuel@fritteli.ch>
|
||||
-gitlab-ci-multi-runner-1.3.2.ebuild:
|
||||
dev-vcs/gitlab-ci-multi-runner: purged all ebuild versions <gitlab-ci-multi-
|
||||
runner-1.4.1
|
||||
|
||||
*gitlab-ci-multi-runner-1.5.0 (22 Aug 2016)
|
||||
|
||||
22 Aug 2016; Manuel Friedli <manuel@fritteli.ch>
|
||||
+gitlab-ci-multi-runner-1.5.0.ebuild:
|
||||
dev-vcs/gitlab-ci-multi-runner: added gitlab-ci-multi-runner-1.5.0. to be
|
||||
used along with gitlab-ce-8.11.0
|
||||
|
||||
*gitlab-ci-multi-runner-1.4.1 (26 Jul 2016)
|
||||
|
||||
26 Jul 2016; Manuel Friedli <manuel@fritteli.ch>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
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.3.2-amd64 59026624 SHA256 11a27560c0b52138e1947b25fc02768a493fb6480a9e81f1be9980823767dfc0 SHA512 1f80754c13460ea3c849b91a1e08ca19cc906e96ed2d392a7a5b5ac86596b065ef0969c396b17dede090d00b2d61734db1c997ab6884f2768170bc50a69ff262 WHIRLPOOL c0c48efd7591861a969c3ab0d0c3317eefa8ea9f90d518e3f4698d16df2ab35865fe90320063570c064c9fe553f79a015b22f6ac0202f8b70ea381e4a6e42308
|
||||
DIST gitlab-ci-multi-runner-1.3.2-arm 55880656 SHA256 9277c93936071c28853e30c65f1619ad8633636cd33b44d844f564e606f9a816 SHA512 95bf8ba209c137b02fc9d08ffa8222a98d3d9e821360c77cac174b8482dc41f04ea294784b7dc3937515731ad41927f756c448247728582e3782484ffa3015e5 WHIRLPOOL 7ed4df051005b9b77aecdc99753e8a6a63afacbacf57e86431a544ca6fbd0fd9d6acf3c9685d28b6dce6213a235c29c35145833bcd74183e7ce42ac593b7962b
|
||||
DIST gitlab-ci-multi-runner-1.3.2-x86 56049864 SHA256 f76eb70b7033f0db62022136e585635e28e8f89bebef327a240f8becb7bd254e SHA512 cf379e9fc3187ce018f23fdc4be0c541e7d0bc9080ba9358beb20b8db9ad0e18926d383f22bbdbbe5345668c84d4005c206568c10a2b255a93d7e6e0735a709e WHIRLPOOL 200ffa04bcf330f0f3f54b7f13639c5b17bd4571b599539ae1f5166a5709f410945b1b33450b87aad666250cfc13a32a1312afa4c6509c906c8e15cd5a579188
|
||||
DIST gitlab-ci-multi-runner-1.4.1-amd64 59770288 SHA256 8efbffac459fab6bc0532ba09d527e5a93d1da521fd90b1ff6408a714fcc8261 SHA512 33d8a509def74caa937fbfb69dc4aae50266e1ffd83bcddd2e358649010602108bc99647192fd64e8bbd1892a18f27b69b704ea1b4fc6622ec0d8ee4fdd564c0 WHIRLPOOL 6fae8f2a04aa3a74506746906e91300e05ea3ca31cdf8a4fc8e092328277975832f80a56eee1e26359dd510ed135fd756fd11b3ad75e23284c92388c162f388a
|
||||
DIST gitlab-ci-multi-runner-1.4.1-arm 56437360 SHA256 8f029a87d1ac1e1fc0f53249e8c8d9fc8f8c5191609a74521fdf626d6a9aec1e SHA512 9fbb8fd89a25e7f51354ec5d55bc4e1a60a166c39849ea4fa54435dbc48135ac8720a6f0cea2645fb449ceff5e74cfb402f33bb6aa75189eeeceb7a60abfba29 WHIRLPOOL 764c516580dec2bddfbcd270c4234f164256ab5801608875a9edbe59852e679c7f285a7ef09748662900add74fde6ebeeb2842e34cb208cd5858eed6dc60b1ec
|
||||
DIST gitlab-ci-multi-runner-1.4.1-x86 56606472 SHA256 c4c1d15912a48a6de66a0093ad3db7a50e7c28c64dc250a328de3a120fa36baf SHA512 f394834d78cf743fa80d219b92e071a450f055d2eca38486f5b9aecf85e3daba10e370a14ac9bdb847fcea63b80101f98ed75b9f741944eadd14e0a9f2faa388 WHIRLPOOL 793e873eac8a85de75e4dc54456a21f9c235d5c83a6d19b039c4112f5d145ca373d8c4fc70b9bae9c137bb30fbe5ebaae81b7f03a904d634ede242829c482ba4
|
||||
EBUILD gitlab-ci-multi-runner-1.3.2.ebuild 2349 SHA256 29cac383ea3d01f2c5edc10698d5c49870e6d82eb05dc035610df7028ba5ebc9 SHA512 ebe3807eba35b313a64baf16121cc1794bda640a4f5e979c5898c33f4d02e756832fe1a052e500bc7257dfdd16faa43de5abe69062572064360689add0f3ad76 WHIRLPOOL 2674e052ed40f61530c34c396fc35fe9aa555f6f825abc3ac20b89f0d0090234e198bce69c5d1580c25401888b000b5e9c47c4ae6c0f3f02d8d2654f3a8ecd89
|
||||
DIST gitlab-ci-multi-runner-1.5.0-amd64 40162568 SHA256 8068a7c0a149cda3782ea58b29ac1f1dfb7018d2021359b2be6094493a86fbf0 SHA512 e06c2aa44d7c369bfa6315221bac19670c97268f64660a320fa9872f86991c1f3c3ef25a9cd233b5769bbf30e1a4958d347f7bbb991dbf10696666332d763314 WHIRLPOOL 4b9e5e06671955245116693d73e5158c0e6a9455127cf6703222a353467c3c57128df0ad682dc47db37b20f98e2a870b5e32344c69c64f301a4611c451305569
|
||||
DIST gitlab-ci-multi-runner-1.5.0-arm 36718736 SHA256 38849b5948d892b505f2d8b01b777ed4b22eea2a6ce91aeaf276c3ad6fcb56cd SHA512 14439be83d1f5cb3a2e2b67421138ef4b6ea2ed6636214f082f4db32786a6707c4299c23410ba6c54e06079358acdf84e3a0ee9c5280c17f06576463607187c4 WHIRLPOOL ca677e0d62323021ec477fa031cc1a8cab76757101abe7033c0c1da632f99d225c622792d07df93b935467a7ed987e2cbe6c4dd00e16f06ad3988d4bd21623d2
|
||||
DIST gitlab-ci-multi-runner-1.5.0-x86 36892864 SHA256 029e1a570ff5f5f570d107cb451b2a759829ba64fde6965a1d4abc6135ef63be SHA512 06d55f40e3d43ef3524266fec1c009372bb18850394ec5688979fe6bf33e3bf864aa0582ff0de5eb1e088ce2a24b09bdb6a2772643a15f4d8e994c7f194197a9 WHIRLPOOL 8ede1609492f33599078129a44c28eb58f850da715d091b847a753589a68cfac9f206f9c5e7b78eddad67a834279fbd4cd72a7fb5ea09075aa16729f70edeff2
|
||||
EBUILD gitlab-ci-multi-runner-1.4.1.ebuild 2342 SHA256 f33ce8f464292cbdf84362d51309082dc92cf2a2b9941be5706fbff881cab321 SHA512 a647a90f50e8337233b0642a04b26e81558cebad999ef209df9d5b6ad7900893e025e3e472c8d3221e63858f5ee6c7ba77faf32346baf5cb3833795e6648cd4c WHIRLPOOL 6179938277f66df49b316293fedb830a7f2e87c57786bae8cd8e6b301a89dd6343dc367cd702b462b4fdf8dcf9bdb6c116b788033c87ce366045fc876eee79e3
|
||||
MISC ChangeLog 891 SHA256 96ef46ae5199d64dce40df1c4fd11b3f0bc363adba9654fb5ac65c60cf7d4e8c SHA512 64ef58b086b4355622b1d3904bd782a660b6beb63e98da4c192d7841ea0dd505bb2cce9715869311be7263a928959203f232412443b29e7cc2cab8fd13c1e4ec WHIRLPOOL 812774ea0fcded80bfe8b0793b19ffc0730f0dd62496d7a0eb9fbd1bceb182465ce7bba2c1a81471627dbd3d2a66fdf23690279c2ddefa5d2473bd0c4ccc9699
|
||||
EBUILD gitlab-ci-multi-runner-1.5.0.ebuild 2342 SHA256 9fbdc394359cacdcec49465bd76629963b4aaab5bc31afe9701c9881034d43d1 SHA512 d7753df674ae31200f373bf7abdfb3fe2364b6540881008b2790b60c9a7096f7a0a3c903fe79788ce12313001a4064d64b2d1a7405785823e8c8cee7165df6ae WHIRLPOOL fae7ad9bf6c08716fb7662af4dc2958814f5e768e4449f141da34f4436cf61270323855e76f627e0b91656ebdfc30a362b80aad65066c1859367c1aab0320a2c
|
||||
MISC ChangeLog 1327 SHA256 e96530e424d98f21eab231ffab6b358c81ae0c4aa40a3d7483d30c17a2e94605 SHA512 fba5484925993eb61f85a160e8300a0812309db7a4026dcc99c1e3e6af50813cd77f0d5d110b54dfb8ceda9513bca855a9c7cc3eae2a86fb386c7c413081a64c WHIRLPOOL b921a924b70bc1ace2d7b4653fb4a962467dad8ae48e24af1fe7cc9f23a9dfd7499f07eb32677a74f2a5036f0dc6ef73c29c1e6b3a2c3c1ee7a7b6c5c8b69576
|
||||
MISC metadata.xml 234 SHA256 f35b97f99a26d73cc441e1d93bfe25aaa4e9f7f6d90c8d05a74f7b7bc5b68472 SHA512 59d8156b3ca3e99c40d5a2a32de7edf2eb53279b2424998862589d6bad77617d23fc852afec0a92f8ac5bb54a88ebc504cc0641029c1936412e90ab03dfdd447 WHIRLPOOL 935a1401910a42f888c991e443a49275ea8b87976c5aa977f670053d97d18754231749749bc92d37d4b5f45ecf65914480942a11b5827b6c08fb24313a428431
|
||||
|
|
|
@ -6,7 +6,7 @@ EAPI="5"
|
|||
|
||||
inherit eutils user
|
||||
|
||||
DESCRIPTION="GitLab CI Multi Runner is the new build processor needed for GitLab CI >= 7.12"
|
||||
DESCRIPTION="GitLab CI Multi Runner is the build processor needed for GitLab CI 8.11"
|
||||
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 )
|
||||
|
@ -92,7 +92,7 @@ pkg_postinst() {
|
|||
|
||||
pkg_config() {
|
||||
einfo "You need to register the runner with your GitLab CI instance. Please"
|
||||
einfo "Follow the instructions on"
|
||||
einfo "Follow the instructions at"
|
||||
einfo
|
||||
einfo "https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/linux-manually.md"
|
||||
einfo
|
|
@ -1,3 +1,14 @@
|
|||
22 Aug 2016; Manuel Friedli <manuel@fritteli.ch>
|
||||
-files/gitlab-shell-2.0.0-config-paths.patch, -gitlab-shell-3.0.0.ebuild,
|
||||
-gitlab-shell-3.2.0.ebuild:
|
||||
dev-vcs/gitlab-shell: purged all versions <gitlab-shell-3.2.1
|
||||
|
||||
*gitlab-shell-3.4.0 (22 Aug 2016)
|
||||
|
||||
22 Aug 2016; Manuel Friedli <manuel@fritteli.ch> +gitlab-shell-3.4.0.ebuild:
|
||||
dev-vcs/gitlab-shell: added gitlab-shell-3.4.0. this is a dependency of
|
||||
gitlab-ce-8.11.0
|
||||
|
||||
*gitlab-shell-3.2.1 (27 Jul 2016)
|
||||
|
||||
27 Jul 2016; Manuel Friedli <manuel@fritteli.ch> +gitlab-shell-3.2.1.ebuild:
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
AUX gitlab-shell-2.0.0-config-paths.patch 1356 SHA256 442a8e18b4d8e6092db0d39659cba5e41404e90f21070ed50b5460177f28f1b2 SHA512 0445cd42086b2d77825c487d604ddcb11f8fdf4eb8dcdfa1fe1b8e8c24d7b8f273834dbec0bfbb763a35a74605d558cc8d3feaa056eb02a113d18124a764551e WHIRLPOOL 0e3367b229ea4f13818fe2e485dc8da83ad695aec496881cb5eb918b183029b0013518ca64acba1568d93dc418dfaf083c2a86b9f2e3adf9fe15cad038011b30
|
||||
AUX gitlab-shell-3.2.0-config-paths.patch 1826 SHA256 c83db7c37dcac577ce499eab4bb0168253f49d303ba1991fdec90d13cc3fe37a SHA512 7524b6b8cd7cd141a56c468efa303b1d21576ac9e03cb866cbf9dcac34e1b8d4f356333737050e2e5dfeb0f0ad904b3f548c40e1209c1f35054ed2027b1d8271 WHIRLPOOL fdbd2dfe43ff4a2af97227fbf8c4589ca3734ebf0320b7e9c5e8ea39882c49d45815a0ee3c765a141affacbe48f4063987b9664a918e0e216b49ca46a475cc5f
|
||||
DIST gitlab-shell-3.0.0.tar.gz 68088 SHA256 3b00daa0e003b73a34f20ed06b4c0298b33099600de7832bec25bfbce525d779 SHA512 97874a4a76240b73e3dac93510910fde847d0ccb8906011412091769345a2efef82bd187609ea2596b6a7b1838fa144eb62f9e246f4aea396df96316f18121e9 WHIRLPOOL 378b9f9a879e4c011fb0714387aa0f24616e6cb8c19084431923cc24853212e0319dffe5081a0b556dca41712e5015538a7038548bcd737cd9116fecbb2421c9
|
||||
DIST gitlab-shell-3.2.0.tar.gz 68796 SHA256 a279d78f1439b13f9f96c6cc1507175040732aab25954b1e6a41445b336d1460 SHA512 836b94fdff10daafa54ad672752eb8fcf1acc4f238a7c47a0795669ffcbfd0c892abd49c4102cb07bcc0350867a7bc53acecffe5b0eb46849f1fae0b38200c25 WHIRLPOOL cb536713dd2352d94e657313c717f3c13f50c1056e30391f31a6bfdc82b559c8738d722b95aa194d1c4182923198cf4defda7c1c31e00fa360b132a2c610398c
|
||||
DIST gitlab-shell-3.2.1.tar.gz 68788 SHA256 ad21f8676901b9d90a1c8016b5fe2ad73f9a7966ab378ce244b12fc0373e9f46 SHA512 2280b5ea529d1efff365b1f72ded2af71c7cd19c88c1d7638f730044c5a804a0adb8670685b2016b26e894755a0b70f365d234c95e4ca3bf09913d7b6bebca76 WHIRLPOOL e21d77c00a02105babe4cf84c7ff9223131eef5e7e1db80d06b40bae87d225b579f4fbdca4ac2809be436f96b25753f73b354e6d03ad1b22ad57bfac7c720ae9
|
||||
EBUILD gitlab-shell-3.0.0.ebuild 3516 SHA256 5ae386bd0f8960b1d068530a5b8502651c76cb43195502f76551a4249a510efc SHA512 ed9d009a894ee3ae2f1d140aec64f8c9ad4013178419f87f96e57f5cda4dbd7b099436568cf3d718d25753e405d859bb7bc8aea2c4683a14b024b942503eaa13 WHIRLPOOL b325873e31a1b5b8afaa4ba3678ae8435c20678b5ad720482283f48ba217f48cfe50c533b13c7e9bfb4e32719dc8155512d743b7f7db3dae6262e07612519331
|
||||
EBUILD gitlab-shell-3.2.0.ebuild 3509 SHA256 55b1f12be58f972793adc90dc952e7f09d7a2cee3591d9ba40f42a503f22b9cb SHA512 fe5d78bf082e9bd53acf4326764d3a99c509c3a8bde7af7d6edd294e35c1c4cca808a38d5a91f090fcf20922b91f2a2efb33db410e3041b5a998164b35e34d78 WHIRLPOOL 2777285c7ac88b68d99fb60b0dea2725bdcade41bca08eeb30b666b9ed6c0867db6e54438da884ec558455c8e01801cb622b584073c6a6c14bb22828eaaf19d8
|
||||
DIST gitlab-shell-3.4.0.tar.gz 71972 SHA256 0ac8f18b1615194943e935b670d630a1ba9870ad876f7486256972c7be1d45d4 SHA512 1138e02dbf5169547e39eea87ac88f05009424c76f26b4b0f2cb3882eaefc9d7aa11e167c6d9309947da728fc5381a234b93e25a0ded4f87eb8d8c88baaa2b9c WHIRLPOOL ef9ff2b349af97019da56c2e0b850fc4885ad036074e7bce39ba6f12bea611b771becc5ebf3e1889a71078243488bbf7c93ed90e545844b36aeb42b79265ab2c
|
||||
EBUILD gitlab-shell-3.2.1.ebuild 3653 SHA256 e8043271a1a42664862a4284a185ee11c7fc6c133a1b3c7dfb44b748d705cc3d SHA512 0232d94c21d675b1e8762a2de1d95a36bf41afc97435d84e54dd93bbf190cacbbfd426e6e6253c5f2f894c5d3ff7c878c261df7714d477c4332beeb433fea223 WHIRLPOOL 02fa858649c50c040fc16930c5f7f35dcb9d9df2d693898dd930cc945d0d5f264b52009cde063fafbaae78aecfab6dcf6d6f03fb9e4c2f9444300e8fd514175a
|
||||
MISC ChangeLog 678 SHA256 9f9189571066a0bf35ca4647472790074c914ccbafc88620acc206cd81ca8bf7 SHA512 193ca08208434a87b26ccaac1d98d562e79346d4261159d2bdabb448eea713b5252c1278ff5b5bd2431cd555d7f529967aa8d8f4b1786afb33696a549ebaad56 WHIRLPOOL 28174489e18ab1f0a8f05e942700c7716aa1389e6312264f88ef60085fd56dda0aa899433b1a872602d6101c4e043aed67f1bdb072500806ced12485498e0737
|
||||
EBUILD gitlab-shell-3.4.0.ebuild 3653 SHA256 7bf777fc3b5bda03f9a455874f62bb6260eeb73dd8727e4145ed0cda2e283465 SHA512 de5b78133d317155f5764d6888d421c4f2945ccb5972c032c05138344188eb0a0f85817431aa4348e2074667c901f44cf2b575f572aeb2620aab58a32ddba22b WHIRLPOOL e53de830c17bc9c784df06670c6fdc7465ba05ca40de42e4857e5a83421208f9bbb4381c2988fbabc85f86476d5c2b7301123392de132558bdd6f969726a9a57
|
||||
MISC ChangeLog 1110 SHA256 c43ec8d94e3186c9bfd4c1ffa84a302d9889914969316d7157c2959985600326 SHA512 b709fedc11c89fbd7032a45c68ae7967285ce41f543cab491dce232a570a5024b5bec8a0e7facbd169637434d027280054f60819afd5e0569c33947e1dd2ea25 WHIRLPOOL ce0dd267c7c52bf8763f2875401654c9cf003b64fe8f7eeca846d5424c9aad44637bc6b64838069e75211107dc4e85c9dbe5467b044011fe4340bf6811dcac67
|
||||
MISC metadata.xml 234 SHA256 f35b97f99a26d73cc441e1d93bfe25aaa4e9f7f6d90c8d05a74f7b7bc5b68472 SHA512 59d8156b3ca3e99c40d5a2a32de7edf2eb53279b2424998862589d6bad77617d23fc852afec0a92f8ac5bb54a88ebc504cc0641029c1936412e90ab03dfdd447 WHIRLPOOL 935a1401910a42f888c991e443a49275ea8b87976c5aa977f670053d97d18754231749749bc92d37d4b5f45ecf65914480942a11b5827b6c08fb24313a428431
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
diff --git a/config.yml.example b/config.yml.example
|
||||
index 94eb593..3d60f48 100644
|
||||
--- a/config.yml.example
|
||||
+++ b/config.yml.example
|
||||
@@ -19,10 +19,10 @@ http_settings:
|
||||
# Give the canonicalized absolute pathname,
|
||||
# REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!!
|
||||
# Check twice that none of the components is a symlink, including "/home".
|
||||
-repos_path: "/home/git/repositories"
|
||||
+repos_path: "/var/lib/git/repositories"
|
||||
|
||||
# File used as authorized_keys for gitlab user
|
||||
-auth_file: "/home/git/.ssh/authorized_keys"
|
||||
+auth_file: "/var/lib/git/.ssh/authorized_keys"
|
||||
|
||||
# Redis settings used for pushing commit notices to gitlab
|
||||
redis:
|
||||
@@ -36,7 +36,7 @@ redis:
|
||||
|
||||
# Log file.
|
||||
# Default is gitlab-shell.log in the root directory.
|
||||
-# log_file: "/home/git/gitlab-shell/gitlab-shell.log"
|
||||
+# log_file: "/var/log/gitlab/gitlab-shell.log"
|
||||
|
||||
# Log level. INFO by default
|
||||
log_level: INFO
|
||||
diff --git a/lib/gitlab_config.rb b/lib/gitlab_config.rb
|
||||
index c97743b..97f4658 100644
|
||||
--- a/lib/gitlab_config.rb
|
||||
+++ b/lib/gitlab_config.rb
|
||||
@@ -8,7 +8,7 @@ class GitlabConfig
|
||||
end
|
||||
|
||||
def home
|
||||
- ENV['HOME']
|
||||
+ "/var/lib/git"
|
||||
end
|
||||
|
||||
def repos_path
|
||||
@@ -36,7 +36,7 @@ class GitlabConfig
|
||||
end
|
||||
|
||||
def log_file
|
||||
- @config['log_file'] ||= File.join(ROOT_PATH, 'gitlab-shell.log')
|
||||
+ @config['log_file'] ||= "/var/log/gitlab/gitlab-shell.log"
|
||||
end
|
||||
|
||||
def log_level
|
|
@ -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.4
|
||||
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}."
|
||||
}
|
|
@ -8,9 +8,13 @@ USE_RUBY="ruby20 ruby21"
|
|||
|
||||
inherit eutils ruby-ng user
|
||||
|
||||
MY_PV="v${PV/_/-}"
|
||||
MY_GIT_COMMIT="3043b31c458bf720843a84b35c9fbad5c1488c1d"
|
||||
|
||||
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"
|
||||
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"
|
||||
|
@ -28,7 +32,7 @@ ruby_add_bdepend "
|
|||
MERGE_TYPE="binary"
|
||||
|
||||
RUBY_PATCHES=(
|
||||
"${P}-config-paths.patch"
|
||||
"${PN}-3.2.0-config-paths.patch"
|
||||
)
|
||||
|
||||
GIT_USER="git"
|
|
@ -1,3 +1,14 @@
|
|||
*gitlab-workhorse-0.7.10 (22 Aug 2016)
|
||||
|
||||
22 Aug 2016; Manuel Friedli <manuel@fritteli.ch>
|
||||
+files/fix-Makefile-0.7.10.patch, +gitlab-workhorse-0.7.10.ebuild:
|
||||
dev-vcs/gitlab-workhorse: added ebuild for gitlab-workhorse-0.7.10. this is a
|
||||
dependeny of gitlab-ce-9999
|
||||
|
||||
22 Aug 2016; Manuel Friedli <manuel@fritteli.ch>
|
||||
-files/fix-Makefile-0.7.7.patch, -gitlab-workhorse-0.7.7.ebuild:
|
||||
dev-vcs/gitlab-workhorse: purged all versions <gitlab-workhorse-0.7.8
|
||||
|
||||
26 Jul 2016; Manuel Friedli <manuel@fritteli.ch>
|
||||
-files/fix-Makefile-0.7.1.patch, -files/fix-Makefile-0.7.6.patch,
|
||||
-gitlab-workhorse-0.7.1.ebuild, -gitlab-workhorse-0.7.6.ebuild:
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
AUX fix-Makefile-0.7.7.patch 397 SHA256 5923fe2acd4c7ab4a425345cc95cdfce9da5fa9a6630624c97424a567602ccd8 SHA512 3e2304d38bbd52b4a130564a36e4318ad7c96150f31411c8729bbe62b1b0f3b4e82ccf9f9a1ad579e2bab96665765970a8b50a303b4faf178170c95c5bb841b8 WHIRLPOOL de1748c9c79e08c07fd264e24591a5665867d13f5bb23d8cfce0a0249e7127a38f04bcc95c0a7427f247af10e8b661bc219d2275e08b06a058cb6293e0f383f7
|
||||
AUX fix-Makefile-0.7.10.patch 380 SHA256 1d046041dc63129ecdd726a1dc3a35853344493f4dfad60ed4ef4942ae38191c SHA512 d647fe047007e297f13be67997fc156c8b6f6eb53ca711e2b2b531260184029c611921a71d43ca78ac404d302dc23b356d6aaf47204c9015e2f5f11ea44b8522 WHIRLPOOL de148ab791b98cec0922b462bed5b4d39eafcd327cbf885f0a64b3971a36ac9121233973d019957973c821dabc7b1ef1ea7fbfa788b8ea39d0d808bd9a093d4f
|
||||
AUX fix-Makefile-0.7.8.patch 397 SHA256 491e085466e5e653bb7adc13458fae4c2fa96e87d53ffcd16af1a012f7fddd05 SHA512 27ee0a6e40db1b02acd4c4b67e7d47045af93b063391ec2546340bd5b3b20e057e924b713549b35a2c0073eb62fea1f451073de4b311fa1fdb154421efdc4950 WHIRLPOOL 4475084cb5667ac3460c5c82fd68699125feec26dc54c68abbb20ba0e38e27c1ddd1bf39bb97e28dc7c9f6220e4db0db3f8d0d9571edbe3e591dae64881fd386
|
||||
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.7.7.tar.bz2 28097 SHA256 6b18467ca987e898c7b948e9306e215a4a37c94e03fa5c1d3bf36c13cd3a149e SHA512 8053d8091f6b3687dbc866278aeeb4ab5df706536085bf3182a712c4147a1f8db70f0fc5d96043ed92b9d569d83b979507aba20073cc05cfa8ad637d8119ec36 WHIRLPOOL 27d4fb645f51045db6282063b47952e2ac8503a198b1d9f60e502a905463d49461b13cd40914e73ec8efef7b128d66cc77f09128aeb1c17fc461b0459f04f606
|
||||
DIST gitlab-workhorse-0.7.10.tar.bz2 29153 SHA256 df2c81175abe11608df89e1965f4f823f3cd0cac1650cce3bc2c6927dbda0b28 SHA512 17028df034b0fc5063f1ef1067061d1f3e2f38b7848daf242d806cf0abc1e97ebc7fce269c472ef450ba7d33e720554edcc300e1902d71b7b518fb67ee4abb5f WHIRLPOOL a1f5d056509a624279da526bd3a7b134177aafdec66467d121f050f2355406b3bd81a4fa6b7e4f81cc273dee7010e59a61986e69810fe766bf6322f741ff9515
|
||||
DIST gitlab-workhorse-0.7.8.tar.bz2 28253 SHA256 0823495288304a4e2c6491fb011d509ccabea8af765bd35e47e6e5b1da52a599 SHA512 392d1a11da1f61fa5e319d8cf5fc2f158cbc90baaedbd98f33a992cc938f67efe5837e9731c8b4b8d1e8265620c5ae69ced3326eb376aa1cc691457eb6fbc002 WHIRLPOOL fa61930d4a8ecad35b3d27f46da731623f6e41898485d564403ee53badd793824afdf1376c0e0cf6e2e6e30cbf205091db3e416841f60bf6ff905504714ca1be
|
||||
EBUILD gitlab-workhorse-0.7.7.ebuild 918 SHA256 42fe96bd48d1db6764075287040198b9363788ae7327b8ce59c1e06a10009c50 SHA512 b398f6c402d1934658c675a4e075daf5375d98da898e3187454d8b02f6f31a028f5661d39eb753b4136844bf531f76868217d2d78277e4667c8f87261e3137ce WHIRLPOOL a1145879b65f1434309b2420b2cb2391750247aecf321132740b7afd609d8e4f325d084f351c72174db28f05343fc1e5b20d15512ffc9d876962828905d2abcf
|
||||
EBUILD gitlab-workhorse-0.7.10.ebuild 918 SHA256 62e03ff726da9c3b850d58b1b94d7006ccbe6a49318cb5c4934e02c4da7c1ea9 SHA512 93faa1ae71c6832bbaa296c4c3f1f5added09e15580715d8968fbda8e8a67418f66fd257185628d6abafdf3a66f5a93a4a7743c2a7d0966c08a21566045f04e7 WHIRLPOOL ef78add24d1455e41c61855dc6b1f386036505cb468400f8e8f5b0dde45909713fed363dcc82f5164966568a0e4287eb848ba8cdfa24d720714421b3cfad6883
|
||||
EBUILD gitlab-workhorse-0.7.8.ebuild 918 SHA256 e3d95d2e627772b1bb034134890e1f9422ad419d2ac57e55337a16e68b847466 SHA512 ee391c4ec21da9a04f1abbca7067aa3dd70b405cb271fab417ea7d023cbe874b05f70d1dd5f08f6d75bb7a16d02d80e0634aad3848dc3cdf95a9c6da8448fc62 WHIRLPOOL 7e27afa5c674c931dd96e1df0b1f2e74741039025d9c2f8937589a52af62acdec46f41eff201404904d5c7b1f7748aeaea091196a68ec7b2f9758f4bad519e34
|
||||
MISC ChangeLog 1257 SHA256 d065aec4075c54bb1abab76f5fde0cc7a305eee5f3864991d682d4ae57f0bc49 SHA512 84a2256474efae43c23af16011695c8dfe6e8f68b164d3c004e77b5531df4dc98d4f89f930e295db4340f58e83edfc7ff31d77330e3eaefef52c72d35c49d463 WHIRLPOOL ca8edecd7891f1c6a68ad65ee67d6b3fc59c11f5719e1304679445911391647c7f87ccdc4f98915cd1ec5b76b67694974ee1a56b967cc9ede9c4308371fccd63
|
||||
MISC ChangeLog 1721 SHA256 29a65b45c086d6da1fa70ef93efe443e010faa440bf92c5d4d8d224412815f83 SHA512 99f6dd99e91a63151dffe9723507130be264cc2bb4d9f3f943c68438af08f4dc7ce07c670ca70984f547e270f6165a28ee83a19c50e84faf6ef78569bc602b2b WHIRLPOOL 15cd1a7fbc91baaa644253c4f7306917a0f7312abcafdff8fe4345fa7cbe6923a5d01d303a120c59390ecdb37a290bcb0709e5f0edea6f28e7ffba2d51792e13
|
||||
MISC metadata.xml 234 SHA256 f35b97f99a26d73cc441e1d93bfe25aaa4e9f7f6d90c8d05a74f7b7bc5b68472 SHA512 59d8156b3ca3e99c40d5a2a32de7edf2eb53279b2424998862589d6bad77617d23fc852afec0a92f8ac5bb54a88ebc504cc0641029c1936412e90ab03dfdd447 WHIRLPOOL 935a1401910a42f888c991e443a49275ea8b87976c5aa977f670053d97d18754231749749bc92d37d4b5f45ecf65914480942a11b5827b6c08fb24313a428431
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
diff --git a/Makefile b/Makefile
|
||||
index 9b3146d..b3c0630 100644
|
||||
index 5ac82e5..63a967b 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,5 +1,5 @@
|
||||
-PREFIX=/usr/local
|
||||
-VERSION=$(shell git describe)-$(shell date -u +%Y%m%d.%H%M%S)
|
||||
+PREFIX=${DESTDIR}/usr
|
||||
+VERSION=v0.7.7-$(shell date -u +%Y%m%d.%H%M%S)
|
||||
export GOPATH=$(shell pwd)/_build
|
||||
+VERSION=v0.7.10-$(shell date -u +%Y%m%d.%H%M%S)
|
||||
BUILD_DIR = $(shell pwd)
|
||||
export GOPATH=${BUILD_DIR}/_build
|
||||
GOBUILD=go build -ldflags "-X main.Version=${VERSION}"
|
||||
PKG=gitlab.com/gitlab-org/gitlab-workhorse
|
|
@ -9,7 +9,7 @@ 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=v${PV} -> ${P}.tar.bz2"
|
||||
S="${WORKDIR}/${PN}-v${PV}-4c3320e7cfa3be7a697fd2e94e02e5380b137b79"
|
||||
S="${WORKDIR}/${PN}-v${PV}-73e8288744223ef8561ab6dc090df014b024aba6"
|
||||
RESTRICT="mirror"
|
||||
|
||||
LICENSE="MIT"
|
|
@ -1,3 +1,18 @@
|
|||
22 Aug 2016; Manuel Friedli <manuel@fritteli.ch> gitlab-ce-9999.ebuild:
|
||||
www-apps/gitlab-ce: updated ebuild for gitlab-9999 (git master)
|
||||
|
||||
22 Aug 2016; Manuel Friedli <manuel@fritteli.ch> -gitlab-ce-8.10.1.ebuild,
|
||||
-gitlab-ce-8.10.2.ebuild, -gitlab-ce-8.10.3.ebuild, -gitlab-ce-8.10.4.ebuild,
|
||||
-gitlab-ce-8.9.6.ebuild:
|
||||
www-apps/gitlab-ce: purged all versions older than gitlab-ce-8.10.6
|
||||
|
||||
*gitlab-ce-8.11.0 (22 Aug 2016)
|
||||
|
||||
22 Aug 2016; Manuel Friedli <manuel@fritteli.ch>
|
||||
+files/gitlab-ce-8.11.0-fix-redis-config-path.patch, +gitlab-ce-8.11.0.ebuild:
|
||||
www-apps/gitlab-ce: added gitlab-ce-8.11.0. this version contains the new
|
||||
issue board!
|
||||
|
||||
*gitlab-ce-8.10.6 (18 Aug 2016)
|
||||
|
||||
18 Aug 2016; Manuel Friedli <manuel@fritteli.ch> +gitlab-ce-8.10.6.ebuild
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
AUX gitlab-8.10.6-sidekiq.service 1085 SHA256 de97287a5cb1d04dd4b6ac96e3569503cf797e605b325e13d4807d72cbcd7333 SHA512 9d5f3ee50f293ae0c9f353f7f9eeed00c57fd54e75a206bf7ec9b201453099222668e1d77dcfe6b35ee9a8722860551822897339c4741e0c612054a9423f132b WHIRLPOOL 5b5cb94db5c7a2c46b487821baba6fe31fa08ecc1cbae6f9b1655d32f95c57c7c8f1bede19d09a8c572512e40b0c8daf27d50ebfcbc8e4af449e21b01ad11441
|
||||
AUX gitlab-ce-8.11.0-fix-redis-config-path.patch 423 SHA256 4878d37082c7e5c0aba239d4432ddec23c083230b816cf1ed6792bfd8f6c56fa SHA512 81a543af308bcd11a93a73368aedc89604078f60c0cacf4f614ff18dc5975b2c0d030ad6565fbb134188c8f6fceb74f2767f706d6f5701092252513f5e18de11 WHIRLPOOL 81f6258f03d234c6298b7bfe2982bdfd5f86dea3405ce03d4391b484a4802f7cbe33606ce4561ca67c16a5826dec131a185fa3189c2115b4a9ec8a3b87a2ee16
|
||||
AUX gitlab-ce-8.7.5-fix-sendmail-config.patch 705 SHA256 cfc4ffd896e03cc763601aca5cdd5ac43f85152705cbf5a4e9144a6156d6f77e SHA512 a92659db8cab022185d87f321b037b1731612bf5f89b9df4552dd49b843bb49b6019f8ddda96a6fd6cb6544664a1c3d52ca5fee2c11be8b33698cc713219510f WHIRLPOOL 81a6504a8583bc46ea4005d9f8a2113802439161c40f11d3da46332b8980fc6b9520d81d9e32a6555bcdc893245448ba9151a271c511ae87f6468f588d4804b0
|
||||
AUX gitlab-ce-8.9.1-fix-redis-config-path.patch 411 SHA256 d88b8c4d4dcc30d7533bc9cccd735d8ca7b2ae3878938904b1b5ba36e11a810c SHA512 4852edec468d5f62f6e903687a1791fd8cc840f361448a538fb3d42e8a885aa326a7663538145eed7f852f3b66a90b8a0ca9dc90f86534bdcc42e66855a801c9 WHIRLPOOL ffeec14be3859e5640e3348de98f67660eacda7a63ea13b463e6411f516a40d09a9e99d841939c9d4317544f2bb6d813156b461e61be27c08b68a67bc2ecbfd6
|
||||
AUX gitlab-mailroom.service 773 SHA256 39cea460db7fc505b136a2106902d0515890180e74913bf364aa499368fc5f2e SHA512 f82c63a180add1103e2bd115e67826ad7362a844991ef16f1de7fc6c78bf1955155ecf278fc0d759e674ab85736f3ba2a6650d00e9b3ce683316875efd9efa3c WHIRLPOOL 683c67b12f9666d1c1df5ec61e0072acaecd3aff43d0ff475037e178bc58fd9036ae6d8cd45e922098c842abd057231afd4767ce229d4581356f153b48a06208
|
||||
|
@ -8,20 +9,12 @@ AUX gitlab-unicorn.init 3126 SHA256 124354df8a929ae5b9df4f044c46684758a585ddc703
|
|||
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.10.1.tar.gz 21035550 SHA256 8fe9c994b87f4ef819b14c8149b07a594a8f624285e6f80f888a63978b3c9ef8 SHA512 00d762c65d24cdebe05b3a31e9577500f437c0c64711c121b3967a9ebf3f711dc94cf08e8cc3fe1a3919236acce019e149ce1c64dd8ad0f43d9f298b9d76a167 WHIRLPOOL c3bfe435b8018c0488e760d115c6a290a13f8eaebd900201a807a386a62a0aeace04e4e7daa24f500347676b5aab760efbcbb1daf252aaefd6a73033b382a4fb
|
||||
DIST gitlab-ce-8.10.2.tar.gz 21038115 SHA256 71cba117f895beb96278b81ec09d60d46189f71024cb2e1db14628206d64c26e SHA512 d9fccb2530357835e647ecbbd04e825154cb9b780c4d67210b3cd5598418e377af90046c10a1b192e8b4ea99b77ad0b6ac734e237360c4c179338003ce24463f WHIRLPOOL bfe3eb27576a31d5abcc1bb60824ce06feb78c1c15b0a94a514707ba536db0d37be00db0ebc3a6c83b0533b0bfb80d01e9bcd851545703ea4ac398a12e6fc866
|
||||
DIST gitlab-ce-8.10.3.tar.gz 21039284 SHA256 4d00eab29d24e03b36e61d74544cccda0eb3acccbe09efb91b9670d70116f74b SHA512 e66c5a5919352c78f8fbb983dc17d5ba5e39bed7e335b031d599eb827315c4253ee59d2955ba50df9c3923003595519ee4bfd4e67dfd0c6bd4d47c61ac576350 WHIRLPOOL 38cf4cdaf4c89529f345c5eb2723fbeb986012d5f3e8732d9d527c6497a1ddfb124806888759d9f256c57e13b1be843ef7d0a6f8725ab89bb4e5b45a9c080805
|
||||
DIST gitlab-ce-8.10.4.tar.gz 21039911 SHA256 cce5d0cce05cacc260baeda3014bf192b931d897fb72588cc91c2eff15481db6 SHA512 d89aa1b91b7584b45c63aff6aea646b261415e15e95bcdbd3c3a9dd8ce127fa3a4fd22e15d9464d3b572bc2ba202f6ee518d1937515d8d69d435c5cb59835080 WHIRLPOOL 0929eb1703771c57292cbc5711091d84c22b4fe960cfaa5e8714f101622197bff65ee3f1d7a0619daa4a9acd2d1dc6ce3bf35153045a22c43623ed5b3413d661
|
||||
DIST gitlab-ce-8.10.6.tar.gz 21039451 SHA256 8c7313ce49dfec816ba74187f920960229f3740d2a433582d48d8f03ac0ffd71 SHA512 aed0a8760eec42ebe059b271134ccad644092a2ce0a7f51a1f338428edbe045d636bf115450fd55ecce500445a94bccece6a7a4ec32f6cc0fbde8f5c3d879dcd WHIRLPOOL 69b3c694d27020edeeacd8da6f2826cbf7c704cd4b11387ac3baf07ec07b37b8374fc73256d39b132f51f49e8038dce16db8eb266dd807acd126a0de1584e244
|
||||
DIST gitlab-ce-8.11.0.tar.gz 25292875 SHA256 581f228ea5caaa872d180b5864929070b18d16f565bf265a237f85f57fbe04c7 SHA512 41f9a192118ef7a044ed587e45ef6aa7fdd90bc002dd893a201cfcc2b367c6eb1137ea7f4969ac4caec284e68a92b1b1af46218764ea1f9b0ff18257b4dec925 WHIRLPOOL 4b79dab88def24af0c3f71222e14cfc7314132185c14993c8085b1d00ea61250496ca9e2c97b9e8d0d3303440184f500caf7ea16524ab2c1330c83d9766ecd40
|
||||
DIST gitlab-ce-8.11.0_rc1.tar.gz 21523791 SHA256 1c3217bb1253359335025e6b5222cd1a8a274d108c02b896553af6b79ad40f9c SHA512 7d82a98f9505c6e9afc275ae6ba52b9a03752baca22f2890ba4ac9507ec331962223257602652657fcabfccef891b50dcb3dbbf30dc57080246f941f33d19dc3 WHIRLPOOL bbde9b27f3cf6b7dab1158927e22ded2f12e2d2568334ef3e140a879ff668d55bb09deed1617e2accbaf4909a68b1983ce56798019f5a0e2ce277c4500d24e76
|
||||
DIST gitlab-ce-8.9.6.tar.gz 21555571 SHA256 1b357ed1157a2a20b647004f588b67d72416df805a385fa7b605905bafb26f55 SHA512 d4693cdc80fff44e2f2d2e640163337b153ee08fbd12cefd055c8a595e1487010f7c0db39a11056577d331d3a76cc7da9936139199aad324d9c324395f684f9a WHIRLPOOL 00474d385cd9b574bbef0847f80613253f4543c54b356ab654b0ca3e7233e056efbe995a9de3e418c68d482d4a2b9b0cf676941c7013755bd795bfe83c9766aa
|
||||
EBUILD gitlab-ce-8.10.1.ebuild 11676 SHA256 18467061975ce0212ddb08cb12b4d2d9f2da6f7999e9d42dd249d96891326318 SHA512 ee1538902ef35fe4f771211eacd0c7fb81aaa81c4b18049111eead6a5ada19318763165245e3e6d05fd41490e0ee4d30ab6fcc946b35e31e1a3f41b200cc46c9 WHIRLPOOL cfad8b037071a70bedf8095cd29cd27d2c703dc9470f4ee943860716e01e7347e78cd9a6612c44fd749a8cb06d6979376493606ab941266ce732e285dc7e3edc
|
||||
EBUILD gitlab-ce-8.10.2.ebuild 11677 SHA256 d131e1f22e6ab5d5dfbeca80128ce0838631c82f71cb7f11dbf58d3aec9c2ed6 SHA512 e2530f1f2f2b31ebd4a6adcfacb512d4579baaf69aa2adfb7fd8fd9408966d5454cebdf4441ebc016ff89fa2dbe61ec19239f6e39844e0d3b0a44ec0f73d3cf4 WHIRLPOOL 30d1aa4d499013205953c70210edf6962a4da78ce3c1d11c98d2b048eb57e2d45991a4a2dda34c5c5269dc077ae67cbee76e4859b1c0897b6377673a6f451fb4
|
||||
EBUILD gitlab-ce-8.10.3.ebuild 11677 SHA256 1d2e22b1611203ad6d2fe3752a9cffceee7568a876c5b650cb52d12f089e4dbb SHA512 3784835943745d42c5f086b5183c2947c903fd67a19569a6fdd903a68f55fbc09fdd7d667e0fa0fca9871bd299587759f7bb133edba2135eb260e91f16ac6a59 WHIRLPOOL af68d6b67236e8bd683f070e97c4277997822ec9b8bcfa4ac0a4c54edfd470e5fff107d8a5ae2017b1f70f5a4f2c845f6bc40caf9387030540b823c380ff03f2
|
||||
EBUILD gitlab-ce-8.10.4.ebuild 11677 SHA256 d6ed052547aebde8708b4624c3a522ea66e86afdde950d2ec8704659c3bf2ce2 SHA512 ca3348dc51e1214f13746ce7d681fd8202dd46f742bb30a040970e467c589be132375fdcf57b5780e61b9179a244075f4f5537e49442025caee6e46c2a073dba WHIRLPOOL 5a2bd77a585a32103d699e3f4d99eef6f3659dc316217a80b7b2937d0ed93365784299724156546df09ff6aa7ee01c962359a4c89a22fe8e94aef8027b6839a9
|
||||
EBUILD gitlab-ce-8.10.6.ebuild 11710 SHA256 1659a2e43491488fa6fbbee1699cc4138e8938f694e73310e5faf45fbd9f2578 SHA512 70304f8fe862988d4092dd37c5a66fdfec56c9cb2d62a78f2cdf365a0c629606c6fb9081dbdc7e68530d43894d1cb645d168db8f3f0c8a9999873afd9032ec52 WHIRLPOOL dbf26294a9d6eb4258a67c64844370f1423fa59210b306bc66ea53a902cbc564b1cd084b765759e93d7970df30417e6482dfbbf271dda8d387ef006837123ac3
|
||||
EBUILD gitlab-ce-8.11.0.ebuild 11703 SHA256 f95aa4a60c85da0155df6b989e343296eba23a6c2f12055c5f94bee53f5d9bc0 SHA512 6d1c7c3e3139d456a7b22431b326401a9b56e435000a02a572bfdbb52c5495e098b0406ab9b8051a2a901878e3a3a2c4332af9a0bf50ff1a36051f9436c1ddbe WHIRLPOOL bd92de9d5fda4a4b1802e814a55ea1e1a9848a9e085b9ad88ba108771dc68953156c8cecde64ef2250eba8f2b9568f73969460aa61c4901957d9b7771558ed9c
|
||||
EBUILD gitlab-ce-8.11.0_rc1.ebuild 11654 SHA256 a73c20f2671fa997bab4b715c7cd2d40f74e1900a96d5805c8a16139fd367736 SHA512 a8af8ffb14f2f190885597f1afa9cd3d2460c47933d45c49f60cffc5f57631b63b04b2a162ed9d520a64146f6d8701699640b9718475d6adbdf61399efd00cfa WHIRLPOOL 7eb709c573f046f519410d7ccfd1e5f2f662e253355243bdc1bf35cc9021f554fd4b0da07beb9826247a70a345d411ef4e6e2f12b3098227da4847d356268495
|
||||
EBUILD gitlab-ce-8.9.6.ebuild 12341 SHA256 a46bb7c78639ee411a8c0994847f4f90a89133f2d85e7eb71f76f9f6756e5c25 SHA512 19712bb3ece7873e9dc2a5d471512a553108b95338bd370dab8dfac6695da34ee713d4d106c62de1472eab7e3e953471ad6274f7d646900e7ef2c7521460211b WHIRLPOOL 1cdff895e32079e2bd85863d46a3c6c0f39590e454f7c77d058f7403341ab39adf477005a9c6c417ec7ca527bffedf0ec1ec3b3f64cb242c3b2d3404c41b6e8f
|
||||
EBUILD gitlab-ce-9999.ebuild 12347 SHA256 8a0f60ef3cb5ba17a782702d9cb6273c1a6217e067a2f88968b052fd21873061 SHA512 6fe3bab97466c0decc017eb95ad98717cdff9f55b4ef10823a92075781afd4d73141843fe097318a9caf821d529f2daa20c3550de80bd57ed7871784725e7979 WHIRLPOOL 36e3d61644100a4137d66cd7c91e97ad9e6f35e9bd8b17b79bc7d99383f018159ea4322f15ebf7487935c720c8c9df51412df2dde4d584b5fd276b801e0cf017
|
||||
MISC ChangeLog 4697 SHA256 3579dc4318fc8ab27e99b11dc32d030af1a5756478e8ae13c376b7bedbe60539 SHA512 9144516b792006631a0ffa3b77fb82e0f92b0634ea954c4fb7f81aaa184a9480c3bf1a8b50739e8d4edc7abba9250f3282caebba947e7f5ac36e784663c954b0 WHIRLPOOL e6fd5697d31b6be9cba7feab455097684ddcd095792f749c3265d3e84b383c42517777780b0376d5231dad93cb7975a3d7da5253a96b1ef958df4b6db93e1c51
|
||||
EBUILD gitlab-ce-9999.ebuild 11644 SHA256 049dcd6ae1eedc7816fc0e1052b868ee3099e902316c751f395d5f1be5139d2d SHA512 f0c664af009419c6ef2f6bca661c5f9656f258ecbcf980d9b02a1920bc1049ac55409b2ff6c451b0eb7129f943b4263efba81b254e42d815f7089af057b01fc5 WHIRLPOOL 7e66b8d3e512709d8ec6ce59d9d87ef3664a12901fc5de478e204e3e7bebd11b3b26c9c996679eeecae10667e9a885e815dcadf49a41baeb0094148cec779f26
|
||||
MISC ChangeLog 5353 SHA256 ec609588575a93774d5ce3f75653fbc90a29db598eff012de58d18dc3d1c38f9 SHA512 0a91171c659a410e979ce854170fdef2b74c6c4e28a6eb7e1df04303e2741ded2a21c0b272570a0010039f6288e49c690b119ac5b72efb9fd51e23cd98d4cfbe WHIRLPOOL 6dc13ae5519184c02136742244661f3061edd8721b5f5f9fd9f1dfbf8750d964624559a153b367bdd5a01a984ff4d08f859d0820682b38d9c68b289220574166
|
||||
MISC metadata.xml 545 SHA256 1b7fc44d811e1ab7638fe4a40253f49d5f1071872d3020c22c4f67662750cb2f SHA512 86f47d297892bccfefa087d93936296f5647993a9ec8e3f47907a6859cbf385e5bc6f00502d7836c9e8d9efef2b6725bf145b0150924c2082b2bd164469ef6ea WHIRLPOOL 6bfb8a55684d68c8bfa6e025a0be965f7b815394ee0896dd2a13cfb524e3cf3f3149acc9072897e30a1842060389576aac07ea8beb4a8b0bfc3e8eab3723f2a1
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/config/mail_room.yml b/config/mail_room.yml
|
||||
index c639f82..860e78d 100644
|
||||
--- a/config/mail_room.yml
|
||||
+++ b/config/mail_room.yml
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
:mailboxes:
|
||||
<%
|
||||
- require_relative "lib/gitlab/mail_room" unless defined?(Gitlab::MailRoom)
|
||||
+ require_relative "/opt/gitlab/lib/gitlab/mail_room" unless defined?(Gitlab::MailRoom)
|
||||
config = Gitlab::MailRoom.config
|
||||
|
||||
if Gitlab::MailRoom.enabled?
|
|
@ -1,381 +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_PV="v${PV/_/-}"
|
||||
MY_GIT_COMMIT="97a7ad76ccfb08361b1a18a71b71bfec3f21eb68"
|
||||
|
||||
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 ~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-3.2.1
|
||||
>=dev-vcs/git-2.7.4
|
||||
~dev-vcs/gitlab-workhorse-0.7.8
|
||||
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}-8.7.5-fix-sendmail-config.patch"
|
||||
"${PN}-8.9.1-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/${MY_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() {
|
||||
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
|
||||
|
||||
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 $@"
|
||||
}
|
|
@ -1,381 +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_PV="v${PV/_/-}"
|
||||
MY_GIT_COMMIT="131ea30ba13aec76c5d62c107be2074b8221ebef"
|
||||
|
||||
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 ~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-3.2.1
|
||||
>=dev-vcs/git-2.7.4
|
||||
~dev-vcs/gitlab-workhorse-0.7.8
|
||||
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}-8.7.5-fix-sendmail-config.patch"
|
||||
"${PN}-8.9.1-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/${MY_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() {
|
||||
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
|
||||
|
||||
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 $@"
|
||||
}
|
|
@ -1,381 +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_PV="v${PV/_/-}"
|
||||
MY_GIT_COMMIT="942d997cf3c596e0b1fc8ac0b750d40afffa57e4"
|
||||
|
||||
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 ~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-3.2.1
|
||||
>=dev-vcs/git-2.7.4
|
||||
~dev-vcs/gitlab-workhorse-0.7.8
|
||||
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}-8.7.5-fix-sendmail-config.patch"
|
||||
"${PN}-8.9.1-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/${MY_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() {
|
||||
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
|
||||
|
||||
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 $@"
|
||||
}
|
|
@ -16,7 +16,7 @@ USE_RUBY="ruby21"
|
|||
inherit eutils ruby-ng user systemd
|
||||
|
||||
MY_PV="v${PV/_/-}"
|
||||
MY_GIT_COMMIT="ee0488d18efbf4fe3103b0d83b2056c1bebc50cf"
|
||||
MY_GIT_COMMIT="346e677ef9db2a27c3ee69d420563ecc564e5afe"
|
||||
|
||||
DESCRIPTION="GitLab is a free project and repository management application"
|
||||
HOMEPAGE="https://about.gitlab.com/"
|
||||
|
@ -54,7 +54,7 @@ CDEPEND="
|
|||
virtual/pkgconfig"
|
||||
COMMON_DEPEND="
|
||||
${GEMS_DEPEND}
|
||||
=dev-vcs/gitlab-shell-3.2*
|
||||
~dev-vcs/gitlab-shell-3.4.0
|
||||
>=dev-vcs/git-2.7.4
|
||||
~dev-vcs/gitlab-workhorse-0.7.8
|
||||
kerberos? ( !app-crypt/heimdal )
|
||||
|
@ -79,7 +79,7 @@ ruby_add_bdepend "
|
|||
#
|
||||
RUBY_PATCHES=(
|
||||
"${PN}-8.7.5-fix-sendmail-config.patch"
|
||||
"${PN}-8.9.1-fix-redis-config-path.patch"
|
||||
"${P}-fix-redis-config-path.patch"
|
||||
)
|
||||
|
||||
MY_NAME="gitlab"
|
||||
|
@ -206,14 +206,11 @@ all_ruby_install() {
|
|||
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_newunit "${FILESDIR}/gitlab-8.10.6-sidekiq.service" "gitlab-sidekiq.service"
|
||||
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
|
||||
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
|
||||
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
|
||||
|
@ -233,6 +230,9 @@ all_ruby_install() {
|
|||
|
||||
newinitd "${T}/${rcscript}" "${MY_NAME}"
|
||||
fi
|
||||
|
||||
# fix permissions
|
||||
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
|
@ -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-3.0*
|
||||
>=dev-vcs/git-2.7.4
|
||||
>=dev-vcs/gitlab-workhorse-0.7.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.
|
||||
# fix-redis-config-path:
|
||||
# Point to the absolute location of redis_config.rb
|
||||
#
|
||||
RUBY_PATCHES=(
|
||||
"${PN}-8.7.5-fix-sendmail-config.patch"
|
||||
"${PN}-8.9.1-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 $@"
|
||||
}
|
|
@ -52,9 +52,9 @@ CDEPEND="
|
|||
virtual/pkgconfig"
|
||||
COMMON_DEPEND="
|
||||
${GEMS_DEPEND}
|
||||
>=dev-vcs/gitlab-shell-3.2.1
|
||||
>=dev-vcs/gitlab-shell-3.4.0
|
||||
>=dev-vcs/git-2.7.4
|
||||
>=dev-vcs/gitlab-workhorse-0.7.8
|
||||
>=dev-vcs/gitlab-workhorse-0.7.10
|
||||
kerberos? ( !app-crypt/heimdal )
|
||||
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )"
|
||||
DEPEND="
|
||||
|
@ -77,7 +77,7 @@ ruby_add_bdepend "
|
|||
#
|
||||
RUBY_PATCHES=(
|
||||
"${PN}-8.7.5-fix-sendmail-config.patch"
|
||||
"${PN}-8.9.1-fix-redis-config-path.patch"
|
||||
"${PN}-8.11.0-fix-redis-config-path.patch"
|
||||
)
|
||||
|
||||
MY_NAME="gitlab"
|
||||
|
@ -209,14 +209,11 @@ all_ruby_install() {
|
|||
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_newunit "${FILESDIR}/gitlab-8.10.6-sidekiq.service" "gitlab-sidekiq.service"
|
||||
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
|
||||
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
|
||||
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
|
||||
|
@ -236,6 +233,9 @@ all_ruby_install() {
|
|||
|
||||
newinitd "${T}/${rcscript}" "${MY_NAME}"
|
||||
fi
|
||||
|
||||
# fix permissions
|
||||
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
|
@ -286,8 +286,6 @@ pkg_postinst() {
|
|||
}
|
||||
|
||||
pkg_config() {
|
||||
local shell_conf='/etc/gitlab-shell.yml'
|
||||
|
||||
einfo "Checking configuration files"
|
||||
|
||||
if [ ! -r "${CONF_DIR}/database.yml" ]; then
|
||||
|
@ -296,23 +294,6 @@ pkg_config() {
|
|||
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})"
|
||||
|
||||
|
|
Loading…
Reference in a new issue