summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCyril Rohr <cyril.rohr@gmail.com>2014-04-15 17:58:12 +0100
committerCyril Rohr <cyril.rohr@gmail.com>2014-05-06 11:34:17 +0100
commit402361afff4a4eb8c19ea7ab4f4c6ec5daf64221 (patch)
treea4a4b4e754be9069a8d51d4b4289387204fae942 /bin
parentb1d68b6e9bd837b3b685b76ceca1b6a44cf2dc17 (diff)
downloadgitlab-ce-402361afff4a4eb8c19ea7ab4f4c6ec5daf64221.tar.gz
Setup default gitlab.yml with possibility to override default url via environment variable.
This only applies to packaging with https://pkgr.io.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pkgr_before_precompile.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/pkgr_before_precompile.sh b/bin/pkgr_before_precompile.sh
index 126f9fda72e..283abb6a0cd 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