Bladeren bron

Update fifteen5 role

Colin Powell 2 jaren geleden
bovenliggende
commit
f31d83df82

+ 1 - 1
ansible/roles/fifteen5/files/nginx-location.conf

@@ -18,7 +18,7 @@ location /static/static {
          alias /usr/local/src/fifteen5/collected-static;
 }
 location / {
-         proxy_pass http://127.0.0.1:8088;
+         proxy_pass http://127.0.0.1:8087;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $host;
          proxy_redirect off;

+ 14 - 4
ansible/roles/fifteen5/tasks/main.yml

@@ -2,7 +2,7 @@
 - name: Dependencies installed
   # We install xmlsec and cairocffi using pkg because python-Levenshtein is tricky to install on FreeBSD
   community.general.pkgng:
-    name: git,py38-pip,fish,direnv,jpeg-turbo,tiff,webp,lcms2,freetype2,yarn-node16,cairo,pango,gmake,libxml2,libxslt,py38-psycopg2,py38-xmlsec,py38-cairocffi,py38-sqlite3,bash,py38-libcst, cmake, ninja
+    name: git,py39-pip,fish,direnv,jpeg-turbo,tiff,webp,lcms2,freetype2,yarn-node16,cairo,pango,gmake,libxml2,libxslt,py39-psycopg2,py39-xmlsec,py39-cairocffi,py39-sqlite3,py39-numpy,bash,py39-libcst,cmake,ninja
     state: latest
 
 - name: Tmux config installed
@@ -32,7 +32,7 @@
 
 - name: Create python bin link for yarn
   file:
-    src: /usr/local/bin/python3.8
+    src: /usr/local/bin/python3.9
     dest: /usr/bin/python
     owner: root
     state: link
@@ -72,6 +72,16 @@
   tags:
     - deploy
 
+- cron:
+    name: "Cron job to clear out tmp files every 5 minutes installed"
+    minute: "5"
+    job: 'find /usr/local/src/fifteen5 -type f -name ".syncthing*.tmp" -delete'
+
+- cron:
+    name: "Cron job to clear out syncthing conflicts every 30 min"
+    minute: "30"
+    job: 'find /usr/local/src/fifteen5 -type f -name "*.sync-conflict*" -delete'
+
 - name: 15Five requirements up to date
   pip:
     requirements: /usr/local/src/fifteen5/requirements/test.pip
@@ -96,7 +106,7 @@
     - deploy
 
 - name: 15Five migrations up to date
-  command: bash -lc "direnv exec /usr/local/src/fifteen5 /usr/local/bin/python3.8 /usr/local/src/fifteen5/manage.py migrate"
+  command: bash -lc "direnv exec /usr/local/src/fifteen5 /usr/local/bin/python3.9 /usr/local/src/fifteen5/manage.py migrate"
   tags:
     - deploy
 
@@ -108,7 +118,7 @@
     - deploy
 
 - name: 15Five frontend files generated
-  command: bash -lc "direnv exec /usr/local/src/fifteen5 /usr/local/bin/python3.8 manage.py collectstatic --noinput && direnv exec /usr/local/src/fifteen5 /usr/local/bin/python3.8 manage.py collectstatic_js_reverse"
+  command: bash -lc "direnv exec /usr/local/src/fifteen5 /usr/local/bin/python3.9 manage.py collectstatic --noinput && direnv exec /usr/local/src/fifteen5 /usr/local/bin/python3.9 manage.py collectstatic_js_reverse"
   args:
     chdir: "/usr/local/src/fifteen5"
   tags:

+ 1 - 2
ansible/roles/fifteen5/templates/envrc.j2

@@ -2,7 +2,6 @@ export PYTHONPATH=`pwd`
 export PYTEST_ADDOPTS='-rs --durations=10 --reuse-db --isort --flake8'
 export DJANGO_SETTINGS_MODULE=ff.settings.dev.colin
 export FF_LOCAL_DOMAIN=five.unbl.ink
-export CELERY_TASK_ALWAYS_EAGER=False
 
 export FF_LOG_FILE_PATH=/var/log/
 export FF_LOG_LEVEL=DEBUG
@@ -28,7 +27,7 @@ export FF_EMAIL_HOST='mailhog.unbl.ink'
 export FF_EMAIL_PORT=1025
 export FF_SECRET_KEY={{fifteenfive_secret_key}}
 export FF_DEBUG_TOOLBAR=True
-export FF_REDIS_LOCATION=redis://:{{redis_password}}@cache.unbl.ink/
+export FF_REDIS_LOCATION=redis://:{{redis_password}}@cache.service/15
 
 export FF_SFTP_FORWARDER_SECRET=notasecret
 export FF_SFTP_ALLOW_DUPLICATE_FILES=True