www-apps/gitlab-ce:

Add ebuild for version 9.4.0 and update dev versions

Package-Manager: Portage-2.3.6, Repoman-2.3.1
This commit is contained in:
Manuel Friedli 2017-07-25 12:36:05 +02:00
parent 677dcd0bef
commit 4bdcc34e16
6 changed files with 600 additions and 44 deletions

View File

@ -1,3 +1,10 @@
*gitlab-ce-9.4.0 (25 Jul 2017)
25 Jul 2017; Manuel Friedli <manuel@fritteli.ch>
+files/03-gitlab-ce-9.4.0-database.yml.patch, +gitlab-ce-9.4.0.ebuild,
gitlab-ce-9.4.0_rc6.ebuild, gitlab-ce-9999.ebuild:
www-apps/gitlab-ce: Add ebuild for version 9.4.0 and update dev versions
*gitlab-ce-9.4.0_rc6 (25 Jul 2017)
25 Jul 2017; Manuel Friedli <manuel@fritteli.ch> +gitlab-ce-9.4.0_rc6.ebuild,

View File

@ -2,6 +2,7 @@ AUX 01-gitlab-ce-8.7.5-fix-sendmail-config.patch 705 SHA256 cfc4ffd896e03cc76360
AUX 02-gitlab-ce-9.0.0-fix-redis-config-path.patch 423 SHA256 9de3711c1f06a0561001166f2a44b4c1dc5fa3fa57a5230eb1dcc2b5d394449c SHA512 ae89fa3c6fde777e844e777862415450787ebf83653435cea329d66810c5805d2126d41cb1ce40b15c42371543bc182a59305b8b1b6a7433121340a625300370 WHIRLPOOL d97962907bb1fc610ebc52665a6ce51f40ee932e7ac715279f3c0554f2880a7b220ecbac2c4c97bd4d3dac22b9a025aa729805221ed5e6d15f04f6cd8e210d22
AUX 03-gitlab-ce-8.17.0-database.yml.patch 2238 SHA256 c5ec9e8a11fb60a7749b9f8cf553949e78aacf9a8233b39c4986980851196c8e SHA512 1668e2c1d00ef485d2bc5af8d343c9be19f291a627d0041d42b268ec1ad8aedecba99336998e6b1b3ac2f4cd617556d17ab5f1f11f95d696205e3d10d6b74e1c WHIRLPOOL c91a6604f050113c9f584d7bf34ebe660263beb88879382873952d6b1b136ad5b576b813bf9f2f66ee49d6656fb1d24437dca395c2574bd7dab07cd1a3a36a99
AUX 03-gitlab-ce-9.2.2-database.yml.patch 2342 SHA256 870cddca799897d249773d0b0e58d30b1290475e3c313faa6bbc307c73f80d4b SHA512 257ff2cf3bd090dd08a8f03baa6c06d130313bf46b21ac61a606aaa0f0cf1eaacd3ad231761989448e4dc28aeda01b03192290314582db002c32c65eed4134aa WHIRLPOOL 94d95a9e6d15d48c6e786521b04eb43b12a003feae0a464122f51cdf2a5215b2c025134373842a6633d0adf73ceea1db9fb32e36236391bdf9e750565f908591
AUX 03-gitlab-ce-9.4.0-database.yml.patch 2402 SHA256 1c7bed7db0a0a7f46111a3cb0fbc37d46c64c184201ba6d7777e3f9ad6c647fd SHA512 42c66dcbf6f311ddcf391330b97acc36493f5ddc8e66c8812bf9826f7750c6bd268da6d5a159973902077528cdd11ae61594e3e377b1f9a6a5b551522d615a35 WHIRLPOOL e66453787d14c653b5fe9a68b666afc532d13870edebe222f235a94368cc5e44c8def781a1e73918844f25726d4d845693212419380822470a5849f2fb4d1958
AUX 04-gitlab-ce-8.12.7-fix-check-task.patch 917 SHA256 e1adffbd59a418d5e14cbd51ae14d5c1f0364af759c77b6cb485079e0233e90f SHA512 226c3892768dc526dbc9f109aaecdee1eb27c0acb5060ba6db8222410c500336ebcf7184437228480da04ce5de149a14bbb5c1471aed853a280d7f371f271d88 WHIRLPOOL 3ec22dc4d12b5025bddfccdea27a816aca1f818d5138b3dc9a6362e56ec4cd14e5c38c76b64b468f3797e0d2718d38aad4f910abf3f3328a7983832babb7f231
AUX 04-gitlab-ce-9.3.0-fix-check-task.patch 1090 SHA256 51ade91e5e7ef67e6d3c0e6e1f708156755ad44d42dbc3ccdd4356b259e46846 SHA512 2eacb47df7f9782172ae4f71d8e5fb07f2a830da7733e2ec84b95259a9ee5d454f9c68f93b40251050cedd502761800ec56fe7f502309364e61e9e4431e2b112 WHIRLPOOL 0f7b6a7281eb8dd736b6f329e8511b9145a48450361264465f37aa852bf9d0e4ed265c0292272e75000216ddbd4c285b496aef86a4cfd2944f6819b7a3cc3982
AUX 05-gitlab-ce-9.0.0-replace-sys-filesystem.patch 2436 SHA256 53fcd9fc123a0fcb671a8cbcb3b2dc61765e32be6836206ae0edea8cf0ae8203 SHA512 21636f298df7e762f59595f39fb50266f8737311f37aa2b9ba96bc29190b8a67eea01b09e3b589d0885da6b27beaa136fa66c7d98408a8e3ecb3ac6baf20d891 WHIRLPOOL e0c709dfc5f72e33207fd7d62a7db5a85c0ed4b6064d5d6a13bcce7d660d9ba144fe09d0985c16c313f06a4e02911729be132086735eac47ddff981874f31acc
@ -19,12 +20,14 @@ DIST gitlab-ce-9.0.12.tar.gz 26367049 SHA256 2cd78b2686bb7c35af4b3684b7e5932f37c
DIST gitlab-ce-9.1.9.tar.gz 30516632 SHA256 52436dfb7d086cd449a975d63a973dc3a58f677031ae5e7653ad27888544d86c SHA512 2c47720cd05d94f31d8b9d665ed7ef1c66fbc9ffb30967bf12e9db20b1607043f488e5cfacc53abca3be7e846b0d661578b0768d737a257ef4bf3cc35883c23a WHIRLPOOL acafd9a98e253d2318e6c53148bff3253be3bf98dd836562f0897bc91a34724b4f2e583e90e590e21e34b3811229a5119a71e0d02ada1d0745c8ad9c81288190
DIST gitlab-ce-9.2.9.tar.gz 30992595 SHA256 ce6fc7d908bc5348734c0519c3d976f29fac8b9e249a49b82bc920aea02629da SHA512 8f9bcfe4563aa6b84a01b295530b584b96745a10528c0e7ab0b2f894474a1a28a082bd1996bff0e38b36f77741e7624105d573278839aa8b976e4914d7b775ab WHIRLPOOL 7aaff53923772b725f80ad3f09ccf2f903bffc31c9536a5419a68692f19402dffec4a37cfe8d355f382641712d18064b642e82705210ff5c8421eecf71379ef8
DIST gitlab-ce-9.3.9.tar.gz 31766776 SHA256 1ea93e0031ce57e1fcc4bab4809a989376717b2d81b37bd9cd70c0d51f2e042e SHA512 8cb5ad4b03a9ae266150f84305953886e877241e846cd0fc84b619c0137b30ed1cd7aa5017c5e496e28e30a866a5c8d13e3f4ba6b4cd1449becf0a2290bc61b9 WHIRLPOOL 58dc164054a420fb134dc9a837982aa83428199da5d6cd9ba15a000c42ddbe8936bd2420d7d0a2272751f33885f65d005bd3cb306cf4bcb6e3dddb58b8204f06
DIST gitlab-ce-9.4.0.tar.gz 32800286 SHA256 ee6873a626a150c21e74fef4c97cb70947d3442ffb78b40aa9031d3d4b4a346f SHA512 325ab189679687ca6861667d20412a0e585025cb9b3cc149cabbd15f58ff3bc0310113b3774fadaf068618e2699c4e7dac1f20b3df51845964a0d35b215afa9a WHIRLPOOL 1c10f35e45d7b0053fec4f5e93319fd766c56cd1dfadee36cb80a4fe936706486c402a0ab098fc5d053e4dc2810cc821f85468ee54c9f5d3fc59609ccabead28
DIST gitlab-ce-9.4.0_rc6.tar.gz 32810524 SHA256 4cd8ae890bbe2b90047078c6d61fd29c8c62e8aa0059d97ca14db81b68ea64f2 SHA512 b8aeaa3f017b47c3455885c57fc21da8fc393ce6258de6813f0c7104f7dc725ffd3800c22d480ed19aa553c7d1040a4006dbd923cb6a1f3cdd685b17ee21afc0 WHIRLPOOL dd583d05f6937612e9a34980c558030bed266f2a0f50a2d9977c23a4cb8fcbfcfc71a3157c846250a02091688333c5b76ccdeec2a9f3e5a23af715caa7d58f05
EBUILD gitlab-ce-9.0.12.ebuild 13079 SHA256 8d0d7ed4d3bc3049d45c86743742354827f811bdeb81cb5370713d115b5f2453 SHA512 9420cd9d0138d23a96e15d4ce0f21d265804eb78fc4724708f20f4c153cbc0942940a0bc646492eb143fd2f7870b9b0c767d51974bf5d070be37431e87135070 WHIRLPOOL 9a69b3c796dfcd5845583b217375ab354b5fbf707261b3407d4bc215ab91e646539759986a0b321409513c4c19ed4994054677fe10340fcb50706d72e78e3e49
EBUILD gitlab-ce-9.1.9.ebuild 13235 SHA256 b97e426661b11c52432bd4a47faa7e96867fc09cf7c8f25c227c96d3e3a5102e SHA512 5fe79ff6cbd48915fa8906cb41b2d1d29a908339943c24cd34870d8368c589990fce2c3f7844e0898b952558a85f527d5e5f04cb15db3f8afd310014610dda39 WHIRLPOOL 1fae0a60762a707144911101bca134fcc5da990b42b0afd9d0ac439557885f7548c0088852a5492706355d80b3c57166d591b5e195d43676d10f0ecf5273ad8a
EBUILD gitlab-ce-9.2.9.ebuild 12980 SHA256 a3722674324dbb418d379f326865eb03125555d631f34079193b12ba77878d8a SHA512 53094a4ccd6635df51fb45618e6eb9f2904e0939cb40685135a9165a45712112d0d5d527da6626e9096234e64ef0620dc774e58515ab48baa7754163736cdeeb WHIRLPOOL eca9905ee808983b1a72f8907f5d969f2ed273bd707e5948edb2192fa2603d4f0aeafedb24339f00a9daa4eb8e5dadfbe2ba2c64a1b97f50abe9232ae8d37953
EBUILD gitlab-ce-9.3.9.ebuild 13639 SHA256 039ba276fb5c3ba71c04d830b90781457ae1e8ae855f1454b3309b8e3c477bc1 SHA512 ab7add79547b10908253460a27e1a733128323e304b64e0a1291ab69d1ed2daac3296c5dc4996deae6e5c72d6a62c88f825aa1485b1086c29c221397c3871968 WHIRLPOOL ec2d63679e376e1bffd3731b401fbac8f3773352708629d4c4bd092ba4a1c63ae4be03bf75038422e5be14e3836bda461dddbaa7c49b4e5946a81679b554302d
EBUILD gitlab-ce-9.4.0_rc6.ebuild 12843 SHA256 8deeafb5058635b27a13d3867e7b3ef3eccd757cfd7b7d9b445669fe9a66da04 SHA512 d07da6f5ae61996430d890eabc0c58413fc678923698b6dad981cad6a956c6201ee2848f8feac306ed850904ef965cc7cb29748b3a0b54eebef13c168a69e74b WHIRLPOOL 03a87ac150ae8214c4ac2c870a560ed1ebba9866774cb9d07f8428205d7e5f6ff9e6af3f89e2d90266784847c0883b35db3bec517569074b918d3e941919881a
EBUILD gitlab-ce-9999.ebuild 13581 SHA256 86cda78324957f3078a54ce9b014bef26e55dc57a8b2b0c438f2ab32aa9e4160 SHA512 7479938cc287aa6a29689817a6759b652b27aa439cba4828d5e0538322fe478a222e27e55a1f49f30bea131de4fce7938d015709fba335c4b0eb534e25baa6a6 WHIRLPOOL 9c8bb98f93cfe2a552772e797715a18ca794b40ad8b7bb5830e395a8392fbd458ad09e5d3b9876e5e2746a2be1b8b0a6a4a27c06c55c076a539ab831f560ac85
MISC ChangeLog 21858 SHA256 8e02c6d4ec28c4d86e4973fd6833c1c1cd92bd583b77a041c36766a982838dac SHA512 26c5d8f92f42c693f5031ee3bfc44677a02a6fde24f61715d378166702cf3ca63db6685f85da76f9201d2ae2ef761ab003c6f7077ec1776dd0638b681f7c808e WHIRLPOOL 8ff620187fa7892d68e63fa4729b39028f251e0f0a11c2cc80357e3f2c696475cc393978b9845ad722bc4f3e437c419bfa973a76fb7f271af3c05b8258a2245e
EBUILD gitlab-ce-9.4.0.ebuild 13533 SHA256 e73704941750b2169481fd187dd54671d626e6cf665b2fe4cdc7e5cfa95fcb56 SHA512 7c8a6ee161e2088773a09d55afa7b6c7bd92890b2ed69a368119cb2afc593e7ebf7e2b009291422dddc00e0d0beaaf39e6085fb0cd3dee7f4d1c30b8071cfa4d WHIRLPOOL c41a90adc829ab7dec3dd77065227384cc782246bd539d69f7d39a870fda7cf1bceb3914c18baf16dbef920fa1c5e03950db931ff218fc77dd3db9c881ea7df4
EBUILD gitlab-ce-9.4.0_rc6.ebuild 13515 SHA256 55d3f521d4b54ae3a8e1730e603cc3699a957bb037d7bb402984c27b68e3ba50 SHA512 b47acf7328fc7396bf4e33b5e5fd147e20a5b4d0ea115518ad3492cac3e8d65e861e3ab961e73779d0bee82a5c08ca04a355e4c547c4504d5881d81f182ba6e4 WHIRLPOOL 47547b6d7368a086aa474cad44a304936a06615406c9c72d899677c2742596a991d9b2e4cb4f7a65a1011db2966b7f21ff0901004e00e4f96cbae8b28018e3bb
EBUILD gitlab-ce-9999.ebuild 13475 SHA256 ae6496c7a3fd61c484fed4822631005348ab5d9c05df61ef927ae797753e83c6 SHA512 79f6b2457187f95a52cddcd67643c9b6d4ca72a4f4e52f34849786ff8ac9be32b771504f6cdd7dbaf5de5f77869db75812ff4ea3aeaf2abbdc874e755b627d99 WHIRLPOOL 2fbd6ea7b1013128416c511f2d4eb4f08e087046a8c3dfe60c5b3d5b7ac521d86ab33dba9a62e5bd10b4f5ef0e1d9d3a8cac43a189dca018c6ddb734806d8a76
MISC ChangeLog 22144 SHA256 eba6ec85e1ae3bfebaf7ca83e838f96d079292df206f55d519dd28a8ede3151b SHA512 2fc8df1c2e72996265597e289853c724ef4e2ea7a16fe299fa9f63f0eda2f4463056d53eb5c57aab463425aea141e6c5aa37ae3cc834084d0cca52dac4659de4 WHIRLPOOL 3f718a89224caf7ce158f0496cb0439e336fe90682a56b67627a1fb038f33be5f56094bbec33d6f934a03c031a4a9de69d6fa5ec15647a381b5f694e103d2569
MISC metadata.xml 801 SHA256 3dc7486a12903f47f65968d524c93500ba30a4a09fa57e5a9dacf356509b44bb SHA512 e132754b72e64246531fa883400a0cf1a473ac5a6a49623db58ccf118a038b7cf37df03d9550f37b4a25f9ddbb1dcc5652ec9a4f2259d8e3ce202692c4025f41 WHIRLPOOL e9d961681fd790008eaf80fa07ce2c55a00a58f2e920d759793783ca8c8f508602a777e94c0cb65fe87c7dbef0cabdf26e4f4082584421097d939cbab20c4ac6

