-
Deploy from
productionbranch -
After any change to our graphql api, regenerate graphql api usig
generate_graphql_docsthen commit new docs -
Postgres
- Backup postgres database or ensure a recent version of postgres backup
-
Caddy
- Update
caddyconfig with the latest config if any - stop and start caddy with new config
echo **START**;ulimit -n 8192; /opt/bin/caddy -conf=/opt/cfg/caddy.cfg -agree && echo **OK** || echo **ERROR**
- Update
-
CRM
-
check where is
DATA_DIRincrm.settings_prod.pyand backup this DIRWarningDATA_DIRsettings may have been overridden byexport DATA_DIR={custom_path}
-
make sure you're in production branch and pull new production code
-
stop crm
-
backup data by running
flask dumpdataand take another copyDATA_DIR -
runt script
./prepare.sh --prodto install all needed requirements or refer to Installation page -
run DB migrations
flask db upgradeto run migrations and update Physical DB -
make sure you can dumpdata correctly using
flask dumpdataand take a 3rd copy of data forcrm.settings.DATA_DIR -
Run
/opt/code/github/incubaid/crm# echo **START**;cd /opt/code/github/incubaid/crm;export SQLALCHEMY_DATABASE_URI=postgresql://user:pass@host:5432/db;export CACHE_BACKEND_URI=redis://{ip}:{port}/{db_number};export ENV=prod;export FLASK_APP=app.py;flask db upgrade; uwsgi --ini uwsgi.ini && echo **OK** || echo **ERROR**
-