m.unglue.it and unglue.it are being set up properly
py3-deploy
eric 2020-03-04 11:31:51 -05:00
parent 4b808ce1a9
commit 4b3a7aae82
7 changed files with 27 additions and 16 deletions

View File

@ -15,6 +15,8 @@ git_branch: "py3"
le_endpoint: https://acme-v02.api.letsencrypt.org/directory
#le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
alt_server_name: ""
deploy_type: 'dev' # change to 'test' to activate send_test_email
### Variables in settings.prod.py ###

View File

@ -15,6 +15,7 @@ git_branch: "production"
le_endpoint: https://acme-v02.api.letsencrypt.org/directory
#le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
alt_server_name: "www.unglue.it"
deploy_type: 'prod'
### Variables in settings.prod.py ###
mysql_db_name: "{{ vault_mysql_db_name }}"

View File

@ -65,6 +65,9 @@ INTERNAL_IPS = ('127.0.0.1',)
WORKER_LOG_LEVEL = "INFO"
# start out with nothing scheduled
CELERYBEAT_SCHEDULE = {}
# decide which of the period tasks to add to the schedule
#CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
#CELERYBEAT_SCHEDULE['refresh_acqs'] = REFRESH_ACQS_JOB

View File

@ -60,8 +60,8 @@
- name: Start celeryd
become: yes
command: /etc/init.d/celeryd start
command: /etc/init.d/celeryd restart
- name: Start celerybeat
become: yes
command: /etc/init.d/celerybeat start
command: /etc/init.d/celerybeat restart

View File

@ -6,7 +6,7 @@ CELERYD_PID_FILE="/var/run/celery/%n.pid"
CELERY_BIN="{{ project_path }}/{{ virtualenv_name }}/bin/celery"
CELERYD_USER="celery"
CELERYD_GROUP="celery"
CELERYD_LOG_LEVEL="DEBUG"
CELERYD_LOG_LEVEL="INFO"
VIRTUALENV_ACTIVATE="{{ project_path }}/{{ virtualenv_name }}/bin/activate"
export DJANGO_SETTINGS_MODULE="{{ django_settings_module }}"

View File

@ -98,8 +98,13 @@ STATIC_ROOT = '/var/www/static'
#CKEDITOR_UPLOAD_PATH = '/var/www/static/media/'
#CKEDITOR_UPLOAD_PREFIX = 'https://unglue.it/static/media/'
# start out with nothing scheduled
CELERYBEAT_SCHEDULE = {}
# decide which of the period tasks to add to the schedule
# CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
if '{{ deploy_type }}' == 'test':
CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
elif '{{ deploy_type }}' == 'prod':
# update the statuses of campaigns
CELERYBEAT_SCHEDULE['update_active_campaign_statuses'] = UPDATE_ACTIVE_CAMPAIGN_STATUSES
CELERYBEAT_SCHEDULE['report_new_ebooks'] = EBOOK_NOTIFICATIONS_JOB
@ -109,6 +114,7 @@ CELERYBEAT_SCHEDULE['notify_expiring_accounts'] = NOTIFY_EXPIRING_ACCOUNTS
CELERYBEAT_SCHEDULE['refresh_acqs'] = REFRESH_ACQS_JOB
CELERYBEAT_SCHEDULE['refresh_acqs'] = NOTIFY_UNCLAIMED_GIFTS
ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
# set -- sandbox or production Amazon FPS?

View File

@ -1,11 +1,10 @@
- hosts: regluit-prod
gather_facts: false
tasks:
# Need to install python2.7 and pip first so Ansible will function
# This is due to Ubuntu 16 shipping with Python3 by default
- name: Install python2.7 and pip
# Need to install python3.6 and pip first so Ansible will function
- name: Install python3.6 and pip for dev
become: true
raw: bash -c "apt -qqy update && apt install -qqy python2.7-dev python-pip"
raw: bash -c "apt -qqy update && apt install -y python3.6 python3-pip python3-apt"
register: output
changed_when: output.stdout != ""