Delete scripts directory

This commit is contained in:
شركة خبير المحدودة 2024-06-24 16:53:42 +03:00 committed by GitHub
parent 8d8d6f2805
commit 6f99c09503
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 34 deletions

View File

@ -1,34 +0,0 @@
#!/bin/bash
# Author: Moutaz Muhammad <M.MUHAMMAD@exp-sa.com>
set -euo pipefail
# Validate input parameters
if [ "$#" -lt 5 ]; then
echo "** [ERROR] Usage: $0 <project_user> <project_path> <repo> <project_service> <branch>"
exit 1
fi
PROJECT_USER="$1"
PROJECT_PATH="$2"
REPO="$3"
PROJECT_SERVICE="$4"
BRANCH="$5"
# Stash changes before pulling
sudo -u "$PROJECT_USER" bash -c "cd '$PROJECT_PATH/$BRANCH/$REPO' && git stash && git stash clear && git pull origin '$BRANCH'"
if [ $? -eq 0 ]; then
echo "** [INFO] Git pull origin $BRANCH command executed successfully."
else
echo "** [ERROR] Git pull origin $BRANCH command failed."
exit 1
fi
# Restart the project service
sudo systemctl restart "$PROJECT_SERVICE"
if [ $? -eq 0 ]; then
echo "** [INFO] $BRANCH service has been restarted."
else
echo "** [ERROR] Failed to restart $BRANCH service."
exit 1
fi