-
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
1 parent
9c6634c
commit 113a486
Showing
7 changed files
with
70 additions
and
3 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,49 @@ | ||
#!/bin/bash | ||
|
||
echo "======================================================================================================" | ||
echo "================================ Stop previous projects and delete it ================================" | ||
echo "======================================================================================================" | ||
cd | ||
sudo systemctl stop gunicorn | ||
rm -rf webdevlab | ||
ls -la | ||
|
||
echo "======================================================================================================" | ||
echo "================================ Clone repository from github ========================================" | ||
echo "======================================================================================================" | ||
git clone git@github.com:MdSamsuzzohaShayon/webdevlab.git | ||
ls -la | ||
|
||
|
||
echo "======================================================================================================" | ||
echo "================================ Deploy Django =======================================================" | ||
echo "======================================================================================================" | ||
cd /home/shayon/webdevlab/server | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
echo "# Django Dot Environment" > .env | ||
nano .env | ||
nano core/settings.py | ||
pip install -r requirements.txt | ||
./manage.py makemigrations | ||
./manage.py migrate | ||
sudo systemctl daemon-reload | ||
sudo systemctl restart gunicorn | ||
# gunicorn core:application --check-config | ||
deactivate | ||
cd | ||
|
||
echo "======================================================================================================" | ||
echo "================================ Deploy Nuxt.js ======================================================" | ||
echo "======================================================================================================" | ||
cd /home/shayon/webdevlab/client | ||
echo "# Nuxt.js Dot Environment" > .env | ||
nano .env | ||
nano utils/keys.ts | ||
npm install | ||
npm run build | ||
npm run generate | ||
sudo rm -rf /var/www/html | ||
sudo cp -r .output/public /var/www/html | ||
cd | ||
ls -la |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export const FRONTEND_URL: string = 'http://localhost:3000' | ||
export const FRONTEND_URL: string = 'http://localhost:3000'; | ||
// export const FRONTEND_URL: string = 'https://webdevlab.org'; |
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
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,14 @@ | ||
# /etc/systemd/system/gunicorn.service | ||
[Unit] | ||
Description=gunicorn daemon for webdevlab | ||
After=network.target | ||
|
||
[Service] | ||
User=shayon | ||
Group=shayon | ||
WorkingDirectory=/home/shayon/webdevlab/server | ||
ExecStart=/home/shayon/webdevlab/server/.venv/bin/gunicorn core.wsgi:application | ||
|
||
|
||
[Install] | ||
WantedBy=multi-user.target |
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 @@ | ||
bind = "0.0.0.0:8000" | ||
workers = 3 |
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 |
---|---|---|
|
@@ -19,3 +19,4 @@ sqlparse==0.4.4 | |
text-unidecode==1.3 | ||
typing_extensions==4.9.0 | ||
urllib3==2.1.0 | ||
gunicorn==21.2.0 |