Commit 402361afff4a4eb8c19ea7ab4f4c6ec5daf64221

Authored by Cyril Rohr
1 parent b1d68b6e

Setup default gitlab.yml with possibility to override default url via environment variable.

This only applies to packaging with https://pkgr.io.
Showing 1 changed file with 8 additions and 1 deletions   Show diff stats
bin/pkgr_before_precompile.sh
1 1 #!/bin/sh
2 2  
3   -set -ex
  3 +set -e
4 4  
5 5 for file in config/*.yml.example; do
6 6 cp ${file} config/$(basename ${file} .example)
7 7 done
8 8  
  9 +# Allow to override the Gitlab URL from an environment variable, as this will avoid having to change the configuration file for simple deployments.
  10 +config=$(echo '<% gitlab_url = URI(ENV["GITLAB_URL"] || "http://localhost:80") %>' | cat - config/gitlab.yml)
  11 +echo "$config" > config/gitlab.yml
  12 +sed -i "s/host: localhost/host: <%= gitlab_url.host %>/" config/gitlab.yml
  13 +sed -i "s/port: 80/port: <%= gitlab_url.port %>/" config/gitlab.yml
  14 +sed -i "s/https: false/https: <%= gitlab_url.scheme == 'https' %>/" config/gitlab.yml
  15 +
9 16 # No need for config file. Will be taken care of by REDIS_URL env variable
10 17 rm config/resque.yml
11 18  
... ...