Browse Source

[fifteenfive] Fix run scripts and deps

Colin Powell 3 years ago
parent
commit
665d1aa175

+ 1 - 1
ansible/roles/fifteen5/files/celery-supervisor.conf

@@ -1,5 +1,5 @@
 [program:celery]
-command=/usr/local/bin/bash -lc "direnv exec /usr/local/src/fifteen5 celery -A ff -B -l DEBUG -S django -Q test1,celery"
+command=/usr/local/bin/bash -lc "direnv exec /usr/local/src/fifteen5 celery -A ff worker -B -l DEBUG -c 2 -S django -Q test1,celery"
 autostart=true
 autorestart=true
 stdout_logfile=/var/log/celery.log

+ 5 - 4
ansible/roles/fifteen5/files/fifteen5-supervisor.conf

@@ -1,7 +1,8 @@
-[program:daphne]
-command=/usr/local/bin/bash -lc "direnv exec /usr/local/src/fifteen5 daphne -b 0.0.0.0 -p 8000 ff.asgi:application"
+[program:uvicorn]
+command=/usr/local/bin/bash -lc "direnv exec /usr/local/src/fifteen5 uvicorn --host 0.0.0.0 --port 8000 --debug ff.asgi:application --reload"
 autostart=true
 autorestart=true
-stdout_logfile=/var/log/daphne.log
-stderr_logfile=/var/log/daphne.log
+directory=/usr/local/src/fifteen5
+stdout_logfile=/var/log/uvicorn.log
+stderr_logfile=/var/log/uvicorn.log
 stopsignal=QUIT

+ 2 - 2
ansible/roles/fifteen5/files/fifteen5-yarn-supervisor.conf

@@ -1,8 +1,8 @@
 [program:yarn]
 command=/usr/local/bin/bash -lc "direnv exec /usr/local/src/fifteen5 yarn serve"
 directory=/usr/local/src/fifteen5
-autostart=true
-autorestart=true
+autostart=false
+autorestart=false
 stdout_logfile=/var/log/yarn.log
 stderr_logfile=/var/log/yarn.log
 stopsignal=QUIT

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

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

+ 8 - 2
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,syncthing,yarn-node14,cairo,pango,gmake,libxml2,libxslt,postgresql12-client,py38-xmlsec,py38-cairocffi,py38-sqlite3,bash
+    name: git,py38-pip,fish,direnv,jpeg-turbo,tiff,webp,lcms2,freetype2,syncthing,yarn-node14,cairo,pango,gmake,libxml2,libxslt,postgresql12-client,py38-xmlsec,py38-cairocffi,py38-sqlite3,bash,py38-libcst
     state: latest
 
 - name: Root shell is fish
@@ -77,6 +77,11 @@
   tags:
     - deploy
 
+- name: Hack patch for clearbit bullshit
+  shell:
+    cmd: 'sed -i -e "s/clearbit/#clearbit/g" /usr/local/src/fifteen5/requirements/common.txt'
+    warn: false
+
 - name: 15Five requirements up to date
   pip:
     requirements: /usr/local/src/fifteen5/requirements/test.pip
@@ -95,6 +100,7 @@
       - ipython
       - git+git://github.com/sureapp/sqlformatter
       - python-json-logger
+      - git+git://github.com/zensourcer/clearbit-python.git#egg=clearbit
     executable: pip
   tags:
     - deploy
@@ -107,7 +113,7 @@
 - name: 15Five BE supervisor file installed
   copy:
     src: fifteen5-supervisor.conf
-    dest: /usr/local/etc/supervisor/conf.d/daphne.conf
+    dest: /usr/local/etc/supervisor/conf.d/uvicorn.conf
     owner: root
     mode: 0644
   notify: Supervisor restarted

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

@@ -20,7 +20,7 @@ export FF_AWS_ENDPOINT_URL='http://s3.unbl.ink'
 export FF_DB_NAME=fifteen5
 export FF_DB_USER=fifteenfive
 export FF_DB_PASSWORD={{fifteenfive_db_pass}}
-export FF_DB_HOST=db.unbl.ink
+export FF_DB_HOST=db.service
 export FF_DB_PORT=5432
 
 export FF_EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend'
@@ -70,3 +70,6 @@ export FF_SALESFORCE_HOST=https://15five--15fivesb.my.salesforce.com
 
 export FF_SLACK_OAUTH_CLIENT_ID=2743272933910.2752561950708
 export FF_SLACK_OAUTH_CLIENT_SECRET={{fifteenfive_slack_oauth_client_secret}}
+
+export FF_ADP_OAUTH_CLIENT_ID={{fifteenfive_adp_oauth_client_id}}
+export FF_ADP_OAUTH_CLIENT_SECRET={{fifteenfive_adp_oauth_client_secret}}