From ec1dd96a7c73575c9ccc139092f75734406f684c Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 27 Jun 2016 11:16:09 -0500 Subject: [PATCH] [gb] Apply all files in /config to /data at startup --- gitblit/start.sh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/gitblit/start.sh b/gitblit/start.sh index b35bd356..1892e2be 100755 --- a/gitblit/start.sh +++ b/gitblit/start.sh @@ -9,13 +9,7 @@ apply_base_data() { } apply_config() { - for p in /config/*.properties; do - echo " -APPLYING configuration file $p -" - cp $p $GITBLIT_BASE_FOLDER - mv $p ${p}.applied - done + cp -rf /config/* $GITBLIT_BASE_FOLDER } create_repo() { @@ -81,12 +75,23 @@ create_initial_repo() { } shopt -s nullglob -apply_base_data - -if [ -d /config ]; then - apply_config +if [ ! -f /var/local/gitblit_firststart ]; then + FIRSTSTART=1 +else + FIRSTSTART=0 fi +if [ $FIRSTSTART = 1 ]; then + apply_base_data + + echo " +Applying configuration from /config +" + apply_config + touch /var/local/gitblit_firststart +fi + + if [[ -n $GITBLIT_INITIAL_REPO ]]; then create_initial_repo fi