lobsters / lobsters-ansible

Ansible playbook for lobste.rs
ISC License
78 stars 25 forks source link

Asset changes need puma restarts #85

Open pushcx opened 7 months ago

pushcx commented 7 months ago

The playbook reloads the puma service when possible because it's faster.

I deployed a js-only fix a few minutes ago. Ansible did correctly recompile assets, but the new version didn't appear in prod until I manually ran systemctl restart lobsters-puma. I expect that the same problem would happen with css-only changes, Rails uses the same mechanism of hashing asset contents to use as URL names.

Tasks in roles/lobsters/tasks/main.yml need to update to detect if there were changes in app/assets. The recompile assets task only needs to run if paths there changed. And then the phased restarted puma task shouldn't run and the restart puma task should run.