View File

@ -0,0 +1,104 @@
diff --git a/config/database.yml.mysql b/config/database.yml.mysql
index eb71d3f..a3b5ecc 100644
--- a/config/database.yml.mysql
+++ b/config/database.yml.mysql
@@ -3,43 +3,12 @@
#
production:
adapter: mysql2
- encoding: utf8
- collation: utf8_general_ci
+ encoding: utf8mb4
+ collation: utf8mb4_general_ci
reconnect: false
- database: gitlabhq_production
+ database: gitlab
pool: 10
username: git
password: "secure password"
# host: localhost
- # socket: /tmp/mysql.sock
-
-#
-# Development specific
-#
-development:
- adapter: mysql2
- encoding: utf8
- collation: utf8_general_ci
- reconnect: false
- database: gitlabhq_development
- pool: 5
- username: root
- password: "secure password"
- # host: localhost
- # socket: /tmp/mysql.sock
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test: &test
- adapter: mysql2
- encoding: utf8mb4
- collation: utf8mb4_general_ci
- reconnect: false
- database: gitlabhq_test
- pool: 5
- username: root
- password:
- # host: localhost
- # socket: /tmp/mysql.sock
- prepared_statements: false
+ # socket: /run/mysqld/mysqld.sock
diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql
index 4b30982..28f7993 100644
--- a/config/database.yml.postgresql
+++ b/config/database.yml.postgresql
@@ -4,46 +4,9 @@
production:
adapter: postgresql
encoding: unicode
- database: gitlabhq_production
+ database: gitlab
pool: 10
# username: git
# password:
# host: localhost
# port: 5432
-
-#
-# Development specific
-#
-development:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_development
- pool: 5
- username: postgres
- password:
- # host: localhost
-
-#
-# Staging specific
-#
-staging:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_staging
- pool: 5
- username: postgres
- password:
- # host: localhost
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test: &test
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_test
- pool: 5
- username: postgres
- password:
- # host: localhost
- prepared_statements: false

