create secrets.yml

This commit is contained in:
Praveen Arimbrathodiyil 2016-02-18 18:12:32 +05:30
parent 1e1bab6fb4
commit d4d931cac0

View file

@ -3,6 +3,12 @@
# Only exported variables will be passed on to gitlab app
export $(cat /etc/gitlab/gitlab-debian.conf)
if ! [ -f "${gitlab_app_root}/config/secrets.yml" ]; then
echo "Creating secrets.yml..."
gitlab_app_secret=$(openssl rand -hex 64)
cp ${gitlab_app_root}/config/secrets.yml.example ${gitlab_app_root}/config/secrets.yml
sed -i "s/# db_key_base:/db_key_base: ${gitlab_app_secret}/" ${gitlab_app_root}/config/secrets.yml
fi
echo "Initializing database..."
if [ "$(su postgres -c 'psql gitlab_production -c \\d')" = \
"No relations found." ]; then