-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
30 lines (23 loc) · 782 Bytes
/
deploy.sh
File metadata and controls
30 lines (23 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# -------------------------------
# Automatic deployment script
# -------------------------------
# Set PATH to ensure docker-compose is found
export PATH=$PATH:/usr/bin:/usr/local/bin
# Go to project directory
cd /home/vector/microbank/Micro-Banking-System || exit
# Log start time
echo "----------------------------"
echo "Deployment started at $(date)"
echo "----------------------------"
# Reset local changes and pull latest main branch
git fetch origin main
git reset --hard origin/main
# Rebuild and restart containers using docker-compose
docker-compose down
docker-compose up -d --build
# Log completion
echo "Deployment completed at $(date)"
echo "----------------------------"
echo "All services are up and running."
echo "----------------------------"