Skip to content

Commit

Permalink
Auto:
Browse files Browse the repository at this point in the history
- M  deploy.sh

- M  logs/deploy-20250102-162426.log

- A  logs/deploy-20250102-162516.log
  • Loading branch information
elimelt committed Jan 3, 2025
1 parent dd4536c commit cdffcfd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 58 deletions.
31 changes: 2 additions & 29 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,8 @@ log_message() {

# Function to generate commit message based on git status
generate_commit_message() {
local message=""
local stats=$(git status --porcelain)

# Count modified, added, and deleted files
local modified=$(echo "$stats" | grep '^ M\|^MM' | wc -l)
local added=$(echo "$stats" | grep '^??' | wc -l)
local deleted=$(echo "$stats" | grep '^ D' | wc -l)

message="Auto-commit: "

if [ $modified -gt 0 ]; then
message+="$modified files modified"
fi

if [ $added -gt 0 ]; then
if [ $modified -gt 0 ]; then
message+=", "
fi
message+="$added files added"
fi

if [ $deleted -gt 0 ]; then
if [ $modified -gt 0 ] || [ $added -gt 0 ]; then
message+=", "
fi
message+="$deleted files deleted"
fi

echo "$message"
local changes=$(git status --short)
echo "Auto: $(echo "$changes" | head -n 3 | sed 's/^/\n- /')"
}

# Change to the repository directory
Expand Down
3 changes: 3 additions & 0 deletions logs/deploy-20250102-162426.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
[2025-01-02 16:24:26] Starting deployment process
[2025-01-02 16:24:26] Clean script completed successfully
[2025-01-02 16:24:27] Build script completed successfully
[2025-01-02 16:24:27] Committed changes with message: Auto-commit:
[2025-01-02 16:24:29] Successfully pushed changes
[2025-01-02 16:24:29] Deployment completed successfully
4 changes: 4 additions & 0 deletions logs/deploy-20250102-162516.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[2025-01-02 16:25:16] Virtual environment activated
[2025-01-02 16:25:16] Starting deployment process
[2025-01-02 16:25:16] Clean script completed successfully
[2025-01-02 16:25:17] Build script completed successfully
31 changes: 2 additions & 29 deletions site/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,8 @@ log_message() {

# Function to generate commit message based on git status
generate_commit_message() {
local message=""
local stats=$(git status --porcelain)

# Count modified, added, and deleted files
local modified=$(echo "$stats" | grep '^ M\|^MM' | wc -l)
local added=$(echo "$stats" | grep '^??' | wc -l)
local deleted=$(echo "$stats" | grep '^ D' | wc -l)

message="Auto-commit: "

if [ $modified -gt 0 ]; then
message+="$modified files modified"
fi

if [ $added -gt 0 ]; then
if [ $modified -gt 0 ]; then
message+=", "
fi
message+="$added files added"
fi

if [ $deleted -gt 0 ]; then
if [ $modified -gt 0 ] || [ $added -gt 0 ]; then
message+=", "
fi
message+="$deleted files deleted"
fi

echo "$message"
local changes=$(git status --short)
echo "Auto: $(echo "$changes" | head -n 3 | sed 's/^/\n- /')"
}

# Change to the repository directory
Expand Down
4 changes: 4 additions & 0 deletions site/logs/deploy-20250102-162426.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[2025-01-02 16:24:26] Virtual environment activated
[2025-01-02 16:24:26] Starting deployment process
[2025-01-02 16:24:26] Clean script completed successfully
[2025-01-02 16:24:27] Build script completed successfully
[2025-01-02 16:24:27] Committed changes with message: Auto-commit:
[2025-01-02 16:24:29] Successfully pushed changes
[2025-01-02 16:24:29] Deployment completed successfully
3 changes: 3 additions & 0 deletions site/logs/deploy-20250102-162516.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[2025-01-02 16:25:16] Virtual environment activated
[2025-01-02 16:25:16] Starting deployment process
[2025-01-02 16:25:16] Clean script completed successfully

0 comments on commit cdffcfd

Please sign in to comment.