From ece52a30f8a97dcd20bed0472a2025b52f1afd2c Mon Sep 17 00:00:00 2001 From: j-dunham Date: Tue, 9 Aug 2022 21:15:04 -0400 Subject: [PATCH] added tar file check --- gitlab/bootstrap/setup.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gitlab/bootstrap/setup.sh b/gitlab/bootstrap/setup.sh index 84c16e4..b5d55d3 100755 --- a/gitlab/bootstrap/setup.sh +++ b/gitlab/bootstrap/setup.sh @@ -1,9 +1,14 @@ #!/usr/bin/env bash container_name="gitlab" +tar_file_path="$CODESPACE_VSCODE_FOLDER/gitlab/bootstrap/gitlab.tar.gz" if [ ! -d /srv/gitlab ]; then - echo -e "\U1F331 Seeding GitLab data" - sudo tar -xzf "$CODESPACE_VSCODE_FOLDER/gitlab/bootstrap/gitlab.tar.gz" -C /srv + echo -e "Seeding GitLab data \U1F331" + if [ ! -f $tar_file_path ]; then + echo -e "GitLab data file not found at $tar_file_path.\nPlease verify this file has not been removed\nExiting..." + return + fi + sudo tar -xzf $tar_file_path -C /srv fi echo -e "Checking for GitLab \U1F575" @@ -32,7 +37,7 @@ fi export DOCKER_ARGS="--network=host" `grep -q "export DOCKER_ARGS=" ~/.bashrc || echo 'export DOCKER_ARGS="--network=host"' >> ~/.bashrc` -echo -e "\U23F0 Waiting for GitLab to be ready. This might take a while..." +echo -e "Waiting for GitLab to be ready. This might take a while \U23F0" until $(curl --output /dev/null --silent --head --fail http://localhost); do printf '.' sleep 5