diff options
-rwxr-xr-x | bin/pkgr_before_precompile.sh | 9 |
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 |