Commit 835a4172 by Feanil Patel

Added post-checkout actions for edxapp.

Added actions that would result in static assets for the cms and lms
to be generated after the edxapp has been checked out.
parent 64690df8
# Stop all services.
- name: stop lms service
service: name=lms state=stopped
tags:
- lms
- deploy
- name: stop lms-xml service
service: name=lms-xml state=stopped
tags:
- lms-xml
- deploy
- name: stop lms-preview service
service: name=lms-preview state=stopped
tags:
- lms-preview
- deploy
- name: stop cms service
service: name=cms state=stopped
tags:
- cms
- deploy
# Do the checkout.
# Already done via the edxapp role.
# Include that here?
# Do Post Checkout Tasks.
# This checks needs to be run to see if rake can be used but its failure should not stop the run.
- name: check if rake gather_assets is available
shell: executable=/bin/bash chdir=/opt/wwc/edx-platform rake -T | grep --quiet gather_assets_xxx
environment: "{{ deploy_environment }}"
register: grep_gather_assets
ignore_errors: yes
tags:
- lms
- lms-preview
- lms-xml
- cms
- deploy
- name: check if django can collect lms static data
shell: SERVICE_VARIANT={{ LMS_VARIANT }} django-admin.py help collectstatic --pythonpath=/opt/wwc/edx-platform --settings=lms.envs.aws
register: check_lms_collect_static
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- lms
- lms-preview
- lms-xml
- deploy
- name: check if django can collect cms static data
shell: SERVICE_VARIANT={{ LMS_VARIANT }} django-admin.py help collectstatic --pythonpath=/opt/wwc/edx-platform --settings=cms.envs.aws
register: check_cms_collect_static
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
- name: check if django can update cms templates
shell: SERVICE_VARIANT={{ CMS_VARIANT }} django-admin.py help update_templates --pythonpath=/opt/wwc/edx-platform --settings=cms.envs.aws
register: check_cms_update_templates
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
# Gather lms assets using rake if possible
- name: gather lms static assets with rake
shell: executable=/bin/bash chdir=/opt/wwc/edx-platform SERVICE_VARIANT={{ LMS_VARIANT }} rake lms:gather_assets:aws
when: grep_gather_assets.rc == 0
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- lms
- lms-preview
- lms-xml
- deploy
# Gather lms assets using django if necessary(When rake doesn't know how)
- name: gather lms static assets with django
shell: SERVICE_VARIANT={{ LMS_VARIANT }} django-admin.py collectstatic --pythonpath=/opt/wwc/edx-platform --settings=lms.envs.aws
when: grep_gather_assets.rc != 0 and check_lms_collect_static.rc == 0
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- lms
- lms-preview
- lms-xml
- deploy
# Gather cms assets using rake if possible
- name: gather cms static assets with rake
# script: gather_assets.sh
shell: executable=/bin/bash chdir=/opt/wwc/edx-platform SERVICE_VARIANT={{ CMS_VARIANT }} rake cms:gather_assets:aws
when: grep_gather_assets.rc == 0
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
- name: gather cms static assets with django
shell: SERVICE_VARIANT={{ CMS_VARIANT }} django-admin.py collectstatic --pythonpath=/opt/wwc/edx-platform --settings=lms.envs.aws --noinput --verbosity=0
when: grep_gather_assets.rc != 0 and check_cms_collect_static.rc == 0
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
- name: update cms templates
shell: SERVICE_VARIANT={{ CMS_VARIANT }} django-admin.py update_templates --pythonpath=/opt/wwc/edx-platform --settings=cms.envs.aws
when: check_cms_update_templates.rc == 0
sudo: yes
sudo_user: www-data
environment: "{{ deploy_environment }}"
tags:
- cms
- deploy
# Start all services.
# Variables used to deploy the CMS and LMS
LMS_VARIANT: lms
CMS_VARIANT: cms
#PATH: /opt/www/.rbenv/shims:/opt/www/.rbenv/bin:/opt/wwc/edx-platfgorm/bin:$$PATH
deploy_environment:
NO_PREREQ_INSTALL: 1
SKIP_WS_MIGRATIONS: 1
RBENV_ROOT: /opt/www/.rbenv
GEM_HOME: /opt/www/.gem
PATH: /opt/edx/bin:/opt/wwc/edx-platform/bin:/opt/www/.rbenv/bin:/opt/www/.rbenv/shims:/opt/www/.gem/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment