Skip to content

Commit

Permalink
roll back the use of 1p
Browse files Browse the repository at this point in the history
  • Loading branch information
dansahagian committed Aug 20, 2024
1 parent 77d71e1 commit e32df5a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__
.idea/

.env
prod.env

venv
.venv
Expand Down
8 changes: 2 additions & 6 deletions bin/deploy
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/zsh

OP_SERVICE_ACCOUNT_TOKEN=$(op read op://Development/op_service_account_token_fbsurvivor/password)

run_command() {
local check="$1"
shift
Expand All @@ -27,10 +25,8 @@ rsync -a ./fbsurvivor dan@linode:/opt/fbsurvivor
rsync -a ./requirements dan@linode:/opt/fbsurvivor
rsync -a ./manage.py dan@linode:/opt/fbsurvivor
rsync -a ./bin dan@linode:/opt/fbsurvivor
rsync -a ./prod.env dan@linode:/opt/fbsurvivor/prod.env

ssh linode /opt/fbsurvivor/bin/deploy_on_server $OP_SERVICE_ACCOUNT_TOKEN
rsync -a ./prod.env dan@linode:/opt/fbsurvivor/.env

sleep 2
ssh linode /opt/fbsurvivor/bin/deploy_on_server

curl -X GET -I https://fbsurvivor.com
13 changes: 7 additions & 6 deletions bin/deploy_on_server
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ cd /opt/fbsurvivor
echo "\nStopping services...\n"
sudo systemctl stop wsgi-server-fbsurvivor.service

export OP_SERVICE_ACCOUNT_TOKEN="$1"
export ENV=prod

op run --env-file="./prod.env" -- .venv/bin/python manage.py migrate
op run --env-file="./prod.env" -- .venv/bin/python manage.py collectstatic --no-input
op run --env-file="./prod.env" -- .venv/bin/python manage.py check --deploy
.venv/bin/python manage.py migrate
.venv/bin/python manage.py collectstatic --no-input
.venv/bin/python manage.py check --deploy

echo "\nStarting services...\n"
sudo systemctl start wsgi-server-fbsurvivor.service

sleep 2

rm .env
17 changes: 0 additions & 17 deletions prod.env

This file was deleted.

0 comments on commit e32df5a

Please sign in to comment.