Skip to content

Commit

Permalink
changed run.sh file
Browse files Browse the repository at this point in the history
  • Loading branch information
linkchw committed Aug 14, 2024
1 parent 486e973 commit 7c12a3b
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
#!/bin/bash

echo "Cloning the repository..."
git clone https://github.com/viraweb123/name-family.git

if [ $? -ne 0 ]; then
echo "Failed to clone repository."
exit 1
REPO_DIR="name-family"

if [ -d "$REPO_DIR" ]; then
echo "Repository directory '$REPO_DIR' already exists. Pulling latest changes..."
cd "$REPO_DIR" || { echo "Failed to change directory to '$REPO_DIR'."; exit 1; }
git pull
else
echo "Cloning the repository..."
git clone https://github.com/viraweb123/name-family.git

if [ $? -ne 0 ]; then
echo "Failed to clone repository."
exit 1
fi

cd "$REPO_DIR" || { echo "Failed to change directory to '$REPO_DIR'."; exit 1; }
fi

cd name-family/ || { echo "Failed to change directory to 'name-family'."; exit 1; }

echo "Building the Docker image..."
docker build -t train:v1 .

Expand Down

0 comments on commit 7c12a3b

Please sign in to comment.