Merge branch '88-add-ebulids-with-important-security-fix-and-remove-vulnerable-ebuilds' into 'master'
www-apps/gitlab-ce: Added ebuilds containing important security fixes Closes #88 See merge request !154
This commit is contained in:
commit
4bb45d6421
10 changed files with 24 additions and 2029 deletions
|
@ -1,3 +1,17 @@
|
||||||
|
*gitlab-ce-8.15.8 (21 Mar 2017)
|
||||||
|
*gitlab-ce-8.16.8 (21 Mar 2017)
|
||||||
|
*gitlab-ce-8.17.4 (21 Mar 2017)
|
||||||
|
|
||||||
|
21 Mar 2017; Manuel Friedli <manuel@fritteli.ch> +gitlab-ce-8.15.8.ebuild,
|
||||||
|
+gitlab-ce-8.16.8.ebuild, +gitlab-ce-8.17.4.ebuild, -gitlab-ce-8.15.4.ebuild,
|
||||||
|
-gitlab-ce-8.15.7.ebuild, -gitlab-ce-8.16.4.ebuild, -gitlab-ce-8.16.5.ebuild,
|
||||||
|
-gitlab-ce-8.16.6.ebuild, -gitlab-ce-8.17.0.ebuild, -gitlab-ce-8.17.2.ebuild,
|
||||||
|
-gitlab-ce-8.17.3.ebuild:
|
||||||
|
www-apps/gitlab-ce: Added ebuilds containing important security fixes These
|
||||||
|
versions contain the security fixes: - v8.15.8 - v8.16.8 - v8.17.4 Removed
|
||||||
|
all older ebuilds, as they are vulnerable. For more information see:
|
||||||
|
https://about.gitlab.com/2017/03/20/gitlab-8-dot-17-dot-4-security-release/
|
||||||
|
|
||||||
*gitlab-ce-8.17.3 (13 Mar 2017)
|
*gitlab-ce-8.17.3 (13 Mar 2017)
|
||||||
|
|
||||||
13 Mar 2017; Manuel Friedli <manuel@fritteli.ch> +gitlab-ce-8.17.3.ebuild,
|
13 Mar 2017; Manuel Friedli <manuel@fritteli.ch> +gitlab-ce-8.17.3.ebuild,
|
||||||
|
|
|
@ -13,24 +13,14 @@ AUX gitlab-mailroom.service 773 SHA256 39cea460db7fc505b136a2106902d0515890180e7
|
||||||
AUX gitlab-unicorn.service 773 SHA256 010c9e223a30400d9155b39499eb0d7efad23b66baab9fcd9e365c689086b9bd SHA512 0bf9630aa91ed8f590a7bfa42d09b7ba33f6342b43b3d191c792c11157f8926c2a2ac2390eebd8179637e29b5bf68233d4699d62463497a0fd45b9bdbdd9167b WHIRLPOOL fbc709a5550dcc548a35c22c812dafe52ee507f5678b57c22c709ee89a399ae9109e2f56b7a13135d4140f1e024ebc4effe4aa4de13e0f36691da2a0737d9792
|
AUX gitlab-unicorn.service 773 SHA256 010c9e223a30400d9155b39499eb0d7efad23b66baab9fcd9e365c689086b9bd SHA512 0bf9630aa91ed8f590a7bfa42d09b7ba33f6342b43b3d191c792c11157f8926c2a2ac2390eebd8179637e29b5bf68233d4699d62463497a0fd45b9bdbdd9167b WHIRLPOOL fbc709a5550dcc548a35c22c812dafe52ee507f5678b57c22c709ee89a399ae9109e2f56b7a13135d4140f1e024ebc4effe4aa4de13e0f36691da2a0737d9792
|
||||||
AUX gitlab-workhorse.service 930 SHA256 09348a52fec333b4b19828752e0484400c1efa9dfb644723fcf8e80537e294b6 SHA512 6332024fe0049287899cf482b6e4439e9dd90da14e489d08aa8e5e79cb7872efcc517d99b69fa23b011b382acb1e5926496a78f08af5d2d64daa515b869a0c6a WHIRLPOOL 3749c6719b2a35c7de29763cd616e1e9cc30a85aa1630ffc46440334459b5922503d52629556c125a6dd6574bdc5f23f1b2a7f2a85e2270a415b22246e0b6bae
|
AUX gitlab-workhorse.service 930 SHA256 09348a52fec333b4b19828752e0484400c1efa9dfb644723fcf8e80537e294b6 SHA512 6332024fe0049287899cf482b6e4439e9dd90da14e489d08aa8e5e79cb7872efcc517d99b69fa23b011b382acb1e5926496a78f08af5d2d64daa515b869a0c6a WHIRLPOOL 3749c6719b2a35c7de29763cd616e1e9cc30a85aa1630ffc46440334459b5922503d52629556c125a6dd6574bdc5f23f1b2a7f2a85e2270a415b22246e0b6bae
|
||||||
AUX gitlab.conf 27 SHA256 cd9be088bbb67a5400407fc6f63c061eb224f16748b7d0812ff2c101f43ca263 SHA512 909c49fee6d050c1e94b2559ff2a9d54c5c346492be0e2920b50d56d69eaddbed67e3ac12e012d2a9601b5596640ebf33c8dc68fc588a03ca370d963294be37f WHIRLPOOL fa436e8d7d2643d450259d26b6e7b24dae69df47ed22e5ef2a567f37aa785fbf3b0eb1129ae7c8bf8986c29559fc3b744a34064375e5245dce2b10053cd715d9
|
AUX gitlab.conf 27 SHA256 cd9be088bbb67a5400407fc6f63c061eb224f16748b7d0812ff2c101f43ca263 SHA512 909c49fee6d050c1e94b2559ff2a9d54c5c346492be0e2920b50d56d69eaddbed67e3ac12e012d2a9601b5596640ebf33c8dc68fc588a03ca370d963294be37f WHIRLPOOL fa436e8d7d2643d450259d26b6e7b24dae69df47ed22e5ef2a567f37aa785fbf3b0eb1129ae7c8bf8986c29559fc3b744a34064375e5245dce2b10053cd715d9
|
||||||
DIST gitlab-ce-8.15.4.tar.gz 20029958 SHA256 5d9df84b82e8b453f61f822fce44afb9603d03b3de23d73c855ce12f7629a33a SHA512 1e2315343ba2efb521bc5dc197b63f7b3af895327de76d1823345d6d39921d9a995b65f6211b572c07cf4a4583bcaf7e6f1ef159b38a7b7b1aa731e2f653c3ff WHIRLPOOL c85e4a389dec2d8807a158447eafb1062b2e1c70eb243f898c5155a26af92c99dba7bcf60217a51c26afbcb3e04ce996177b6e90cd4a0199f8fdc2c79c575ed8
|
DIST gitlab-ce-8.15.8.tar.gz 20035995 SHA256 9fafd6478a6d165ab6acd6f89f169fe72d46df547efe1bf3ac8d3a5bc4ffec11 SHA512 db287ea59d94eacd3c1219f458a403239f7aa39bea0d5e82fac80afc7216b96ac394740ab717c3ed26068617e1234105144820e41b0825511e1adc29e8891bfb WHIRLPOOL b03faf4b30b5c82535c0e148edec7fb5ff26405cfa8587b4bd287e834bb5f3eb6ddabd0b5f1472672b4108bdcb6066d63eb1a117e35fedf2c94d63348186afd6
|
||||||
DIST gitlab-ce-8.15.7.tar.gz 20033447 SHA256 3989b21d5eae1ff2293f535b6645b6ba948c5cdc08eed853153d873e677aabc6 SHA512 c12de7d5f6686cd73e25c81f3ac184bb60ad826d9ba52ca50bf137b1f85094f986a1fa8ef695d8f4f0f1e678b4a139691a3cb6132267f3b17a037a565a8e7193 WHIRLPOOL 9dad2c8aba85d522b22f7eaeb56984750ea2fb415f6e5b892b1002d31725def5415d55b27d0e69d041e8cccc44e7e6aec4d128bfc98225f6dde16558764c58ef
|
DIST gitlab-ce-8.16.8.tar.gz 20907499 SHA256 b6ca6aebb5facb7b0bf792ac36fa6643098ddcbfd5364bf966311b48a2a0e68e SHA512 a5b77e39133078bc98a5c2d0b463e31c99eaaa44c28c70921546a8dfd45e24ff64bc310f8d067c40b609c3b19d13761afbc6068866e00297cb14b0e343b1a00c WHIRLPOOL 150c5b396703007e3b91f73407f5558045dcf4be74c2a12850e65bb7b5280582a8907312f5c09febb17649f98dbe40dd18968e69ef66d6026d3f69b79e6515c0
|
||||||
DIST gitlab-ce-8.16.4.tar.gz 20899790 SHA256 0ee69f010f2306a6b1d7fda377a0780951560880c974f62b8ab15935ddd93930 SHA512 a81ed04326262569a4d0112476624efafebf8fad8296fd6866881bb280abc5e9f7275bbe94d6d5e8c40491d88422368349a34066206fb60dcef3578f9ab0ccd1 WHIRLPOOL f5d3d84bb0c5fedddc195326603911abec19c8d0de95e26ccdb1db10df195288e3ecf1ad6aa04e1a778b6987418466508f4080888fcfa1847825916141cc87eb
|
|
||||||
DIST gitlab-ce-8.16.5.tar.gz 20900898 SHA256 74a73992d18d97b426ea36ca2c975f4d1d44d7e66602b2fa76a18b267e90bbe2 SHA512 cf77252542571104c74b9ad932812f9fc36dd31703ff653bf23933c7e2165cc9927482025d63ca1863af17634785c22be944a8ac17c27cc06924cf832ef0b591 WHIRLPOOL bb916c79a33158160754348ec8227c84303850a525781422a1fc718330cc34baad5efbb111165df0e0e14a6ee7f6c89c19c976708116b2fecb3e686f281330e9
|
|
||||||
DIST gitlab-ce-8.16.6.tar.gz 20901900 SHA256 5b88dd855afc44da2b8f059056321fc0dd4cb7c2a97811c6c3ec65c3b44e1d8d SHA512 b6fdf4e8df787ea5812c9c6baf29cf86fcc440be7f1c8fd31410ccc93459208999f25956d8561d3a789ff75c6e112e396db79cd0fa3d959dd8b1b382ccb5d7b4 WHIRLPOOL 17b2203a1d1b36f814df781aaee1faafcf336794fa7c1792868685cb6ab4e7e7eb1de916b34fb28ba72be38d760187de48b8ac2b36bf4b722bf799f60e6b1c96
|
|
||||||
DIST gitlab-ce-8.17.0.tar.gz 22991847 SHA256 3883c2e505e511f83072f950b9d211783148b97e29f34144e57c8b180d7f4518 SHA512 e0ee1b1ab21a6ad262cccbb2abf544ccb18dafcaf61e83aa02bac0182bdd35a47a725741382876f3bb79f6f42764c59b7a992c16a916a1673a716417b34d8a87 WHIRLPOOL fe3c36e41d0fe3c3420a3e52dc61fc30f424d2832cd82587a6e50b6c6450ee9e99bb2897f87cc949b4663055a35e159cf7b6f471b6aa9046c6bb8b1fae526ab7
|
|
||||||
DIST gitlab-ce-8.17.0_rc3.tar.gz 23031572 SHA256 13ac75ce0737e9e9f46fea59828a0a71f3ad9fc4436859bc68938d4719190ba9 SHA512 c5998f7aeefd65ea46ee6357f15bc6e60253742f6007252bf9a1543f29f8973951f8d0f8d60dba87b08dbf5256427e9bf28198274a9dadb92b30b7f5adc76cd1 WHIRLPOOL 86380fedcacbd18f13b12f4792b506421726c4226512471eeeda8d085abc89e6b43f54b0301e0cbdb1f3afe6dade84452690576435220c0afc559bcd5f341df3
|
DIST gitlab-ce-8.17.0_rc3.tar.gz 23031572 SHA256 13ac75ce0737e9e9f46fea59828a0a71f3ad9fc4436859bc68938d4719190ba9 SHA512 c5998f7aeefd65ea46ee6357f15bc6e60253742f6007252bf9a1543f29f8973951f8d0f8d60dba87b08dbf5256427e9bf28198274a9dadb92b30b7f5adc76cd1 WHIRLPOOL 86380fedcacbd18f13b12f4792b506421726c4226512471eeeda8d085abc89e6b43f54b0301e0cbdb1f3afe6dade84452690576435220c0afc559bcd5f341df3
|
||||||
DIST gitlab-ce-8.17.2.tar.gz 22995277 SHA256 6819b8e289b7c23ee1880d935f443bb63896e45f62e2d203dfd87f9b8f90d3ae SHA512 b66b3ee0233641aee27d6cd1748069df8b7a705414f7e5b41875d861f425382f4a7f31639219660db1811fdd0e0655526f7760fb49b4847efb486b37ced11205 WHIRLPOOL ab8c986a08c5cf86b5d4a3a56059827b6c1e561c7c76e72ba3433c589bd3514177019db587eee68aadc1ac0ed8b748e813ccdc2fea3fae9b773979e7829562d0
|
DIST gitlab-ce-8.17.4.tar.gz 22825573 SHA256 daa0d5d75295a896f7aa230bd965e12e8525a52c96ec0456ee405d083180e091 SHA512 4d9244c2575e8c4e26515ef55e478b459b24f3d53426a8d2e7cd253a879c9ae2a770e92e0e4a74cc88242b5b3ec81f6081c789426553ee9c8ff161abd138fb45 WHIRLPOOL a3131dc319b4aaa98c81c2c5104672363f16fb393ee0f21e8be670c9df6788c383f5fba8459352a37b49467f42307a1be291eff5b9d550390df04d9004514986
|
||||||
DIST gitlab-ce-8.17.3.tar.gz 22821238 SHA256 85299a2e10e57ae988483d1a10503e17703d767f6b757f8b07093f0011c58fe5 SHA512 3d73d2b7d48237777871c0c062e8568e083389fae9ba75a0b648bb96ae638e6f4d1f9f0bddc6ab15c5ba21b5d92da792b0fdb83b94cb89b95824a0c937a32de8 WHIRLPOOL 8532172fd004d9b7831299ebcaa165eabbc732af21ace334f903a894ffd673b078be423f13de1734b1170f5e5c4b104847ae27a11d12802048dab1ba77b755b2
|
EBUILD gitlab-ce-8.15.8.ebuild 11982 SHA256 755bfd6fa532a308d3f458db1456f8de4f2c5f599ab76c18653aad9e038d0697 SHA512 9aa439da7dc61687f1cdce5ff693dd1c8c4edc54aaed288ad0368aa1b64d577a7f3752dee149c200c4d98b43a6347c77251cac9f6d3316b5a6d799a17c3ed583 WHIRLPOOL 02393bfd983341632663096e8b293e3611ac5328a58a50a1c7e800e348e866f37aff53ebe447507a84d5966e019265fde94a30716f43b50228437e04abcd932c
|
||||||
EBUILD gitlab-ce-8.15.4.ebuild 11982 SHA256 db794f18bc0d023a8b6adf49b82c2e37fd38b7206b064a7700289c0cfa16961c SHA512 ca30780d28ffc0242ac5f6ccad178cc44464a81f2d44cb13e53ddf06700d0f39b9fee9b77e356735435079b34090049d50d9019af71e92d6d8faaf3767a39dc5 WHIRLPOOL 42ee8b8e5a2c6fba69ecdbf6e306a87f369fa193f721c73481edc744953bfd210cb4495bc603ba01566efb2b0869ec71284a1f1b1c34d1a124bd08546829ca37
|
EBUILD gitlab-ce-8.16.8.ebuild 11982 SHA256 31537d4a6aeb9ff14ab14c9a27dca51a056e94ee75506ad855a1289f32468694 SHA512 01d536fcfb53a7b39943314a34eeeb9c5b5660604a2fb1a1c2dcd1d7e87d19ab0bbc5bc650feaa1db812047c3783a324d7c8a8bce7dd7381033c3d1ca2e64828 WHIRLPOOL 0f3402e30164ee6d5058c51554cc916d91d5975f438074e3193bf3bdb4e323bca4279c19f00cd7bacd01c2eb6cf13e41a0badabd958e9be58d319224f53403b0
|
||||||
EBUILD gitlab-ce-8.15.7.ebuild 11982 SHA256 fab225a8a8a9373898b5c604ce41ed65c4648c46131798315df833326b006fb7 SHA512 ea17dc9927336aed09ba21e0e1c9c4df2998f941a05ff30e9ef9951b5318bcdfb1d332fa8d285a27f26356a9fa9a5f72da45882ab8edbfa6046ec96764dae47f WHIRLPOOL d51629d3c67f8be2636a2e5cb4bb4d4a7b0402394f47aaa01fc182c29f1d3ee916a2d5bb8086bbe871f41294e348ec024d81a775ba9c30028d8b97d93d637620
|
|
||||||
EBUILD gitlab-ce-8.16.4.ebuild 11982 SHA256 91875777d0953bffddd31318d9c5d4666ba59bd3446804d063c1199c603bd5a6 SHA512 7112bf185f25d90a11ee2a6e9d197c1ce781b49c486cc1afaff002ad66dcec7c9b43c3b9b6c26c62d23bb7e8c0fdd4c527e53a99f9674bb4af1e404454960227 WHIRLPOOL 76bd66e8b7d4ff04f02354cb6cdf3fa0b92ccf2cdcad26cf117f12330b3f3588713fd0d0465da2515750348975eb81daa6e02f984025804b7db50da99f4e8e5e
|
|
||||||
EBUILD gitlab-ce-8.16.5.ebuild 11982 SHA256 fd2648d0a2df06b5aa46435061f6d12b1d0d8b6958c2367b96c2f4a11dbf58f1 SHA512 de82deca3c9163959d6c4c2e41e57549506e49a6a1125d37fa7277e4ca00adb74a331dad4c103f8d1b2e80ebbe1511220c23aabc8889005dcc37684c5b3373c3 WHIRLPOOL 1f80a27148caf3b570df9b5c19849e453001ddc2fc78add1040c53cae249feafcb3a0343ad61d22135ba578f9d92137c048dad0f0744737ae326ac74bf08ce7d
|
|
||||||
EBUILD gitlab-ce-8.16.6.ebuild 11982 SHA256 2cc7b8f06153f28ebcc34a5ff8e24be791689c41fc8a780149cdaeb61ffc70d3 SHA512 f9d43d16cac2edbcbc3d144133265b94bbb7dac8ed5266a7ba641cfa6f154eb62462ffff8a37b977559ca892eb20c968eb6f82c2aafbd20ce293f6a6bd7b7e29 WHIRLPOOL 5682849083932171dff509c2142e225992e2724b09987da47bab258fdf45eebaf615cb07739709da2c421eed6fc66f705d6ce35a8d956130598168908ee2f061
|
|
||||||
EBUILD gitlab-ce-8.17.0.ebuild 12831 SHA256 9556fe5712044ebe473b7ff8b847a4daa5ca1818a0ac714f22afc5725199da72 SHA512 4aaa00f4eac87a4bbe598cde792997e25b137eea9fdaf7e7c8394ec5e2abc54302ed5432efe1c7055dc195ca2599f9027463480c943f108bb399daa2eee833f5 WHIRLPOOL aec29db1dc7236f60d2723ec97444fa437a4f8b3092cbf53305f3cddbb6851a40b1a77a306daf4c9780ffe9a8eed760c580371bf95da66b18d884a32c3e48cd5
|
|
||||||
EBUILD gitlab-ce-8.17.0_rc3.ebuild 12258 SHA256 179da162a7ff3ab1fc9f3173aff30c59a73005622ccb0fe8ada57f950c9d0dd7 SHA512 b5f244a7a7ac980b1e1c1595b88613cf6f3649591a9430dac0db3a174432648b05707b0e3e79450f5882fb7044aca6bb3778a19566ad6c83c5fd30ee8c09893e WHIRLPOOL 49cfbbfedfcafecfa8a775bf0e3a8a9daa2fcce3a819ce92ab07ccaaa4b3881221cce5ebf4ec9333b9ed7a884717d037336dc644d359137e06fe5df3f51e9aaa
|
EBUILD gitlab-ce-8.17.0_rc3.ebuild 12258 SHA256 179da162a7ff3ab1fc9f3173aff30c59a73005622ccb0fe8ada57f950c9d0dd7 SHA512 b5f244a7a7ac980b1e1c1595b88613cf6f3649591a9430dac0db3a174432648b05707b0e3e79450f5882fb7044aca6bb3778a19566ad6c83c5fd30ee8c09893e WHIRLPOOL 49cfbbfedfcafecfa8a775bf0e3a8a9daa2fcce3a819ce92ab07ccaaa4b3881221cce5ebf4ec9333b9ed7a884717d037336dc644d359137e06fe5df3f51e9aaa
|
||||||
EBUILD gitlab-ce-8.17.2.ebuild 12831 SHA256 b57a4f683a5eafaa5d0149b0256833e329a757ad470e24bba163c57ba841eeeb SHA512 ed84da9ab62d0893b36a2ade744248b663634c5b05b8e8b608d064068c31a3d19a0e4917f932a0a2caee48a8f509359e50cc982c43bd5d1d958343ea5c5637d9 WHIRLPOOL dfb96d29b45adf5d03313fd9dd6cbc39c70a1736272867737f0bf8d429510add4e3fcd77b329690b9393cc506c9387f4342bed001c2bda50901ba9480fe241d5
|
EBUILD gitlab-ce-8.17.4.ebuild 12928 SHA256 f748d42058293ba4f593fbb36be34ecde332d896d04c610fd3b7e91288c18fbb SHA512 3c2736f9b7df066bb105faffef6ce2b6276fe60a686a7462c630a1b7c7c0296d94e33c7ea25a9f24aa814628f318e2430a3e5ca149783c86ef3fb1132dd01877 WHIRLPOOL cd629ba993df3eaef9c9ec1bf1649aa4cfea5f3787d2207a7016c092bff67175d79c6782d643d4c80b3b5971a98858feaa279a184abc4fd936c7e5c8b291dd28
|
||||||
EBUILD gitlab-ce-8.17.3.ebuild 12928 SHA256 8e79b5c6724ef50b00f1c6eb607af6c4dc44a8ea5a7b2735c016726247043c3e SHA512 7d32ef8db701c1d4570b4071a55e61611f3bbff3f308adee84594c43f4089befc1a8ade8d66f7f36a4f9f6fd0f1f3c8fe6172eda663a5e2bd277646d4e1fdfa7 WHIRLPOOL 36a8c32bddeb51e89da1e314375bec1765e238d4fc1f658a492601b2a46d838993dde921570956e6c43086d9d3e09727b83f99e99168cfe95ef2e4fba6b69e6b
|
|
||||||
EBUILD gitlab-ce-9999.ebuild 12864 SHA256 ae1c00758e08c97414d3fea2ad636be6f01a6d61bac25dad441834316e48152e SHA512 7ee796c04f450733603569cbb7eb351ae145313dec19fbf333563eaad9721af4b03bedd5415471f40bcf42367cdc3eb0cfd6940da6e42284d6e7dae4baebb451 WHIRLPOOL fd1504cf829fdfefc341627f63d3c583304a0b9b7bcfa39b53452f02b13ce859ec3250f0d439711035ef46c7e8adf41c7414fa2a0bb5479fb71c17be8f1340eb
|
EBUILD gitlab-ce-9999.ebuild 12864 SHA256 ae1c00758e08c97414d3fea2ad636be6f01a6d61bac25dad441834316e48152e SHA512 7ee796c04f450733603569cbb7eb351ae145313dec19fbf333563eaad9721af4b03bedd5415471f40bcf42367cdc3eb0cfd6940da6e42284d6e7dae4baebb451 WHIRLPOOL fd1504cf829fdfefc341627f63d3c583304a0b9b7bcfa39b53452f02b13ce859ec3250f0d439711035ef46c7e8adf41c7414fa2a0bb5479fb71c17be8f1340eb
|
||||||
MISC ChangeLog 14662 SHA256 943f84ad5c20e417960eabc5d9ff3013d1e89f289afcfa7c81c12c979257946c SHA512 f3e60d56c5e0166e5ee2990313dc8541bd7570fbb332cfddfb588f24506f0360812e5e45eea820000438fdbaed027e07ca9dc5feb0438568a57c52ecd816e319 WHIRLPOOL 2096d793258acea414ed84f8d892d315f3fd7bf6f1fe6d25d7f75364ddffd964e8ff27bb6a8467051cac9d26ebee70162f3f043143317fd90e7d1fa63faa1fde
|
MISC ChangeLog 15411 SHA256 1b2edffef6bc05e7e4895bbcda069f39e95d6882530277761a955a85b37af4d7 SHA512 71b4a0b8e39e97f271e50c7cdc5c189fdcc1cfd0b7fc972ade2ef58b6785ba0371aab302bc729d0ee204537c4b711f34c401165cf699348951ce0539c6a5d457 WHIRLPOOL f6ddab4988e23a2168c9c824129022662a517e6a20c48c12ab754d123249a8e56007134ec02216b3cc580d4460130c2f649e971ec6c74f2754d38e862303b67b
|
||||||
MISC metadata.xml 665 SHA256 2a0cd67ad42f0cc6d8b88391cf6e3153a9883dab31aae8227c57c95f3f68890d SHA512 64b8fbae373d0a057f705f64c1d097dbfab893bd585e1db65ccdb06cda9569211c9b63fa168ac8de9f6d512a17759ecd20b54d818d2790a6f4c99d0ca73fddc3 WHIRLPOOL a81b21bb46aad9757a502628033eba546c686b83bbf1d651ecabba273c454cfb64574affc180db8358ced87eb638e8ad13d7c79c4cfb9a31e72c577d21ab433e
|
MISC metadata.xml 665 SHA256 2a0cd67ad42f0cc6d8b88391cf6e3153a9883dab31aae8227c57c95f3f68890d SHA512 64b8fbae373d0a057f705f64c1d097dbfab893bd585e1db65ccdb06cda9569211c9b63fa168ac8de9f6d512a17759ecd20b54d818d2790a6f4c99d0ca73fddc3 WHIRLPOOL a81b21bb46aad9757a502628033eba546c686b83bbf1d651ecabba273c454cfb64574affc180db8358ced87eb638e8ad13d7c79c4cfb9a31e72c577d21ab433e
|
||||||
|
|
|
@ -1,391 +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 ruby23"
|
|
||||||
|
|
||||||
inherit eutils ruby-ng user systemd
|
|
||||||
|
|
||||||
MY_PV="v${PV/_/-}"
|
|
||||||
MY_GIT_COMMIT="a0b13790d398d1e3b16b049eb39ed901487130cd"
|
|
||||||
|
|
||||||
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-4.1.1
|
|
||||||
>=dev-vcs/git-2.8.4
|
|
||||||
~dev-vcs/gitlab-workhorse-1.2.1
|
|
||||||
kerberos? ( !app-crypt/heimdal )
|
|
||||||
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )"
|
|
||||||
DEPEND="
|
|
||||||
${CDEPEND}
|
|
||||||
${COMMON_DEPEND}"
|
|
||||||
RDEPEND="
|
|
||||||
${COMMON_DEPEND}
|
|
||||||
>=dev-db/redis-2.8
|
|
||||||
virtual/mta
|
|
||||||
systemd? ( sys-apps/systemd:0= )"
|
|
||||||
ruby_add_bdepend "
|
|
||||||
virtual/rubygems
|
|
||||||
>=dev-ruby/bundler-1.13.6"
|
|
||||||
|
|
||||||
#
|
|
||||||
# fix-sendmail-config:
|
|
||||||
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
|
|
||||||
# fix-redis-config-path:
|
|
||||||
# Point to the absolute location of redis_config.rb
|
|
||||||
#
|
|
||||||
RUBY_PATCHES=(
|
|
||||||
"01-${PN}-8.7.5-fix-sendmail-config.patch"
|
|
||||||
"02-${PN}-8.11.0-fix-redis-config-path.patch"
|
|
||||||
"03-${PN}-8.14.0-database.yml.patch"
|
|
||||||
"04-${PN}-8.12.7-fix-check-task.patch"
|
|
||||||
"05-${PN}-8.12.7-replace-sys-filesystem.patch"
|
|
||||||
)
|
|
||||||
|
|
||||||
MY_NAME="gitlab"
|
|
||||||
MY_USER="git" # should be same as in gitlab-shell
|
|
||||||
|
|
||||||
DEST_DIR="/opt/${MY_NAME}"
|
|
||||||
CONF_DIR="/etc/${MY_NAME}"
|
|
||||||
LOGS_DIR="/var/log/${MY_NAME}"
|
|
||||||
TEMP_DIR="/var/tmp/${MY_NAME}"
|
|
||||||
|
|
||||||
all_ruby_prepare() {
|
|
||||||
# fix paths
|
|
||||||
local satellites_path="${TEMP_DIR}/repo_satellites"
|
|
||||||
local repos_path=/var/lib/git/repositories
|
|
||||||
local shell_path=/usr/share/gitlab-shell
|
|
||||||
sed -i -E \
|
|
||||||
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
|
|
||||||
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
|
|
||||||
|
|
||||||
local run_path=/run/${MY_NAME}
|
|
||||||
sed -i -E \
|
|
||||||
-e "s|/home/git/gitlab/tmp/(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
|
|
||||||
|
|
||||||
## RC script ##
|
|
||||||
|
|
||||||
if use systemd ; then
|
|
||||||
ewarn "Beware: systemd support has not been tested, use at your own risk!"
|
|
||||||
systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
|
|
||||||
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
|
|
||||||
else
|
|
||||||
local rcscript=gitlab-8.13.3-sidekiq.init
|
|
||||||
use unicorn && rcscript=gitlab-8.13.3-unicorn.init
|
|
||||||
|
|
||||||
cp "${FILESDIR}/${rcscript}" "${T}" || die
|
|
||||||
sed -i \
|
|
||||||
-e "s|@USER@|${MY_USER}|" \
|
|
||||||
-e "s|@GITLAB_BASE@|${dest}|" \
|
|
||||||
-e "s|@LOGS_DIR@|${logs}|" \
|
|
||||||
"${T}/${rcscript}" \
|
|
||||||
|| die "failed to filter ${rcscript}"
|
|
||||||
|
|
||||||
newinitd "${T}/${rcscript}" "${MY_NAME}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# fix permissions
|
|
||||||
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "If this is an update from a previous version, stop your GitLab"
|
|
||||||
elog "instance and issue the following command to perform all required"
|
|
||||||
elog "migrations:"
|
|
||||||
elog " emerge --config \"=${CATEGORY}/${PF}\""
|
|
||||||
elog "PLEASE NOTE: It's HIGHLY recommended to backup your database"
|
|
||||||
elog "before running the config phase. Run these commands (as root):"
|
|
||||||
elog
|
|
||||||
elog " cd /opt/gitlab"
|
|
||||||
elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production"
|
|
||||||
elog
|
|
||||||
elog "If this was a fresh install, follow these steps:"
|
|
||||||
elog
|
|
||||||
elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml."
|
|
||||||
elog
|
|
||||||
elog "2. Configure your database settings in ${CONF_DIR}/database.yml"
|
|
||||||
elog " for \"production\" environment."
|
|
||||||
elog
|
|
||||||
elog "3. Then you should create a database for your GitLab instance, if you"
|
|
||||||
elog " haven't done so already."
|
|
||||||
elog
|
|
||||||
if use postgres; then
|
|
||||||
elog "If you have local PostgreSQL running, just copy&run:"
|
|
||||||
elog " su postgres"
|
|
||||||
elog " psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\"
|
|
||||||
elog " NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\""
|
|
||||||
elog " createdb -E UTF-8 -O gitlab gitlabhq_production"
|
|
||||||
elog " Note: You should change your password to something more random..."
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
elog "4. Finally execute the following command to initialize the environment:"
|
|
||||||
elog " emerge --config \"=${CATEGORY}/${PF}\""
|
|
||||||
elog " Note: Do not forget to start Redis server first!"
|
|
||||||
elog
|
|
||||||
elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and"
|
|
||||||
elog "you can't login after the upgrade, be sure to read the section about the"
|
|
||||||
elog "verification of the CSRF token in GitLab's trouble-shooting guide at"
|
|
||||||
elog "http://goo.gl/5XGRGv."
|
|
||||||
if use postgres; then
|
|
||||||
elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the"
|
|
||||||
elog "`pg_trgm` extension by running the following command as a PostgreSQL"
|
|
||||||
elog "super user for *every* GitLab database:"
|
|
||||||
elog " CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
|
||||||
elog "For details, see the documentation at the GitLab website."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_config() {
|
|
||||||
einfo "Checking configuration files"
|
|
||||||
|
|
||||||
if [ ! -r "${CONF_DIR}/database.yml" ]; then
|
|
||||||
eerror "Copy ${CONF_DIR}/database.yml.* to"
|
|
||||||
eerror "${CONF_DIR}/database.yml and edit this file in order to configure your"
|
|
||||||
eerror "database settings for \"production\" environment."; die
|
|
||||||
fi
|
|
||||||
|
|
||||||
local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)"
|
|
||||||
local git_home="$(egethome ${MY_USER})"
|
|
||||||
|
|
||||||
# configure Git global settings
|
|
||||||
if [ ! -e "${git_home}/.gitconfig" ]; then
|
|
||||||
einfo "Setting git user"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
git config --global user.email '${email_from}';
|
|
||||||
git config --global user.name 'GitLab'" \
|
|
||||||
|| die "failed to setup git name and email"
|
|
||||||
fi
|
|
||||||
|
|
||||||
su -l ${MY_USER} -c "git config --global repack.writeBitmaps true"
|
|
||||||
|
|
||||||
# determine whether this is an update or a fresh install. we do this by
|
|
||||||
# checking whether the ${DEST_DIR}/.git directory exists or not
|
|
||||||
#
|
|
||||||
if [ -d "${DEST_DIR}/.git" ]; then
|
|
||||||
local update=true
|
|
||||||
else
|
|
||||||
local update=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Initialize app ##
|
|
||||||
|
|
||||||
local RAILS_ENV="production"
|
|
||||||
local RUBY=${RUBY:-/usr/bin/ruby}
|
|
||||||
local BUNDLE="${RUBY} /usr/bin/bundle"
|
|
||||||
|
|
||||||
# FIXME: this line existed in older ebuilds, but the variable is
|
|
||||||
# never used. what was it for!?
|
|
||||||
# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
|
|
||||||
|
|
||||||
if [ "${update}" = 'true' ]; then
|
|
||||||
einfo "Migrating database ..."
|
|
||||||
exec_rake db:migrate
|
|
||||||
|
|
||||||
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
|
|
||||||
einfo "Migrating iids ..."
|
|
||||||
exec_rake migrate_iids
|
|
||||||
|
|
||||||
einfo "Cleaning old precompiled assets ..."
|
|
||||||
exec_rake assets:clean
|
|
||||||
|
|
||||||
einfo "Cleaning cache ..."
|
|
||||||
exec_rake cache:clear
|
|
||||||
else
|
|
||||||
# create dummy git repo as workaround for
|
|
||||||
# https://github.com/bundler/bundler/issues/2039
|
|
||||||
einfo "Initializing dummy git repository to avoid false errors from bundler"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
cd ${DEST_DIR}
|
|
||||||
git init
|
|
||||||
git add README.md
|
|
||||||
git commit -m 'Dummy repository'" >/dev/null
|
|
||||||
|
|
||||||
einfo "Initializing database ..."
|
|
||||||
exec_rake gitlab:setup
|
|
||||||
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
|
|
||||||
if ! use systemd ; then
|
|
||||||
elog "You may also run"
|
|
||||||
elog " /etc/init.d/gitlab check"
|
|
||||||
elog " for convenience."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ryaml() {
|
|
||||||
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
exec_rake() {
|
|
||||||
local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV}"
|
|
||||||
|
|
||||||
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 ruby23"
|
||||||
inherit eutils ruby-ng user systemd
|
inherit eutils ruby-ng user systemd
|
||||||
|
|
||||||
MY_PV="v${PV/_/-}"
|
MY_PV="v${PV/_/-}"
|
||||||
MY_GIT_COMMIT="470501f8c8fd6a7f3e26b059e6418a7b840df895"
|
MY_GIT_COMMIT="03782f78e91005a7ce818d6e3225d36143acec62"
|
||||||
|
|
||||||
DESCRIPTION="GitLab is a free project and repository management application"
|
DESCRIPTION="GitLab is a free project and repository management application"
|
||||||
HOMEPAGE="https://about.gitlab.com/"
|
HOMEPAGE="https://about.gitlab.com/"
|
|
@ -1,391 +0,0 @@
|
||||||
# Copyright 1999-2017 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
# Maintainer notes:
|
|
||||||
# - This ebuild uses Bundler to download and install all gems in deployment mode
|
|
||||||
# (i.e. into isolated directory inside application). That's not Gentoo way how
|
|
||||||
# it should be done, but GitLab has too many dependencies that it will be too
|
|
||||||
# difficult to maintain them via ebuilds.
|
|
||||||
#
|
|
||||||
|
|
||||||
USE_RUBY="ruby21 ruby23"
|
|
||||||
|
|
||||||
inherit eutils ruby-ng user systemd
|
|
||||||
|
|
||||||
MY_PV="v${PV/_/-}"
|
|
||||||
MY_GIT_COMMIT="f32ee822d66afcf8d6288d5e2e5660e19b18d5a7"
|
|
||||||
|
|
||||||
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-4.1.1
|
|
||||||
>=dev-vcs/git-2.8.4
|
|
||||||
~dev-vcs/gitlab-workhorse-1.3.0
|
|
||||||
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.13.7"
|
|
||||||
|
|
||||||
#
|
|
||||||
# fix-sendmail-config:
|
|
||||||
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
|
|
||||||
# fix-redis-config-path:
|
|
||||||
# Point to the absolute location of redis_config.rb
|
|
||||||
#
|
|
||||||
RUBY_PATCHES=(
|
|
||||||
"01-${PN}-8.7.5-fix-sendmail-config.patch"
|
|
||||||
"02-${PN}-8.11.0-fix-redis-config-path.patch"
|
|
||||||
"03-${PN}-8.14.0-database.yml.patch"
|
|
||||||
"04-${PN}-8.12.7-fix-check-task.patch"
|
|
||||||
"05-${PN}-8.16.0-replace-sys-filesystem.patch"
|
|
||||||
)
|
|
||||||
|
|
||||||
MY_NAME="gitlab"
|
|
||||||
MY_USER="git" # should be same as in gitlab-shell
|
|
||||||
|
|
||||||
DEST_DIR="/opt/${MY_NAME}"
|
|
||||||
CONF_DIR="/etc/${MY_NAME}"
|
|
||||||
LOGS_DIR="/var/log/${MY_NAME}"
|
|
||||||
TEMP_DIR="/var/tmp/${MY_NAME}"
|
|
||||||
|
|
||||||
all_ruby_prepare() {
|
|
||||||
# fix paths
|
|
||||||
local satellites_path="${TEMP_DIR}/repo_satellites"
|
|
||||||
local repos_path=/var/lib/git/repositories
|
|
||||||
local shell_path=/usr/share/gitlab-shell
|
|
||||||
sed -i -E \
|
|
||||||
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
|
|
||||||
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
|
|
||||||
|
|
||||||
local run_path=/run/${MY_NAME}
|
|
||||||
sed -i -E \
|
|
||||||
-e "s|/home/git/gitlab/tmp/(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
|
|
||||||
|
|
||||||
## RC script ##
|
|
||||||
|
|
||||||
if use systemd ; then
|
|
||||||
ewarn "Beware: systemd support has not been tested, use at your own risk!"
|
|
||||||
systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
|
|
||||||
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
|
|
||||||
else
|
|
||||||
local rcscript=gitlab-8.13.3-sidekiq.init
|
|
||||||
use unicorn && rcscript=gitlab-8.13.3-unicorn.init
|
|
||||||
|
|
||||||
cp "${FILESDIR}/${rcscript}" "${T}" || die
|
|
||||||
sed -i \
|
|
||||||
-e "s|@USER@|${MY_USER}|" \
|
|
||||||
-e "s|@GITLAB_BASE@|${dest}|" \
|
|
||||||
-e "s|@LOGS_DIR@|${logs}|" \
|
|
||||||
"${T}/${rcscript}" \
|
|
||||||
|| die "failed to filter ${rcscript}"
|
|
||||||
|
|
||||||
newinitd "${T}/${rcscript}" "${MY_NAME}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# fix permissions
|
|
||||||
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "If this is an update from a previous version, stop your GitLab"
|
|
||||||
elog "instance and issue the following command to perform all required"
|
|
||||||
elog "migrations:"
|
|
||||||
elog " emerge --config \"=${CATEGORY}/${PF}\""
|
|
||||||
elog "PLEASE NOTE: It's HIGHLY recommended to backup your database"
|
|
||||||
elog "before running the config phase. Run these commands (as root):"
|
|
||||||
elog
|
|
||||||
elog " cd /opt/gitlab"
|
|
||||||
elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production"
|
|
||||||
elog
|
|
||||||
elog "If this was a fresh install, follow these steps:"
|
|
||||||
elog
|
|
||||||
elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml."
|
|
||||||
elog
|
|
||||||
elog "2. Configure your database settings in ${CONF_DIR}/database.yml"
|
|
||||||
elog " for \"production\" environment."
|
|
||||||
elog
|
|
||||||
elog "3. Then you should create a database for your GitLab instance, if you"
|
|
||||||
elog " haven't done so already."
|
|
||||||
elog
|
|
||||||
if use postgres; then
|
|
||||||
elog "If you have local PostgreSQL running, just copy&run:"
|
|
||||||
elog " su postgres"
|
|
||||||
elog " psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\"
|
|
||||||
elog " NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\""
|
|
||||||
elog " createdb -E UTF-8 -O gitlab gitlabhq_production"
|
|
||||||
elog " Note: You should change your password to something more random..."
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
elog "4. Finally execute the following command to initialize the environment:"
|
|
||||||
elog " emerge --config \"=${CATEGORY}/${PF}\""
|
|
||||||
elog " Note: Do not forget to start Redis server first!"
|
|
||||||
elog
|
|
||||||
elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and"
|
|
||||||
elog "you can't login after the upgrade, be sure to read the section about the"
|
|
||||||
elog "verification of the CSRF token in GitLab's trouble-shooting guide at"
|
|
||||||
elog "http://goo.gl/5XGRGv."
|
|
||||||
if use postgres; then
|
|
||||||
elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the"
|
|
||||||
elog "`pg_trgm` extension by running the following command as a PostgreSQL"
|
|
||||||
elog "super user for *every* GitLab database:"
|
|
||||||
elog " CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
|
||||||
elog "For details, see the documentation at the GitLab website."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_config() {
|
|
||||||
einfo "Checking configuration files"
|
|
||||||
|
|
||||||
if [ ! -r "${CONF_DIR}/database.yml" ]; then
|
|
||||||
eerror "Copy ${CONF_DIR}/database.yml.* to"
|
|
||||||
eerror "${CONF_DIR}/database.yml and edit this file in order to configure your"
|
|
||||||
eerror "database settings for \"production\" environment."; die
|
|
||||||
fi
|
|
||||||
|
|
||||||
local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)"
|
|
||||||
local git_home="$(egethome ${MY_USER})"
|
|
||||||
|
|
||||||
# configure Git global settings
|
|
||||||
if [ ! -e "${git_home}/.gitconfig" ]; then
|
|
||||||
einfo "Setting git user"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
git config --global user.email '${email_from}';
|
|
||||||
git config --global user.name 'GitLab'" \
|
|
||||||
|| die "failed to setup git name and email"
|
|
||||||
fi
|
|
||||||
|
|
||||||
su -l ${MY_USER} -c "git config --global repack.writeBitmaps true"
|
|
||||||
|
|
||||||
# determine whether this is an update or a fresh install. we do this by
|
|
||||||
# checking whether the ${DEST_DIR}/.git directory exists or not
|
|
||||||
#
|
|
||||||
if [ -d "${DEST_DIR}/.git" ]; then
|
|
||||||
local update=true
|
|
||||||
else
|
|
||||||
local update=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Initialize app ##
|
|
||||||
|
|
||||||
local RAILS_ENV="production"
|
|
||||||
local RUBY=${RUBY:-/usr/bin/ruby}
|
|
||||||
local BUNDLE="${RUBY} /usr/bin/bundle"
|
|
||||||
|
|
||||||
# FIXME: this line existed in older ebuilds, but the variable is
|
|
||||||
# never used. what was it for!?
|
|
||||||
# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
|
|
||||||
|
|
||||||
if [ "${update}" = 'true' ]; then
|
|
||||||
einfo "Migrating database ..."
|
|
||||||
exec_rake db:migrate
|
|
||||||
|
|
||||||
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
|
|
||||||
einfo "Migrating iids ..."
|
|
||||||
exec_rake migrate_iids
|
|
||||||
|
|
||||||
einfo "Cleaning old precompiled assets ..."
|
|
||||||
exec_rake assets:clean
|
|
||||||
|
|
||||||
einfo "Cleaning cache ..."
|
|
||||||
exec_rake cache:clear
|
|
||||||
else
|
|
||||||
# create dummy git repo as workaround for
|
|
||||||
# https://github.com/bundler/bundler/issues/2039
|
|
||||||
einfo "Initializing dummy git repository to avoid false errors from bundler"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
cd ${DEST_DIR}
|
|
||||||
git init
|
|
||||||
git add README.md
|
|
||||||
git commit -m 'Dummy repository'" >/dev/null
|
|
||||||
|
|
||||||
einfo "Initializing database ..."
|
|
||||||
exec_rake gitlab:setup
|
|
||||||
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
|
|
||||||
if ! use systemd ; then
|
|
||||||
elog "You may also run"
|
|
||||||
elog " /etc/init.d/gitlab check"
|
|
||||||
elog " for convenience."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ryaml() {
|
|
||||||
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
exec_rake() {
|
|
||||||
local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV}"
|
|
||||||
|
|
||||||
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,391 +0,0 @@
|
||||||
# Copyright 1999-2017 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
# Maintainer notes:
|
|
||||||
# - This ebuild uses Bundler to download and install all gems in deployment mode
|
|
||||||
# (i.e. into isolated directory inside application). That's not Gentoo way how
|
|
||||||
# it should be done, but GitLab has too many dependencies that it will be too
|
|
||||||
# difficult to maintain them via ebuilds.
|
|
||||||
#
|
|
||||||
|
|
||||||
USE_RUBY="ruby21 ruby23"
|
|
||||||
|
|
||||||
inherit eutils ruby-ng user systemd
|
|
||||||
|
|
||||||
MY_PV="v${PV/_/-}"
|
|
||||||
MY_GIT_COMMIT="064dab12a87341092e2acd1d342c129864c0ddfb"
|
|
||||||
|
|
||||||
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-4.1.1
|
|
||||||
>=dev-vcs/git-2.8.4
|
|
||||||
~dev-vcs/gitlab-workhorse-1.3.0
|
|
||||||
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.13.7"
|
|
||||||
|
|
||||||
#
|
|
||||||
# fix-sendmail-config:
|
|
||||||
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
|
|
||||||
# fix-redis-config-path:
|
|
||||||
# Point to the absolute location of redis_config.rb
|
|
||||||
#
|
|
||||||
RUBY_PATCHES=(
|
|
||||||
"01-${PN}-8.7.5-fix-sendmail-config.patch"
|
|
||||||
"02-${PN}-8.11.0-fix-redis-config-path.patch"
|
|
||||||
"03-${PN}-8.14.0-database.yml.patch"
|
|
||||||
"04-${PN}-8.12.7-fix-check-task.patch"
|
|
||||||
"05-${PN}-8.16.0-replace-sys-filesystem.patch"
|
|
||||||
)
|
|
||||||
|
|
||||||
MY_NAME="gitlab"
|
|
||||||
MY_USER="git" # should be same as in gitlab-shell
|
|
||||||
|
|
||||||
DEST_DIR="/opt/${MY_NAME}"
|
|
||||||
CONF_DIR="/etc/${MY_NAME}"
|
|
||||||
LOGS_DIR="/var/log/${MY_NAME}"
|
|
||||||
TEMP_DIR="/var/tmp/${MY_NAME}"
|
|
||||||
|
|
||||||
all_ruby_prepare() {
|
|
||||||
# fix paths
|
|
||||||
local satellites_path="${TEMP_DIR}/repo_satellites"
|
|
||||||
local repos_path=/var/lib/git/repositories
|
|
||||||
local shell_path=/usr/share/gitlab-shell
|
|
||||||
sed -i -E \
|
|
||||||
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
|
|
||||||
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
|
|
||||||
|
|
||||||
local run_path=/run/${MY_NAME}
|
|
||||||
sed -i -E \
|
|
||||||
-e "s|/home/git/gitlab/tmp/(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
|
|
||||||
|
|
||||||
## RC script ##
|
|
||||||
|
|
||||||
if use systemd ; then
|
|
||||||
ewarn "Beware: systemd support has not been tested, use at your own risk!"
|
|
||||||
systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
|
|
||||||
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
|
|
||||||
else
|
|
||||||
local rcscript=gitlab-8.13.3-sidekiq.init
|
|
||||||
use unicorn && rcscript=gitlab-8.13.3-unicorn.init
|
|
||||||
|
|
||||||
cp "${FILESDIR}/${rcscript}" "${T}" || die
|
|
||||||
sed -i \
|
|
||||||
-e "s|@USER@|${MY_USER}|" \
|
|
||||||
-e "s|@GITLAB_BASE@|${dest}|" \
|
|
||||||
-e "s|@LOGS_DIR@|${logs}|" \
|
|
||||||
"${T}/${rcscript}" \
|
|
||||||
|| die "failed to filter ${rcscript}"
|
|
||||||
|
|
||||||
newinitd "${T}/${rcscript}" "${MY_NAME}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# fix permissions
|
|
||||||
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "If this is an update from a previous version, stop your GitLab"
|
|
||||||
elog "instance and issue the following command to perform all required"
|
|
||||||
elog "migrations:"
|
|
||||||
elog " emerge --config \"=${CATEGORY}/${PF}\""
|
|
||||||
elog "PLEASE NOTE: It's HIGHLY recommended to backup your database"
|
|
||||||
elog "before running the config phase. Run these commands (as root):"
|
|
||||||
elog
|
|
||||||
elog " cd /opt/gitlab"
|
|
||||||
elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production"
|
|
||||||
elog
|
|
||||||
elog "If this was a fresh install, follow these steps:"
|
|
||||||
elog
|
|
||||||
elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml."
|
|
||||||
elog
|
|
||||||
elog "2. Configure your database settings in ${CONF_DIR}/database.yml"
|
|
||||||
elog " for \"production\" environment."
|
|
||||||
elog
|
|
||||||
elog "3. Then you should create a database for your GitLab instance, if you"
|
|
||||||
elog " haven't done so already."
|
|
||||||
elog
|
|
||||||
if use postgres; then
|
|
||||||
elog "If you have local PostgreSQL running, just copy&run:"
|
|
||||||
elog " su postgres"
|
|
||||||
elog " psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\"
|
|
||||||
elog " NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\""
|
|
||||||
elog " createdb -E UTF-8 -O gitlab gitlabhq_production"
|
|
||||||
elog " Note: You should change your password to something more random..."
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
elog "4. Finally execute the following command to initialize the environment:"
|
|
||||||
elog " emerge --config \"=${CATEGORY}/${PF}\""
|
|
||||||
elog " Note: Do not forget to start Redis server first!"
|
|
||||||
elog
|
|
||||||
elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and"
|
|
||||||
elog "you can't login after the upgrade, be sure to read the section about the"
|
|
||||||
elog "verification of the CSRF token in GitLab's trouble-shooting guide at"
|
|
||||||
elog "http://goo.gl/5XGRGv."
|
|
||||||
if use postgres; then
|
|
||||||
elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the"
|
|
||||||
elog "`pg_trgm` extension by running the following command as a PostgreSQL"
|
|
||||||
elog "super user for *every* GitLab database:"
|
|
||||||
elog " CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
|
||||||
elog "For details, see the documentation at the GitLab website."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_config() {
|
|
||||||
einfo "Checking configuration files"
|
|
||||||
|
|
||||||
if [ ! -r "${CONF_DIR}/database.yml" ]; then
|
|
||||||
eerror "Copy ${CONF_DIR}/database.yml.* to"
|
|
||||||
eerror "${CONF_DIR}/database.yml and edit this file in order to configure your"
|
|
||||||
eerror "database settings for \"production\" environment."; die
|
|
||||||
fi
|
|
||||||
|
|
||||||
local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)"
|
|
||||||
local git_home="$(egethome ${MY_USER})"
|
|
||||||
|
|
||||||
# configure Git global settings
|
|
||||||
if [ ! -e "${git_home}/.gitconfig" ]; then
|
|
||||||
einfo "Setting git user"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
git config --global user.email '${email_from}';
|
|
||||||
git config --global user.name 'GitLab'" \
|
|
||||||
|| die "failed to setup git name and email"
|
|
||||||
fi
|
|
||||||
|
|
||||||
su -l ${MY_USER} -c "git config --global repack.writeBitmaps true"
|
|
||||||
|
|
||||||
# determine whether this is an update or a fresh install. we do this by
|
|
||||||
# checking whether the ${DEST_DIR}/.git directory exists or not
|
|
||||||
#
|
|
||||||
if [ -d "${DEST_DIR}/.git" ]; then
|
|
||||||
local update=true
|
|
||||||
else
|
|
||||||
local update=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Initialize app ##
|
|
||||||
|
|
||||||
local RAILS_ENV="production"
|
|
||||||
local RUBY=${RUBY:-/usr/bin/ruby}
|
|
||||||
local BUNDLE="${RUBY} /usr/bin/bundle"
|
|
||||||
|
|
||||||
# FIXME: this line existed in older ebuilds, but the variable is
|
|
||||||
# never used. what was it for!?
|
|
||||||
# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
|
|
||||||
|
|
||||||
if [ "${update}" = 'true' ]; then
|
|
||||||
einfo "Migrating database ..."
|
|
||||||
exec_rake db:migrate
|
|
||||||
|
|
||||||
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
|
|
||||||
einfo "Migrating iids ..."
|
|
||||||
exec_rake migrate_iids
|
|
||||||
|
|
||||||
einfo "Cleaning old precompiled assets ..."
|
|
||||||
exec_rake assets:clean
|
|
||||||
|
|
||||||
einfo "Cleaning cache ..."
|
|
||||||
exec_rake cache:clear
|
|
||||||
else
|
|
||||||
# create dummy git repo as workaround for
|
|
||||||
# https://github.com/bundler/bundler/issues/2039
|
|
||||||
einfo "Initializing dummy git repository to avoid false errors from bundler"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
cd ${DEST_DIR}
|
|
||||||
git init
|
|
||||||
git add README.md
|
|
||||||
git commit -m 'Dummy repository'" >/dev/null
|
|
||||||
|
|
||||||
einfo "Initializing database ..."
|
|
||||||
exec_rake gitlab:setup
|
|
||||||
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
|
|
||||||
if ! use systemd ; then
|
|
||||||
elog "You may also run"
|
|
||||||
elog " /etc/init.d/gitlab check"
|
|
||||||
elog " for convenience."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ryaml() {
|
|
||||||
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
exec_rake() {
|
|
||||||
local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV}"
|
|
||||||
|
|
||||||
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 ruby23"
|
||||||
inherit eutils ruby-ng user systemd
|
inherit eutils ruby-ng user systemd
|
||||||
|
|
||||||
MY_PV="v${PV/_/-}"
|
MY_PV="v${PV/_/-}"
|
||||||
MY_GIT_COMMIT="65cdbdd86f5a0e06a2ca12fc759afe1aef723dbd"
|
MY_GIT_COMMIT="220b52c77d5cbf3db09d2e7c3a6e73d877542501"
|
||||||
|
|
||||||
DESCRIPTION="GitLab is a free project and repository management application"
|
DESCRIPTION="GitLab is a free project and repository management application"
|
||||||
HOMEPAGE="https://about.gitlab.com/"
|
HOMEPAGE="https://about.gitlab.com/"
|
|
@ -1,418 +0,0 @@
|
||||||
# Copyright 1999-2017 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
# Maintainer notes:
|
|
||||||
# - This ebuild uses Bundler to download and install all gems in deployment mode
|
|
||||||
# (i.e. into isolated directory inside application). That's not Gentoo way how
|
|
||||||
# it should be done, but GitLab has too many dependencies that it will be too
|
|
||||||
# difficult to maintain them via ebuilds.
|
|
||||||
#
|
|
||||||
|
|
||||||
USE_RUBY="ruby21 ruby23"
|
|
||||||
|
|
||||||
inherit eutils ruby-ng user systemd
|
|
||||||
|
|
||||||
MY_PV="v${PV/_/-}"
|
|
||||||
MY_GIT_COMMIT="77254ab78e4d1043fa269b46dba31222196c3b8f"
|
|
||||||
|
|
||||||
GITLAB_SHELL_VERSION="4.1.1"
|
|
||||||
GITLAB_WORKHORSE_VERSION="1.3.0"
|
|
||||||
|
|
||||||
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-${GITLAB_SHELL_VERSION}
|
|
||||||
>=dev-vcs/git-2.8.4
|
|
||||||
~dev-vcs/gitlab-workhorse-${GITLAB_WORKHORSE_VERSION}
|
|
||||||
>=net-libs/nodejs-4.3.0
|
|
||||||
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= )"
|
|
||||||
# required bundler >= 1.14.2
|
|
||||||
ruby_add_bdepend "
|
|
||||||
virtual/rubygems
|
|
||||||
>=dev-ruby/bundler-1.13.7"
|
|
||||||
|
|
||||||
#
|
|
||||||
# fix-sendmail-config:
|
|
||||||
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
|
|
||||||
# fix-redis-config-path:
|
|
||||||
# Point to the absolute location of redis_config.rb
|
|
||||||
#
|
|
||||||
RUBY_PATCHES=(
|
|
||||||
"01-${PN}-8.7.5-fix-sendmail-config.patch"
|
|
||||||
"02-${PN}-8.11.0-fix-redis-config-path.patch"
|
|
||||||
"03-${PN}-8.17.0-database.yml.patch"
|
|
||||||
"04-${PN}-8.12.7-fix-check-task.patch"
|
|
||||||
"05-${PN}-8.16.0-replace-sys-filesystem.patch"
|
|
||||||
"06-${PN}-8.17.0-fix-webpack-config.patch"
|
|
||||||
)
|
|
||||||
|
|
||||||
MY_NAME="gitlab"
|
|
||||||
MY_USER="git" # should be same as in gitlab-shell
|
|
||||||
|
|
||||||
DEST_DIR="/opt/${MY_NAME}"
|
|
||||||
CONF_DIR="/etc/${MY_NAME}"
|
|
||||||
LOGS_DIR="/var/log/${MY_NAME}"
|
|
||||||
TEMP_DIR="/var/tmp/${MY_NAME}"
|
|
||||||
|
|
||||||
all_ruby_prepare() {
|
|
||||||
# fix paths
|
|
||||||
local satellites_path="${TEMP_DIR}/repo_satellites"
|
|
||||||
local repos_path=/var/lib/git/repositories
|
|
||||||
local shell_path=/usr/share/gitlab-shell
|
|
||||||
sed -i -E \
|
|
||||||
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
|
|
||||||
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
|
|
||||||
|
|
||||||
local run_path=/run/${MY_NAME}
|
|
||||||
sed -i -E \
|
|
||||||
-e "s|/home/git/gitlab/tmp/(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
|
|
||||||
|
|
||||||
## RC script ##
|
|
||||||
|
|
||||||
if use systemd ; then
|
|
||||||
ewarn "Beware: systemd support has not been tested, use at your own risk!"
|
|
||||||
systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
|
|
||||||
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
|
|
||||||
else
|
|
||||||
local rcscript=gitlab-8.13.3-sidekiq.init
|
|
||||||
use unicorn && rcscript=gitlab-8.13.3-unicorn.init
|
|
||||||
|
|
||||||
cp "${FILESDIR}/${rcscript}" "${T}" || die
|
|
||||||
sed -i \
|
|
||||||
-e "s|@USER@|${MY_USER}|" \
|
|
||||||
-e "s|@GITLAB_BASE@|${dest}|" \
|
|
||||||
-e "s|@LOGS_DIR@|${logs}|" \
|
|
||||||
"${T}/${rcscript}" \
|
|
||||||
|| die "failed to filter ${rcscript}"
|
|
||||||
|
|
||||||
newinitd "${T}/${rcscript}" "${MY_NAME}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# fix permissions
|
|
||||||
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "If this is an update from a previous version, stop your GitLab"
|
|
||||||
elog "instance and issue the following command to perform all required"
|
|
||||||
elog "migrations:"
|
|
||||||
elog " emerge --config \"=${CATEGORY}/${PF}\""
|
|
||||||
elog "PLEASE NOTE: It's HIGHLY recommended to backup your database"
|
|
||||||
elog "before running the config phase. Run these commands (as root):"
|
|
||||||
elog
|
|
||||||
elog " cd /opt/gitlab"
|
|
||||||
elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production"
|
|
||||||
elog
|
|
||||||
elog "If this was a fresh install, follow these steps:"
|
|
||||||
elog
|
|
||||||
elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml."
|
|
||||||
elog
|
|
||||||
elog "2. Configure your database settings in ${CONF_DIR}/database.yml"
|
|
||||||
elog " for \"production\" environment."
|
|
||||||
elog
|
|
||||||
elog "3. Then you should create a database for your GitLab instance, if you"
|
|
||||||
elog " haven't done so already."
|
|
||||||
elog
|
|
||||||
if use postgres; then
|
|
||||||
elog "If you have local PostgreSQL running, just copy&run:"
|
|
||||||
elog " su postgres"
|
|
||||||
elog " psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\"
|
|
||||||
elog " NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\""
|
|
||||||
elog " createdb -E UTF-8 -O gitlab gitlabhq_production"
|
|
||||||
elog " Note: You should change your password to something more random..."
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
elog "4. Finally execute the following command to initialize the environment:"
|
|
||||||
elog " emerge --config \"=${CATEGORY}/${PF}\""
|
|
||||||
elog " Note: Do not forget to start Redis server first!"
|
|
||||||
elog
|
|
||||||
elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and"
|
|
||||||
elog "you can't login after the upgrade, be sure to read the section about the"
|
|
||||||
elog "verification of the CSRF token in GitLab's trouble-shooting guide at"
|
|
||||||
elog "http://goo.gl/5XGRGv."
|
|
||||||
if use postgres; then
|
|
||||||
elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the"
|
|
||||||
elog "`pg_trgm` extension by running the following command as a PostgreSQL"
|
|
||||||
elog "super user for *every* GitLab database:"
|
|
||||||
elog " CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
|
||||||
elog "For details, see the documentation at the GitLab website."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_config() {
|
|
||||||
einfo "Checking configuration files"
|
|
||||||
|
|
||||||
if [ ! -r "${CONF_DIR}/database.yml" ]; then
|
|
||||||
eerror "Copy ${CONF_DIR}/database.yml.* to"
|
|
||||||
eerror "${CONF_DIR}/database.yml and edit this file in order to configure your"
|
|
||||||
eerror "database settings for \"production\" environment."; die
|
|
||||||
fi
|
|
||||||
|
|
||||||
local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)"
|
|
||||||
local git_home="$(egethome ${MY_USER})"
|
|
||||||
|
|
||||||
# configure Git global settings
|
|
||||||
if [ ! -e "${git_home}/.gitconfig" ]; then
|
|
||||||
einfo "Setting git user"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
git config --global user.email '${email_from}';
|
|
||||||
git config --global user.name 'GitLab'" \
|
|
||||||
|| die "failed to setup git name and email"
|
|
||||||
fi
|
|
||||||
|
|
||||||
su -l ${MY_USER} -c "git config --global repack.writeBitmaps true"
|
|
||||||
|
|
||||||
# determine whether this is an update or a fresh install. we do this by
|
|
||||||
# checking whether the ${DEST_DIR}/.git directory exists or not
|
|
||||||
#
|
|
||||||
if [ -d "${DEST_DIR}/.git" ]; then
|
|
||||||
local update=true
|
|
||||||
else
|
|
||||||
local update=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Initialize app ##
|
|
||||||
|
|
||||||
local RAILS_ENV="production"
|
|
||||||
local RUBY=${RUBY:-/usr/bin/ruby}
|
|
||||||
local BUNDLE="${RUBY} /usr/bin/bundle"
|
|
||||||
|
|
||||||
# FIXME: this line existed in older ebuilds, but the variable is
|
|
||||||
# never used. what was it for!?
|
|
||||||
# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
|
|
||||||
|
|
||||||
if [ "${update}" = 'true' ]; then
|
|
||||||
einfo "Migrating database ..."
|
|
||||||
exec_rake db:migrate
|
|
||||||
|
|
||||||
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
|
|
||||||
einfo "Migrating iids ..."
|
|
||||||
exec_rake migrate_iids
|
|
||||||
|
|
||||||
einfo "Installing npm modules ..."
|
|
||||||
exec_npm install
|
|
||||||
|
|
||||||
einfo "Cleaning old precompiled assets ..."
|
|
||||||
exec_rake gitlab:assets:clean
|
|
||||||
|
|
||||||
einfo "Cleaning cache ..."
|
|
||||||
exec_rake cache:clear
|
|
||||||
else
|
|
||||||
# create dummy git repo as workaround for
|
|
||||||
# https://github.com/bundler/bundler/issues/2039
|
|
||||||
einfo "Initializing dummy git repository to avoid false errors from bundler"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
cd ${DEST_DIR}
|
|
||||||
git init
|
|
||||||
git add README.md
|
|
||||||
git commit -m 'Dummy repository'" >/dev/null
|
|
||||||
|
|
||||||
einfo "Initializing database ..."
|
|
||||||
exec_rake gitlab:setup
|
|
||||||
|
|
||||||
einfo "Installing npm modules ..."
|
|
||||||
exec_npm install
|
|
||||||
fi
|
|
||||||
|
|
||||||
einfo "Precompiling assests ..."
|
|
||||||
exec_rake gitlab:assets:compile
|
|
||||||
|
|
||||||
if [ "${update}" = 'true' ]; then
|
|
||||||
ewarn
|
|
||||||
ewarn "This configuration script runs only common migration tasks."
|
|
||||||
ewarn "Please read guides on"
|
|
||||||
ewarn " https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/"
|
|
||||||
ewarn "for any additional migration tasks specific to your previous GitLab"
|
|
||||||
ewarn "version."
|
|
||||||
if use mysql ; then
|
|
||||||
ewarn "PLEASE also read this document about needed migrations on MySQL:"
|
|
||||||
ewarn "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
elog
|
|
||||||
elog "If you want to make sure that the install/upgrade was successful, start"
|
|
||||||
elog "Gitlab now and then run these commands (as root):"
|
|
||||||
elog
|
|
||||||
elog " cd /opt/gitlab"
|
|
||||||
elog " sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production"
|
|
||||||
elog " sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production"
|
|
||||||
elog
|
|
||||||
if ! use systemd ; then
|
|
||||||
elog "You may also run"
|
|
||||||
elog " /etc/init.d/gitlab check"
|
|
||||||
elog " for convenience."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ryaml() {
|
|
||||||
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
exec_rake() {
|
|
||||||
local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV} NODE_ENV=${RAILS_ENV}"
|
|
||||||
|
|
||||||
echo " ${command}"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; export NODE_PATH=${DEST_DIR}/node_modules
|
|
||||||
cd ${DEST_DIR}
|
|
||||||
${command}" \
|
|
||||||
|| die "failed to run rake $@"
|
|
||||||
}
|
|
||||||
|
|
||||||
exec_npm() {
|
|
||||||
local command="npm $@ --${RAILS_ENV}"
|
|
||||||
|
|
||||||
echo " ${command}"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; export NODE_PATH=${DEST_DIR}/node_modules
|
|
||||||
cd ${DEST_DIR}
|
|
||||||
${command}" \
|
|
||||||
|| die "failed to run npm $@"
|
|
||||||
}
|
|
|
@ -1,418 +0,0 @@
|
||||||
# Copyright 1999-2017 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
# Maintainer notes:
|
|
||||||
# - This ebuild uses Bundler to download and install all gems in deployment mode
|
|
||||||
# (i.e. into isolated directory inside application). That's not Gentoo way how
|
|
||||||
# it should be done, but GitLab has too many dependencies that it will be too
|
|
||||||
# difficult to maintain them via ebuilds.
|
|
||||||
#
|
|
||||||
|
|
||||||
USE_RUBY="ruby21 ruby23"
|
|
||||||
|
|
||||||
inherit eutils ruby-ng user systemd
|
|
||||||
|
|
||||||
MY_PV="v${PV/_/-}"
|
|
||||||
MY_GIT_COMMIT="bab14bdb06313f965dab3c4bd0814e260a2be8e0"
|
|
||||||
|
|
||||||
GITLAB_SHELL_VERSION="4.1.1"
|
|
||||||
GITLAB_WORKHORSE_VERSION="1.3.0"
|
|
||||||
|
|
||||||
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-${GITLAB_SHELL_VERSION}
|
|
||||||
>=dev-vcs/git-2.8.4
|
|
||||||
~dev-vcs/gitlab-workhorse-${GITLAB_WORKHORSE_VERSION}
|
|
||||||
>=net-libs/nodejs-4.3.0
|
|
||||||
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= )"
|
|
||||||
# required bundler >= 1.14.2
|
|
||||||
ruby_add_bdepend "
|
|
||||||
virtual/rubygems
|
|
||||||
>=dev-ruby/bundler-1.13.7"
|
|
||||||
|
|
||||||
#
|
|
||||||
# fix-sendmail-config:
|
|
||||||
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
|
|
||||||
# fix-redis-config-path:
|
|
||||||
# Point to the absolute location of redis_config.rb
|
|
||||||
#
|
|
||||||
RUBY_PATCHES=(
|
|
||||||
"01-${PN}-8.7.5-fix-sendmail-config.patch"
|
|
||||||
"02-${PN}-8.11.0-fix-redis-config-path.patch"
|
|
||||||
"03-${PN}-8.17.0-database.yml.patch"
|
|
||||||
"04-${PN}-8.12.7-fix-check-task.patch"
|
|
||||||
"05-${PN}-8.16.0-replace-sys-filesystem.patch"
|
|
||||||
"06-${PN}-8.17.0-fix-webpack-config.patch"
|
|
||||||
)
|
|
||||||
|
|
||||||
MY_NAME="gitlab"
|
|
||||||
MY_USER="git" # should be same as in gitlab-shell
|
|
||||||
|
|
||||||
DEST_DIR="/opt/${MY_NAME}"
|
|
||||||
CONF_DIR="/etc/${MY_NAME}"
|
|
||||||
LOGS_DIR="/var/log/${MY_NAME}"
|
|
||||||
TEMP_DIR="/var/tmp/${MY_NAME}"
|
|
||||||
|
|
||||||
all_ruby_prepare() {
|
|
||||||
# fix paths
|
|
||||||
local satellites_path="${TEMP_DIR}/repo_satellites"
|
|
||||||
local repos_path=/var/lib/git/repositories
|
|
||||||
local shell_path=/usr/share/gitlab-shell
|
|
||||||
sed -i -E \
|
|
||||||
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
|
|
||||||
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
|
|
||||||
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
|
|
||||||
|
|
||||||
local run_path=/run/${MY_NAME}
|
|
||||||
sed -i -E \
|
|
||||||
-e "s|/home/git/gitlab/tmp/(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
|
|
||||||
|
|
||||||
## RC script ##
|
|
||||||
|
|
||||||
if use systemd ; then
|
|
||||||
ewarn "Beware: systemd support has not been tested, use at your own risk!"
|
|
||||||
systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
|
|
||||||
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
|
|
||||||
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
|
|
||||||
else
|
|
||||||
local rcscript=gitlab-8.13.3-sidekiq.init
|
|
||||||
use unicorn && rcscript=gitlab-8.13.3-unicorn.init
|
|
||||||
|
|
||||||
cp "${FILESDIR}/${rcscript}" "${T}" || die
|
|
||||||
sed -i \
|
|
||||||
-e "s|@USER@|${MY_USER}|" \
|
|
||||||
-e "s|@GITLAB_BASE@|${dest}|" \
|
|
||||||
-e "s|@LOGS_DIR@|${logs}|" \
|
|
||||||
"${T}/${rcscript}" \
|
|
||||||
|| die "failed to filter ${rcscript}"
|
|
||||||
|
|
||||||
newinitd "${T}/${rcscript}" "${MY_NAME}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# fix permissions
|
|
||||||
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "If this is an update from a previous version, stop your GitLab"
|
|
||||||
elog "instance and issue the following command to perform all required"
|
|
||||||
elog "migrations:"
|
|
||||||
elog " emerge --config \"=${CATEGORY}/${PF}\""
|
|
||||||
elog "PLEASE NOTE: It's HIGHLY recommended to backup your database"
|
|
||||||
elog "before running the config phase. Run these commands (as root):"
|
|
||||||
elog
|
|
||||||
elog " cd /opt/gitlab"
|
|
||||||
elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production"
|
|
||||||
elog
|
|
||||||
elog "If this was a fresh install, follow these steps:"
|
|
||||||
elog
|
|
||||||
elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml."
|
|
||||||
elog
|
|
||||||
elog "2. Configure your database settings in ${CONF_DIR}/database.yml"
|
|
||||||
elog " for \"production\" environment."
|
|
||||||
elog
|
|
||||||
elog "3. Then you should create a database for your GitLab instance, if you"
|
|
||||||
elog " haven't done so already."
|
|
||||||
elog
|
|
||||||
if use postgres; then
|
|
||||||
elog "If you have local PostgreSQL running, just copy&run:"
|
|
||||||
elog " su postgres"
|
|
||||||
elog " psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\"
|
|
||||||
elog " NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\""
|
|
||||||
elog " createdb -E UTF-8 -O gitlab gitlabhq_production"
|
|
||||||
elog " Note: You should change your password to something more random..."
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
elog "4. Finally execute the following command to initialize the environment:"
|
|
||||||
elog " emerge --config \"=${CATEGORY}/${PF}\""
|
|
||||||
elog " Note: Do not forget to start Redis server first!"
|
|
||||||
elog
|
|
||||||
elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and"
|
|
||||||
elog "you can't login after the upgrade, be sure to read the section about the"
|
|
||||||
elog "verification of the CSRF token in GitLab's trouble-shooting guide at"
|
|
||||||
elog "http://goo.gl/5XGRGv."
|
|
||||||
if use postgres; then
|
|
||||||
elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the"
|
|
||||||
elog "`pg_trgm` extension by running the following command as a PostgreSQL"
|
|
||||||
elog "super user for *every* GitLab database:"
|
|
||||||
elog " CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
|
||||||
elog "For details, see the documentation at the GitLab website."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_config() {
|
|
||||||
einfo "Checking configuration files"
|
|
||||||
|
|
||||||
if [ ! -r "${CONF_DIR}/database.yml" ]; then
|
|
||||||
eerror "Copy ${CONF_DIR}/database.yml.* to"
|
|
||||||
eerror "${CONF_DIR}/database.yml and edit this file in order to configure your"
|
|
||||||
eerror "database settings for \"production\" environment."; die
|
|
||||||
fi
|
|
||||||
|
|
||||||
local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)"
|
|
||||||
local git_home="$(egethome ${MY_USER})"
|
|
||||||
|
|
||||||
# configure Git global settings
|
|
||||||
if [ ! -e "${git_home}/.gitconfig" ]; then
|
|
||||||
einfo "Setting git user"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
git config --global user.email '${email_from}';
|
|
||||||
git config --global user.name 'GitLab'" \
|
|
||||||
|| die "failed to setup git name and email"
|
|
||||||
fi
|
|
||||||
|
|
||||||
su -l ${MY_USER} -c "git config --global repack.writeBitmaps true"
|
|
||||||
|
|
||||||
# determine whether this is an update or a fresh install. we do this by
|
|
||||||
# checking whether the ${DEST_DIR}/.git directory exists or not
|
|
||||||
#
|
|
||||||
if [ -d "${DEST_DIR}/.git" ]; then
|
|
||||||
local update=true
|
|
||||||
else
|
|
||||||
local update=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Initialize app ##
|
|
||||||
|
|
||||||
local RAILS_ENV="production"
|
|
||||||
local RUBY=${RUBY:-/usr/bin/ruby}
|
|
||||||
local BUNDLE="${RUBY} /usr/bin/bundle"
|
|
||||||
|
|
||||||
# FIXME: this line existed in older ebuilds, but the variable is
|
|
||||||
# never used. what was it for!?
|
|
||||||
# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
|
|
||||||
|
|
||||||
if [ "${update}" = 'true' ]; then
|
|
||||||
einfo "Migrating database ..."
|
|
||||||
exec_rake db:migrate
|
|
||||||
|
|
||||||
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
|
|
||||||
einfo "Migrating iids ..."
|
|
||||||
exec_rake migrate_iids
|
|
||||||
|
|
||||||
einfo "Installing npm modules ..."
|
|
||||||
exec_npm install
|
|
||||||
|
|
||||||
einfo "Cleaning old precompiled assets ..."
|
|
||||||
exec_rake gitlab:assets:clean
|
|
||||||
|
|
||||||
einfo "Cleaning cache ..."
|
|
||||||
exec_rake cache:clear
|
|
||||||
else
|
|
||||||
# create dummy git repo as workaround for
|
|
||||||
# https://github.com/bundler/bundler/issues/2039
|
|
||||||
einfo "Initializing dummy git repository to avoid false errors from bundler"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
cd ${DEST_DIR}
|
|
||||||
git init
|
|
||||||
git add README.md
|
|
||||||
git commit -m 'Dummy repository'" >/dev/null
|
|
||||||
|
|
||||||
einfo "Initializing database ..."
|
|
||||||
exec_rake gitlab:setup
|
|
||||||
|
|
||||||
einfo "Installing npm modules ..."
|
|
||||||
exec_npm install
|
|
||||||
fi
|
|
||||||
|
|
||||||
einfo "Precompiling assests ..."
|
|
||||||
exec_rake gitlab:assets:compile
|
|
||||||
|
|
||||||
if [ "${update}" = 'true' ]; then
|
|
||||||
ewarn
|
|
||||||
ewarn "This configuration script runs only common migration tasks."
|
|
||||||
ewarn "Please read guides on"
|
|
||||||
ewarn " https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/"
|
|
||||||
ewarn "for any additional migration tasks specific to your previous GitLab"
|
|
||||||
ewarn "version."
|
|
||||||
if use mysql ; then
|
|
||||||
ewarn "PLEASE also read this document about needed migrations on MySQL:"
|
|
||||||
ewarn "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
elog
|
|
||||||
elog "If you want to make sure that the install/upgrade was successful, start"
|
|
||||||
elog "Gitlab now and then run these commands (as root):"
|
|
||||||
elog
|
|
||||||
elog " cd /opt/gitlab"
|
|
||||||
elog " sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production"
|
|
||||||
elog " sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production"
|
|
||||||
elog
|
|
||||||
if ! use systemd ; then
|
|
||||||
elog "You may also run"
|
|
||||||
elog " /etc/init.d/gitlab check"
|
|
||||||
elog " for convenience."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ryaml() {
|
|
||||||
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
exec_rake() {
|
|
||||||
local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV} NODE_ENV=${RAILS_ENV}"
|
|
||||||
|
|
||||||
echo " ${command}"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; export NODE_PATH=${DEST_DIR}/node_modules
|
|
||||||
cd ${DEST_DIR}
|
|
||||||
${command}" \
|
|
||||||
|| die "failed to run rake $@"
|
|
||||||
}
|
|
||||||
|
|
||||||
exec_npm() {
|
|
||||||
local command="npm $@ --${RAILS_ENV}"
|
|
||||||
|
|
||||||
echo " ${command}"
|
|
||||||
su -l ${MY_USER} -c "
|
|
||||||
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; export NODE_PATH=${DEST_DIR}/node_modules
|
|
||||||
cd ${DEST_DIR}
|
|
||||||
${command}" \
|
|
||||||
|| die "failed to run npm $@"
|
|
||||||
}
|
|
|
@ -16,7 +16,7 @@ USE_RUBY="ruby21 ruby23"
|
||||||
inherit eutils ruby-ng user systemd
|
inherit eutils ruby-ng user systemd
|
||||||
|
|
||||||
MY_PV="v${PV/_/-}"
|
MY_PV="v${PV/_/-}"
|
||||||
MY_GIT_COMMIT="f0c970ec5f660fa768ee2b21e378ed3bda770239"
|
MY_GIT_COMMIT="3d2890c86ac0aade2942780b2509fb57d4492d79"
|
||||||
|
|
||||||
GITLAB_PAGES_VERSION="0.3.2"
|
GITLAB_PAGES_VERSION="0.3.2"
|
||||||
GITLAB_SHELL_VERSION="4.1.1"
|
GITLAB_SHELL_VERSION="4.1.1"
|
Loading…
Reference in a new issue