View File

@ -0,0 +1,430 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="6"
# Maintainer notes:
# - This ebuild uses Bundler to download and install all gems in deployment mode
# (i.e. into isolated directory inside application). That's not Gentoo way how
# it should be done, but GitLab has too many dependencies that it will be too
# difficult to maintain them via ebuilds.
#
USE_RUBY="ruby23"
inherit eutils ruby-ng user systemd
MY_PV="v${PV/_/-}"
MY_GIT_COMMIT="9bbe2acf7fb75d19cc3db4e82e82eba47c65202e"
GITALY_VERSION="0.21.2"
GITLAB_PAGES_VERSION="0.5.0"
GITLAB_SHELL_VERSION="5.3.1"
GITLAB_WORKHORSE_VERSION="2.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 ~arm64"
IUSE="kerberos mysql +postgres +unicorn systemd pages rugged_use_system_libraries"
## Gems dependencies:
# charlock_holmes dev-libs/icu
# grape, capybara dev-libs/libxml2, dev-libs/libxslt
# rugged dev-util/cmake, virtual/pkgconfig
# json dev-util/ragel
# pygments.rb python 2.7+
# execjs net-libs/nodejs, or any other JS runtime
# pg dev-db/postgresql
# mysql virtual/mysql
#
GEMS_DEPEND="
dev-libs/icu
dev-libs/libxml2
dev-libs/libxslt
dev-libs/re2
dev-util/ragel
>=net-libs/nodejs-4.3.0
>=sys-apps/yarn-0.17.0
postgres? ( >=dev-db/postgresql-9.1:* )
mysql? ( virtual/mysql )
kerberos? ( virtual/krb5 )"
CDEPEND="
dev-util/cmake
virtual/pkgconfig"
COMMON_DEPEND="
${GEMS_DEPEND}
~dev-vcs/gitlab-shell-${GITLAB_SHELL_VERSION}
>=dev-vcs/git-2.8.4
~www-servers/gitlab-workhorse-${GITLAB_WORKHORSE_VERSION}
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/25 )
pages? ( ~www-servers/gitlab-pages-${GITLAB_PAGES_VERSION} )
~www-servers/gitlab-gitaly-${GITALY_VERSION}"
DEPEND="
${CDEPEND}
${COMMON_DEPEND}"
RDEPEND="
${COMMON_DEPEND}
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
# required bundler >= 1.15.1
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.14.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
#
PATCHES=(
"${FILESDIR}/01-${PN}-8.7.5-fix-sendmail-config.patch"
"${FILESDIR}/02-${PN}-9.0.0-fix-redis-config-path.patch"
"${FILESDIR}/03-${PN}-9.4.0-database.yml.patch"
"${FILESDIR}/04-${PN}-9.3.0-fix-check-task.patch"
"${FILESDIR}/05-${PN}-9.0.0-replace-sys-filesystem.patch"
"${FILESDIR}/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
local run_path=/run/${MY_NAME}
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/|" \
-e "/path: \\/home\\/git\\/repositories\\/$/ s|/home/git/repositories/|/var/lib/git/repositories/|" \
-e "/gitaly_address:/ s|/home/git/gitlab/tmp/sockets/private/|${run_path}/sockets/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
sed -i -E \
-e "s|/home/git/gitlab/tmp|${run_path}|g" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|g" \
-e "s|/home/git/gitlab|${DEST_DIR}|g" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp|${run_path}|g" \
lib/support/nginx/gitlab || die "failed to filter nginx/gitlab"
# modify default database settings for PostgreSQL
sed -i -E \
-e 's|(username:).*|\1 gitlab|' \
-e 's|(password:).*|\1 gitlab|' \
-e 's|(socket:).*|\1 /run/postgresql/.s.PGSQL.5432|' \
config/database.yml.postgresql \
|| die "failed to filter database.yml.postgresql"
# rename config files
mv config/gitlab.yml.example config/gitlab.yml
mv config/unicorn.rb.example config/unicorn.rb
local dbconf=config/database.yml
if use postgres && ! use mysql; then
mv ${dbconf}.postgresql ${dbconf}
rm ${dbconf}.mysql
elif use mysql && ! use postgres; then
mv ${dbconf}.mysql ${dbconf}
rm ${dbconf}.postgresql
fi
# remove useless files
rm -r lib/support/{deploy,init.d}
use unicorn || rm config/unicorn.rb
}
all_ruby_install() {
local dest=${DEST_DIR}
local conf=${CONF_DIR}
local logs=${LOGS_DIR}
local temp=${TEMP_DIR}
# prepare directories
diropts -m750
dodir ${logs} ${temp}
diropts -m755
dodir ${conf} ${dest}/public/uploads
dosym ${temp} ${dest}/tmp
dosym ${logs} ${dest}/log
# install configs
insinto ${conf}
doins -r config/*
dosym ${conf} ${dest}/config
echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile"
# remove needless dirs
rm -Rf config tmp log
# install the rest files
# using cp 'cause doins is slow
cp -Rl * "${D}/${dest}"/
cp -Rl .??* "${D}/${dest}"/
# install logrotate config
dodir /etc/logrotate.d
cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF
${logs}/*.log {
missingok
delaycompress
compress
copytruncate
}
EOF
## Install gems via bundler ##
cd "${D}/${dest}"
local without="development test aws"
local flag; for flag in mysql postgres unicorn kerberos; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
einfo "Cleaning old gems ..."
${RUBY} /usr/bin/bundle clean
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dounit "${FILESDIR}/gitlab-workhorse.service"
systemd_dounit "${FILESDIR}/gitlab-mailroom.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-9.3.5-sidekiq.init
use unicorn && rcscript=gitlab-9.3.5-unicorn.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|g" \
-e "s|@GITLAB_BASE@|${dest}|g" \
-e "s|@LOGS_DIR@|${logs}|g" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}"
fi
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
}
pkg_postinst() {
elog "If this is an update from a previous version, stop your GitLab"
elog "instance and issue the following command to perform all required"
elog "migrations:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog "PLEASE NOTE: It's HIGHLY recommended to backup your database"
elog "before running the config phase. Run these commands (as root):"
elog
elog " cd /opt/gitlab"
elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production"
elog
elog "If this was a fresh install, follow these steps:"
elog
elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml."
elog
elog "2. Configure your database settings in ${CONF_DIR}/database.yml"
elog " for \"production\" environment."
elog
elog "3. Then you should create a database for your GitLab instance, if you"
elog " haven't done so already."
elog
if use postgres; then
elog "If you have local PostgreSQL running, just copy&run:"
elog " su postgres"
elog " psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\"
elog " NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\""
elog " createdb -E UTF-8 -O gitlab gitlabhq_production"
elog " Note: You should change your password to something more random..."
elog
fi
elog "4. Finally execute the following command to initialize the environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and"
elog "you can't login after the upgrade, be sure to read the section about the"
elog "verification of the CSRF token in GitLab's trouble-shooting guide at"
elog "http://goo.gl/5XGRGv."
if use postgres; then
elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the"
elog "`pg_trgm` extension by running the following command as a PostgreSQL"
elog "super user for *every* GitLab database:"
elog " CREATE EXTENSION IF NOT EXISTS pg_trgm;"
elog "For details, see the documentation at the GitLab website."
fi
if use mysql ; then
ewarn "You must grant the GitLab user permissions the following on the database:"
ewarn " mysql -u root -p -e \\"
ewarn " \"GRANT TRIGGER ON \`gitlab\`.* TO 'gitlab'@'localhost';\""
ewarn "PLEASE also read this document about needed migrations on MySQL:"
ewarn
ewarn "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md"
ewarn
ewarn "Failing to follow those instructions may make the config phase fail!"
fi
}
pkg_config() {
einfo "Checking configuration files"
if [ ! -r "${CONF_DIR}/database.yml" ]; then
eerror "Copy ${CONF_DIR}/database.yml.* to"
eerror "${CONF_DIR}/database.yml and edit this file in order to configure your"
eerror "database settings for \"production\" environment."
die
fi
local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)"
local git_home="$(egethome ${MY_USER})"
# configure Git global settings
if [ ! -e "${git_home}/.gitconfig" ]; then
einfo "Setting git user"
su -l ${MY_USER} -c "
git config --global user.email '${email_from}';
git config --global user.name 'GitLab'" \
|| die "failed to setup git name and email"
fi
su -l ${MY_USER} -c "git config --global repack.writeBitmaps true"
# determine whether this is an update or a fresh install. we do this by
# checking whether the ${DEST_DIR}/.git directory exists or not
#
if [ -d "${DEST_DIR}/.git" ]; then
local update=true
else
local update=false
fi
if use mysql ; then
ewarn "Please only proceed if you've read and understood the following page:"
ewarn "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md"
if [ "${update}" = 'true' ]; then
ewarn "Failing to follow those instructions may cause the upgrade to fail"
fi
ewarn
ewarn "Press any key to continue, or abort with Ctrl+C"
read
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
if [ "${update}" = 'true' ]; then
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Installing npm modules ..."
exec_rake yarn:install
einfo "Cleaning old precompiled assets ..."
exec_rake gitlab:assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
# create dummy git repo as workaround for
# https://github.com/bundler/bundler/issues/2039
einfo "Initializing dummy git repository to avoid false errors from bundler"
su -l ${MY_USER} -c "
cd ${DEST_DIR}
git init
git add README.md
git commit -m 'Dummy repository'" >/dev/null
einfo "Initializing database ..."
exec_rake gitlab:setup
einfo "Installing npm modules ..."
exec_rake yarn:install
fi
einfo "Precompiling assests ..."
exec_rake gitlab:assets:compile
if [ "${update}" = 'true' ]; then
ewarn
ewarn "This configuration script runs only common migration tasks."
ewarn "Please read guides on"
ewarn " https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/"
ewarn "for any additional migration tasks specific to your previous GitLab"
ewarn "version."
fi
elog
elog "If you want to make sure that the install/upgrade was successful, start"
elog "Gitlab now and then run these commands (as root):"
elog
elog " cd /opt/gitlab"
elog " sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production"
elog " sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production"
elog
if ! use systemd ; then
elog "You may also run"
elog " /etc/init.d/gitlab check"
elog " for convenience."
fi
}
ryaml() {
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
}
exec_rake() {
local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV} NODE_ENV=${RAILS_ENV}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; export NODE_PATH=${DEST_DIR}/node_modules
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View File

@ -65,7 +65,7 @@ COMMON_DEPEND="
>=dev-vcs/git-2.8.4
~www-servers/gitlab-workhorse-${GITLAB_WORKHORSE_VERSION}
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/25 )
pages? ( ~www-servers/gitlab-pages-${GITLAB_PAGES_VERSION} )
~www-servers/gitlab-gitaly-${GITALY_VERSION}"
DEPEND="
@ -76,10 +76,10 @@ RDEPEND="
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
# required bundler >= 1.14.2
# required bundler >= 1.15.1
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.13.7"
>=dev-ruby/bundler-1.14.6"
#
# fix-sendmail-config:
@ -87,13 +87,13 @@ ruby_add_bdepend "
# fix-redis-config-path:
# Point to the absolute location of redis_config.rb
#
RUBY_PATCHES=(
"01-${PN}-8.7.5-fix-sendmail-config.patch"
"02-${PN}-9.0.0-fix-redis-config-path.patch"
"03-${PN}-9.2.2-database.yml.patch"
"04-${PN}-9.3.0-fix-check-task.patch"
"05-${PN}-9.0.0-replace-sys-filesystem.patch"
"06-${PN}-8.17.0-fix-webpack-config.patch"
PATCHES=(
"${FILESDIR}/01-${PN}-8.7.5-fix-sendmail-config.patch"
"${FILESDIR}/02-${PN}-9.0.0-fix-redis-config-path.patch"
"${FILESDIR}/03-${PN}-9.4.0-database.yml.patch"
"${FILESDIR}/04-${PN}-9.3.0-fix-check-task.patch"
"${FILESDIR}/05-${PN}-9.0.0-replace-sys-filesystem.patch"
"${FILESDIR}/06-${PN}-8.17.0-fix-webpack-config.patch"
)
MY_NAME="gitlab"
@ -109,22 +109,25 @@ all_ruby_prepare() {
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
local run_path=/run/${MY_NAME}
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/|" \
-e "/path: \\/home\\/git\\/repositories\\/$/ s|/home/git/repositories/|/var/lib/git/repositories/|" \
-e "/gitaly_address:/ s|/home/git/gitlab/tmp/sockets/private/|${run_path}/sockets/|" \
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}|" \
-e "s|/home/git/gitlab/tmp|${run_path}|g" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|g" \
-e "s|/home/git/gitlab|${DEST_DIR}|g" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
-e "s|/home/git/gitlab/tmp|${run_path}|g" \
lib/support/nginx/gitlab || die "failed to filter nginx/gitlab"
# modify default database settings for PostgreSQL
@ -227,14 +230,14 @@ all_ruby_install() {
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
local rcscript=gitlab-9.3.5-sidekiq.init
use unicorn && rcscript=gitlab-9.3.5-unicorn.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@USER@|${MY_USER}|g" \
-e "s|@GITLAB_BASE@|${dest}|g" \
-e "s|@LOGS_DIR@|${logs}|g" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
@ -291,8 +294,13 @@ pkg_postinst() {
elog "For details, see the documentation at the GitLab website."
fi
if use mysql ; then
ewarn "You must grant the GitLab user permissions the following on the database:"
ewarn " mysql -u root -p -e \\"
ewarn " \"GRANT TRIGGER ON \`gitlab\`.* TO 'gitlab'@'localhost';\""
ewarn "PLEASE also read this document about needed migrations on MySQL:"
ewarn
ewarn "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md"
ewarn
ewarn "Failing to follow those instructions may make the config phase fail!"
fi
}
@ -303,7 +311,8 @@ pkg_config() {
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
eerror "database settings for \"production\" environment."
die
fi
local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)"
@ -322,23 +331,30 @@ pkg_config() {
# 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
if use mysql ; then
ewarn "Please only proceed if you've read and understood the following page:"
ewarn "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md"
if [ "${update}" = 'true' ]; then
ewarn "Failing to follow those instructions may cause the upgrade to fail"
fi
ewarn
ewarn "Press any key to continue, or abort with Ctrl+C"
read
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

View File

@ -64,7 +64,7 @@ COMMON_DEPEND="
>=dev-vcs/git-2.8.4
>=www-servers/gitlab-workhorse-${GITLAB_WORKHORSE_VERSION}
kerberos? ( !app-crypt/heimdal )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )
rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/25 )
pages? ( >=www-servers/gitlab-pages-${GITLAB_PAGES_VERSION} )
>=www-servers/gitlab-gitaly-${GITALY_VERSION}"
DEPEND="
@ -75,10 +75,10 @@ RDEPEND="
>=dev-db/redis-2.8
virtual/mta
systemd? ( sys-apps/systemd:0= )"
# required bundler >= 1.15.0
# required bundler >= 1.15.1
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.13.7"
>=dev-ruby/bundler-1.14.6"
#
# fix-sendmail-config:
@ -86,13 +86,13 @@ ruby_add_bdepend "
# fix-redis-config-path:
# Point to the absolute location of redis_config.rb
#
RUBY_PATCHES=(
"01-${PN}-8.7.5-fix-sendmail-config.patch"
"02-${PN}-9.0.0-fix-redis-config-path.patch"
"03-${PN}-9.2.2-database.yml.patch"
"04-${PN}-9.3.0-fix-check-task.patch"
"05-${PN}-9.0.0-replace-sys-filesystem.patch"
"06-${PN}-8.17.0-fix-webpack-config.patch"
PATCHES=(
"${FILESDIR}/01-${PN}-8.7.5-fix-sendmail-config.patch"
"${FILESDIR}/02-${PN}-9.0.0-fix-redis-config-path.patch"
"${FILESDIR}/03-${PN}-9.4.0-database.yml.patch"
"${FILESDIR}/04-${PN}-9.3.0-fix-check-task.patch"
"${FILESDIR}/05-${PN}-9.0.0-replace-sys-filesystem.patch"
"${FILESDIR}/06-${PN}-8.17.0-fix-webpack-config.patch"
)
MY_NAME="gitlab"
@ -335,7 +335,7 @@ pkg_config() {
# 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
@ -359,10 +359,6 @@ pkg_config() {
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