Static deploys should force gunicorn reload.

This commit is contained in:
Samuel Clay 2024-11-17 20:23:21 -08:00
parent 1a06af95cb
commit b660ec79fe

View file

@ -38,29 +38,29 @@
- never - never
- static - static
- name: Compressing JS/CSS assets - name: Compressing JS/CSS assets
run_once: yes run_once: yes
connection: local connection: local
command: chdir=/srv/newsblur docker run --rm -v /srv/newsblur:/srv/newsblur newsblur/newsblur_deploy command: chdir=/srv/newsblur docker run --rm -v /srv/newsblur:/srv/newsblur newsblur/newsblur_deploy
tags: tags:
- never - never
- static - static
- name: Archive JS/CSS assets for uploading - name: Archive JS/CSS assets for uploading
run_once: yes run_once: yes
connection: local connection: local
archive: archive:
path: /srv/newsblur/static/ path: /srv/newsblur/static/
dest: /srv/newsblur/static.tgz dest: /srv/newsblur/static.tgz
tags: tags:
- never - never
- static - static
- name: Ensure AWS dependencies installed - name: Ensure AWS dependencies installed
run_once: yes run_once: yes
connection: local connection: local
pip: pip:
name: name:
- boto3 - boto3
- botocore - botocore
tags: tags:
@ -82,10 +82,10 @@
tags: tags:
- never - never
- static - static
- name: Downloading JS/CSS assets from S3 - name: Downloading JS/CSS assets from S3
vars: vars:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
amazon.aws.aws_s3: amazon.aws.aws_s3:
bucket: newsblur-backups bucket: newsblur-backups
object: /static_py3.tgz object: /static_py3.tgz
@ -117,7 +117,7 @@
register: pulled register: pulled
tags: tags:
- static - static
- name: Reload gunicorn due to no git upstream changes - name: Reload gunicorn due to no git upstream changes
become: yes become: yes
block: block:
@ -126,13 +126,14 @@
register: psaux register: psaux
- name: Reload gunicorn - name: Reload gunicorn
command: "kill -HUP {{ psaux.stdout }}" command: "kill -HUP {{ psaux.stdout }}"
when: not pulled.changed # Only restart if there were no changes to the git repo or the static tag was applied
when: not pulled.changed or ansible_tags is search('static')
rescue: rescue:
- name: Restart Docker Container - name: Restart Docker Container
command: "docker restart newsblur_web" command: "docker restart newsblur_web"
tags: tags:
- static - static
- name: Start Consul - name: Start Consul
become: yes become: yes
service: service: