first commit
This commit is contained in:
36
deploy.sh
Executable file
36
deploy.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
# --- Configuration ---
|
||||
GIT_BRANCH="main"
|
||||
|
||||
# Colors for terminal styling
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m'
|
||||
|
||||
echo -e "${GREEN}🚀 Starting Flash Call OTP Sync & Push...${NC}"
|
||||
|
||||
# 1. Commit local changes automatically (with date/time or custom message)
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
COMMIT_MSG=${1:-"Deploy: $(date '+%Y-%m-%d %H:%M:%S')"}
|
||||
echo -e "${YELLOW}Staging and committing changes with message: ${COMMIT_MSG}${NC}"
|
||||
git add .
|
||||
git commit -m "$COMMIT_MSG"
|
||||
echo -e "${GREEN}✅ Local commit created successfully!${NC}"
|
||||
else
|
||||
echo -e "ℹ️ No local changes to commit."
|
||||
fi
|
||||
|
||||
# 2. Push to Git Remote
|
||||
echo -e "${GREEN}📤 Pushing changes to remote repository (${GIT_BRANCH})...${NC}"
|
||||
git push origin "$GIT_BRANCH"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED}❌ Git Push failed!${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}==========================================${NC}"
|
||||
echo -e "✨ Flash Call OTP changes pushed to Git successfully! "
|
||||
echo -e "==========================================${NC}"
|
||||
Reference in New Issue
Block a user