updated config section in ebuild

This commit is contained in:
Manuel Friedli 2014-09-26 19:53:57 +02:00
parent d134a2b16d
commit b1a3bc8147
2 changed files with 7 additions and 79 deletions

View file

@ -2,4 +2,4 @@ AUX gitlab-ci-runner-5.0.0-fix-gemfile.patch 1099 SHA256 80dddabf6c0abf0096a9ba5
AUX gitlab-ci-runner.conf 78 SHA256 3b9e4f922ff53cc57c4c883dd19c1343b2a61ceba7bef303d623aedc5d2651cd SHA512 af0b725e3eea789776962a085f53d8787f91b1c8bdd7aad76aeedad2304885ac890c81d95126ad5de2590ef2b0c93045d4ba50f8bc2ba7e0caeec3b27fa4f6f7 WHIRLPOOL 10563abf39449389e9cf53076fd21a106f555e58b708b679c9cc91213ec0319a7b0dfa15977c187ceedb9a2f7c060424f66891472a2e8e8ca78262e628e05968 AUX gitlab-ci-runner.conf 78 SHA256 3b9e4f922ff53cc57c4c883dd19c1343b2a61ceba7bef303d623aedc5d2651cd SHA512 af0b725e3eea789776962a085f53d8787f91b1c8bdd7aad76aeedad2304885ac890c81d95126ad5de2590ef2b0c93045d4ba50f8bc2ba7e0caeec3b27fa4f6f7 WHIRLPOOL 10563abf39449389e9cf53076fd21a106f555e58b708b679c9cc91213ec0319a7b0dfa15977c187ceedb9a2f7c060424f66891472a2e8e8ca78262e628e05968
AUX gitlab-ci-runner.init 1551 SHA256 83bb581255db1a8bfdf15627ce4d3166e3fab6725a36086a51ab6a69c4b0536a SHA512 d0af95f32af62c6b8758a29af831fbf80310381446c76bac795c767f5c2d6d04ead5329a8c0cc3b0624d83ea500bc48edef288073297b1060eb4df5b7856033c WHIRLPOOL 7fcb1ef8d15742a9800e43496e2802f66e8805510f40e685b7f1ef20ae23bb8d2389480acb11386cff1223ada7981e2a5d9ddaeb4d32fe4d74f88583f55c5311 AUX gitlab-ci-runner.init 1551 SHA256 83bb581255db1a8bfdf15627ce4d3166e3fab6725a36086a51ab6a69c4b0536a SHA512 d0af95f32af62c6b8758a29af831fbf80310381446c76bac795c767f5c2d6d04ead5329a8c0cc3b0624d83ea500bc48edef288073297b1060eb4df5b7856033c WHIRLPOOL 7fcb1ef8d15742a9800e43496e2802f66e8805510f40e685b7f1ef20ae23bb8d2389480acb11386cff1223ada7981e2a5d9ddaeb4d32fe4d74f88583f55c5311
DIST gitlab-ci-runner-5.0.0.tar.gz 11846 SHA256 7d7f97894ba5ffeb4f06aa8a62d1ec17c2a1cbf84efd20418d74ccfc0f18c1e5 SHA512 cee02d144f37840b215a9cf706a3ca8239fbd2f33561b783b1abfd9ebdfd2eb323ecb57b8545d08f17c50a24e237053c505257279940cef2dce60f160364875f WHIRLPOOL d79a53553221715d3a34a18bce88af5fdf02e162afb1c0ca7212707f2672e0e30f584513ac9a1b7a6b9c46b3695762fd04e2819903b05504b5f482e0047dc337 DIST gitlab-ci-runner-5.0.0.tar.gz 11846 SHA256 7d7f97894ba5ffeb4f06aa8a62d1ec17c2a1cbf84efd20418d74ccfc0f18c1e5 SHA512 cee02d144f37840b215a9cf706a3ca8239fbd2f33561b783b1abfd9ebdfd2eb323ecb57b8545d08f17c50a24e237053c505257279940cef2dce60f160364875f WHIRLPOOL d79a53553221715d3a34a18bce88af5fdf02e162afb1c0ca7212707f2672e0e30f584513ac9a1b7a6b9c46b3695762fd04e2819903b05504b5f482e0047dc337
EBUILD gitlab-ci-runner-5.0.0.ebuild 5433 SHA256 2d3ee79699334b7e6dcee50ffc6b2cf9721700cde5af14f8b1b368ce703a5c1b SHA512 b248ef18610466cd8a30bd501324b75a61706ffa100188e84dd62678903405b5785b601292b8565c4f33370a7de184ad276ca0aa807d3f1f640e665b804d7525 WHIRLPOOL 573924d88be5491fec85c8f564309a532ed6cddb64a1d43019f7712e499e64d2a4d91ea88d21403a5556c997da985962b83095a01b33cdbfb216a3e8b4191685 EBUILD gitlab-ci-runner-5.0.0.ebuild 3595 SHA256 58064545663bb36f6461a235e913f571810b72857beb1b9739703aa69ca377d5 SHA512 6b83eee19ae4bb7cb1517e408efdb537a74e35fc292745d350f4ed4f013e6ad5e46e89d8ba048f47e2debaff07b2341b1311e006677a4a1010ff0526952d0c2d WHIRLPOOL 800d8442b92562fb19b74d6b2ef33f026c7e1e6b4d0ad4735efd17c090860e438657c9e18ff84a406e6d698f3abeae09fd2d17c0443d1e4fe0c62ce748b73567

View file

@ -85,11 +85,7 @@ all_ruby_install() {
echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile" echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile"
# remove needless dirs # install the files using cp 'cause doins is slow
# 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 # install logrotate config
@ -144,83 +140,15 @@ pkg_postinst() {
} }
pkg_config() { pkg_config() {
einfo "Checking configuration files" einfo "You need to register the runner with your GitLab CI instance. In"
einfo "order to do so, you need to know the URL of GitLab CI and the"
einfo "authentication token. Please follow the instructions on the screen."
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}/application.yml production gitlab_ci email_from)"
local gitlab_ci_home="$(egethome ${MY_USER})"
# configure Git global settings
if [ ! -e "${gitlab_ci_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 CI'" \
|| die "failed to setup git name and email"
fi
if [ ! -d "${DEST_DIR}/.git" ]; then
# create dummy git repo as workaround for
# https://github.com/bundler/bundler/issues/2039
einfo "Initializing dummy git repository to avoid false errors from bundler"
su -l ${MY_USER} -c "
cd ${DEST_DIR}
git init
git add README.md
git commit -m 'Dummy repository'" >/dev/null
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby} local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle" local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
else
local update=false
einfo "Initializing database ..."
exec_rake setup
einfo "Setting up cron schedules ..."
exec_rake whenever -w
fi
if [ "${update}" = 'true' ]; then
ewarn
ewarn "This configuration script runs only common migration tasks."
ewarn "Please read guides on"
ewarn " https://gitlab.com/gitlab-org/gitlab-ci/tree/v${PV}/doc/update"
ewarn "for any additional migration tasks specific to your previous GitLab CI"
ewarn "version."
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 " su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR} cd ${DEST_DIR}
${command}" \ ${BUNDLE} exec ./bin/setup" \
|| die "failed to run rake $@" || die "failed to run ${BUNDLE} exec ./bin/setup"
} }