-
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.
Merge pull request #46 from bendsouza2/feature/ec2-auto-update
add shell scripts for cluster setup and refresh
- Loading branch information
Showing
4 changed files
with
49 additions
and
1 deletion.
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,34 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Install Build Dependencies | ||
sudo add-apt-repository -y ppa:deadsnakes/ppa | ||
sudo apt-get update | ||
sudo apt-get install python3.10 python3.10-venv | ||
sudo apt install -y libmysqlclient-dev default-libmysqlclient-dev build-essential pkg-config | ||
|
||
#Clone the repo | ||
git clone --no-checkout --branch main https://github.com/bendsouza2/yt-translator.git yt_translator | ||
cd yt_translator | ||
|
||
python3.10 -m venv venv | ||
|
||
git sparse-checkout init --cone | ||
echo "app/" >> .git/info/sparse-checkout | ||
echo "requirements.txt" >> .git/info/sparse-checkout | ||
git checkout main | ||
|
||
# Copy post-merge hook | ||
if [ ! -f .git/hooks/post-merge ]; then | ||
cp hooks/post-merge .git/hooks/post-merge | ||
chmod +x .git/hooks/post-merge | ||
else | ||
echo "post-merge hook already exists, skipping copy." | ||
fi | ||
|
||
|
||
if [ ! -f venv ]; then | ||
python3.10 -m venv venv | ||
else | ||
echo "venv already exists, skipping venv creation" | ||
fi |
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,2 @@ | ||
#!/bin/bash | ||
bash /home/ubuntu/yt_translator/app/post_update.sh |
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,12 @@ | ||
#!/bin/bash | ||
|
||
# Copy custom settings file | ||
if [ ! -f settings.py ]; then | ||
echo "Restoring settings.py..." | ||
cp /home/ubuntu/settings_backup/settings.py video_host/settings.py | ||
fi | ||
|
||
source /home/ubuntu/yt_translator/venv/bin/activate | ||
python manage.py migrate | ||
|
||
|
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