-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update fabfile with new deployment #535
base: next
Are you sure you want to change the base?
Changes from 4 commits
dbb5795
a53943d
dd963e6
cb5cb68
75d25ad
9122863
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,15 @@ | |
@task | ||
def deploy(): | ||
with cd("/data/stregsystem"): | ||
sudo("systemctl stop apache2.service") | ||
sudo("systemctl stop stregsystem.socket") | ||
sudo("systemctl stop stregsystem.service") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the stregsystem.socket and stregsystem.service systemd files located in the repository too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They actually aren't 😓 , do you have an idea for where to store them? Currently, they are just on the server There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Merry christmas also 🎅 |
||
with settings(sudo_user='stregsystem'): | ||
sudo("git pull --ff-only") | ||
with prefix("source /data/stregsystem/venv/bin/activate"): | ||
sudo("pip install -rrequirements.txt") | ||
sudo("pip install -rrequirements-prod.txt") | ||
krestenlaust marked this conversation as resolved.
Show resolved
Hide resolved
|
||
sudo("python manage.py collectstatic --noinput") | ||
sudo("python manage.py migrate") | ||
sudo("python manage.py reloadthemes database") | ||
sudo("systemctl start apache2.service") | ||
sudo("systemctl reload apache2.service") | ||
krestenlaust marked this conversation as resolved.
Show resolved
Hide resolved
|
||
sudo("systemctl start stregsystem.socket") | ||
krestenlaust marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to shutdown both of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it should only be necessary to stop
stregsystem.socket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens to the existing stregsystem.service? Or is it only active during a request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo, whooops. I meant to say that it should only be necessary to shut down
stregsystem.service
. To answer your question, it keeps running once startedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, what happens if apache2 tries to invoke stregsystem.socket during a deployment, then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I guess it's best to keep the
systemctl stop stregsystem.socket
then