mirror of
https://github.com/sameersbn/docker-gitlab.git
synced 2026-01-25 14:08:09 +00:00
gitlab: moved backup keep time code block to start of script
This commit is contained in:
parent
8c3207f828
commit
5a7aeca1d8
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user