gitlab: moved backup keep time code block to start of script

This commit is contained in:
Sameer Naik 2014-02-26 15:12:09 +05:30
parent 8c3207f828
commit 5a7aeca1d8

View File

@ -41,6 +41,11 @@ case "${DB_TYPE}" in
*) echo "Unsupported database adapter. Available adapters are mysql and postgres." && exit 1 ;;
esac
case "${GITLAB_BACKUPS}" in
daily|monthly) GITLAB_BACKUP_EXPIRY=${GITLAB_BACKUP_EXPIRY:-604800} ;;
disable|*) GITLAB_BACKUP_EXPIRY=${GITLAB_BACKUP_EXPIRY:-0} ;;
esac
# generate a password for root.
ROOT_PASSWORD=$(pwgen -c -n -1 12)
echo "root:$ROOT_PASSWORD" | chpasswd
@ -157,12 +162,6 @@ sudo -u git -H git config --global user.name "GitLab"
sudo -u git -H git config --global user.email "${GITLAB_EMAIL}"
sudo -u git -H git config --global core.autocrlf input
# setup backup keep_time if not specified
case "${GITLAB_BACKUPS}" in
daily|monthly) GITLAB_BACKUP_EXPIRY=${GITLAB_BACKUP_EXPIRY:-604800} ;;
disable|*) GITLAB_BACKUP_EXPIRY=${GITLAB_BACKUP_EXPIRY:-0} ;;
esac
# configure server url
sudo -u git -H sed 's/{{GITLAB_HOST}}/'${GITLAB_HOST}'/' -i /home/git/gitlab/config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_PORT}}/'${GITLAB_PORT}'/' -i /home/git/gitlab/config/gitlab.yml