-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# deploy.sh | ||
|
||
set -e # Exit immediately if a command exits with a non-zero status | ||
|
||
# Define variables | ||
PROJECT_DIR=$(pwd) | ||
VENV_DIR="$PROJECT_DIR/venv" | ||
REQUIREMENTS_FILE="$PROJECT_DIR/requirements.txt" | ||
|
||
# Create a virtual environment | ||
if [ ! -d "$VENV_DIR" ]; then | ||
echo "Creating virtual environment..." | ||
python3 -m venv "$VENV_DIR" | ||
fi | ||
|
||
# Activate the virtual environment | ||
echo "Activating virtual environment..." | ||
source "$VENV_DIR/bin/activate" | ||
|
||
# Install dependencies | ||
echo "Installing dependencies from $REQUIREMENTS_FILE..." | ||
pip install -r "$REQUIREMENTS_FILE" | ||
|
||
# Run database migrations (if applicable) | ||
# Uncomment the following line if using a database with migrations | ||
# echo "Running database migrations..." | ||
# python manage.py migrate | ||
|
||
echo "Deployment completed successfully!" |