Skip to content
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

Open
wants to merge 6 commits into
base: next
Choose a base branch
from
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Comment on lines +7 to +8
Copy link
Member Author

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?

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

Copy link
Member Author

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

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 started

Copy link
Member Author

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?

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

Copy link
Collaborator

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The 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

Copy link
Member Author

Choose a reason for hiding this comment

The 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
Loading