-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·44 lines (36 loc) · 950 Bytes
/
deploy.sh
File metadata and controls
executable file
·44 lines (36 loc) · 950 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Exit on any error
set -e
# Navigate to the project directory
cd "$(dirname "$0")"
# Pull the latest changes from the repository
echo "Pulling latest changes..."
git pull origin main || {
echo "Failed to pull latest changes"
exit 1
}
# Stop and remove existing containers
echo "Stopping and removing existing containers..."
docker compose down || {
echo "Failed to stop containers"
exit 1
}
# Install the Python package in development mode inside the container
echo "Installing Python package..."
docker compose run --rm django pip install -e . || {
echo "Failed to install Python package"
exit 1
}
# Build the Docker images
echo "Building Docker images..."
docker compose build --no-cache || {
echo "Failed to build images"
exit 1
}
# Start the containers
echo "Starting the containers..."
docker compose up -d || {
echo "Failed to start containers"
exit 1
}
echo "Deployment completed!"