Commit 402361af authored by Cyril Rohr's avatar Cyril Rohr

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

This only applies to packaging with https://pkgr.io.
parent b1d68b6e
#!/bin/sh #!/bin/sh
set -ex set -e
for file in config/*.yml.example; do for file in config/*.yml.example; do
cp ${file} config/$(basename ${file} .example) cp ${file} config/$(basename ${file} .example)
done 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 # No need for config file. Will be taken care of by REDIS_URL env variable
rm config/resque.yml rm config/resque.yml
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment