From b1d68b6e9bd837b3b685b76ceca1b6a44cf2dc17 Mon Sep 17 00:00:00 2001 From: Cyril Rohr Date: Tue, 1 Apr 2014 15:39:26 +0100 Subject: [PATCH 1/2] Add .pkgr.yml file for automated packaging on https://pkgr.io --- .pkgr.yml | 19 +++++++++++++++++++ bin/pkgr_before_precompile.sh | 16 ++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .pkgr.yml create mode 100755 bin/pkgr_before_precompile.sh diff --git a/.pkgr.yml b/.pkgr.yml new file mode 100644 index 0000000000..09cb83783d --- /dev/null +++ b/.pkgr.yml @@ -0,0 +1,19 @@ +user: git +group: git +before_precompile: ./bin/pkgr_before_precompile.sh +targets: + debian-7: &wheezy + build_dependencies: + - libicu-dev + dependencies: + - libicu48 + - libpcre3 + - git + ubuntu-12.04: *wheezy + ubuntu-14.04: + build_dependencies: + - libicu-dev + dependencies: + - libicu52 + - libpcre3 + - git diff --git a/bin/pkgr_before_precompile.sh b/bin/pkgr_before_precompile.sh new file mode 100755 index 0000000000..126f9fda72 --- /dev/null +++ b/bin/pkgr_before_precompile.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -ex + +for file in config/*.yml.example; do + cp ${file} config/$(basename ${file} .example) +done + +# No need for config file. Will be taken care of by REDIS_URL env variable +rm config/resque.yml + +# Set default unicorn.rb file +echo "" > config/unicorn.rb + +# Required for assets precompilation +sudo service postgresql start From 402361afff4a4eb8c19ea7ab4f4c6ec5daf64221 Mon Sep 17 00:00:00 2001 From: Cyril Rohr Date: Tue, 15 Apr 2014 17:58:12 +0100 Subject: [PATCH 2/2] Setup default gitlab.yml with possibility to override default url via environment variable. This only applies to packaging with https://pkgr.io. --- bin/pkgr_before_precompile.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/pkgr_before_precompile.sh b/bin/pkgr_before_precompile.sh index 126f9fda72..283abb6a0c 100755 --- a/bin/pkgr_before_precompile.sh +++ b/bin/pkgr_before_precompile.sh @@ -1,11 +1,18 @@ #!/bin/sh -set -ex +set -e for file in config/*.yml.example; do cp ${file} config/$(basename ${file} .example) done +# Allow to override the Gitlab URL from an environment variable, as this will avoid having to change the configuration file for simple deployments. +config=$(echo '<% gitlab_url = URI(ENV["GITLAB_URL"] || "http://localhost:80") %>' | cat - config/gitlab.yml) +echo "$config" > config/gitlab.yml +sed -i "s/host: localhost/host: <%= gitlab_url.host %>/" config/gitlab.yml +sed -i "s/port: 80/port: <%= gitlab_url.port %>/" config/gitlab.yml +sed -i "s/https: false/https: <%= gitlab_url.scheme == 'https' %>/" config/gitlab.yml + # No need for config file. Will be taken care of by REDIS_URL env variable rm config/resque.yml