Commit de4cdc8b by Jason Bau

Merge pull request #106 from edx/jbau/new-edx-theme

Jbau/new edx theme
parents a52aa6df 7511172d
- hosts: tag_environment_prod:&tag_function_webserver #- hosts: tag_environment_prod:&tag_function_webserver
- hosts: ~tag_Name_app(11|21)_prod
#- hosts: tag_environment_prod:&tag_function_webserver
#- hosts: security_group_edx-prod-EdxappServerSecurityGroup-NSKCQTMZIPQB
sudo: True sudo: True
vars_files: vars_files:
- "{{ secure_dir }}/vars/edxapp_prod_vars.yml" - "{{ secure_dir }}/vars/edxapp_prod_vars.yml"
- "{{ secure_dir }}/vars/users.yml" - "{{ secure_dir }}/vars/users.yml"
- "{{ secure_dir }}/vars/edxapp_prod_users.yml" - "{{ secure_dir }}/vars/edxapp_prod_users.yml"
vars:
secure_dir: '../../../configuration-secure/ansible'
# this indicates the path to site-specific (with precedence)
# things like nginx template files
local_dir: '../../../configuration-secure/ansible/local'
roles: roles:
- common - common
- nginx - nginx
- gunicorn - gunicorn
- edxapp - edxapp
- ruby
- npm
- edx-theme
# run this role last # run this role last
- in_production - in_production
- hosts: tag_environment_prod:&tag_function_util
sudo: True
vars_files:
- "{{ secure_dir }}/vars/edxapp_prod_vars.yml"
- "{{ secure_dir }}/vars/users.yml"
- "{{ secure_dir }}/vars/edxapp_prod_users.yml"
roles:
- common
- edxapp
- edx_worker_upstart
\ No newline at end of file
../secure_example/
\ No newline at end of file
---
secure_dir: '../../configuration-secure/ansible'
# this indicates the path to site-specific (with precedence)
# things like nginx template files
local_dir: '../../configuration-secure/ansible/local'
--- ---
# Restart Start all services. - name: invoke all deploy handlers
- name: restart edxapp shell: echo "running deploy handlers"
service: name=edxapp state=restarted notify:
- gem | gem install bundler
- bundle | bundle install
- Install edx-platform npm dependencies
- install python pre-requirements
- install python base-requirements
- install python post-requirements
- install python post-post requirements
- check if rake gather_assets is available
- check if django can collect lms static data
- check if django can collect cms static data
- check if django can update cms templates
- gather lms static assets with rake
- gather lms static assets with django
- gather cms static assets with rake
- gather cms static assets with django
- update cms templates
- lms asset static failure check
- cms asset static failure check
- stop edxapp
- start edxapp
tags: tags:
- lms - lms
- lms-xml
- lms-preview
- cms - cms
- install
- deploy - deploy
# Ruby plays that need to be run after platform updates. # Ruby plays that need to be run after platform updates.
- name: gem | gem install bundler - name: gem | gem install bundler
shell: RBENV_ROOT={{ rbenv_root }} GEM_HOME={{ gem_home }} {{ rbenv_root }}/shims/gem install bundle chdir={{ platform_code_dir }} shell: RBENV_ROOT={{ rbenv_root }} GEM_HOME={{ gem_home }} {{ rbenv_root }}/shims/gem install bundle chdir={{ platform_code_dir }}
...@@ -30,6 +50,7 @@ ...@@ -30,6 +50,7 @@
tags: tags:
- npm - npm
- update - update
- deploy
# Python plays that need to be run after platform updates. # Python plays that need to be run after platform updates.
...@@ -40,6 +61,7 @@ ...@@ -40,6 +61,7 @@
- lms - lms
- cms - cms
- install - install
- deploy
# Install the python modules into {{ venv_dir }} # Install the python modules into {{ venv_dir }}
- name : install python base-requirements - name : install python base-requirements
...@@ -51,7 +73,7 @@ ...@@ -51,7 +73,7 @@
- lms - lms
- cms - cms
- install - install
- deploy
# Install the python post requirements into {{ venv_dir }} # Install the python post requirements into {{ venv_dir }}
- name : install python post-requirements - name : install python post-requirements
...@@ -60,6 +82,7 @@ ...@@ -60,6 +82,7 @@
- lms - lms
- cms - cms
- install - install
- deploy
# Install the final python modules into {{ venv_dir }} # Install the final python modules into {{ venv_dir }}
- name : install python post-post requirements - name : install python post-post requirements
...@@ -75,6 +98,7 @@ ...@@ -75,6 +98,7 @@
- lms - lms
- cms - cms
- install - install
- deploy
# This check needs to be run to see if rake can be used but its failure should not stop the run. # This check 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 - name: check if rake gather_assets is available
...@@ -126,7 +150,8 @@ ...@@ -126,7 +150,8 @@
shell: executable=/bin/bash chdir={{ platform_code_dir }} SERVICE_VARIANT={{ lms_variant }} rake lms:gather_assets:aws shell: executable=/bin/bash chdir={{ platform_code_dir }} SERVICE_VARIANT={{ lms_variant }} rake lms:gather_assets:aws
when: grep_gather_assets.rc == 0 when: grep_gather_assets.rc == 0
notify: notify:
- restart edxapp - stop edxapp
- start edxapp
sudo: yes sudo: yes
sudo_user: www-data sudo_user: www-data
environment: "{{ deploy_environment }}" environment: "{{ deploy_environment }}"
...@@ -141,7 +166,8 @@ ...@@ -141,7 +166,8 @@
shell: SERVICE_VARIANT={{ lms_variant }} django-admin.py collectstatic --pythonpath={{ platform_code_dir }} --settings=lms.envs.aws --noinput --verbosity=0 shell: SERVICE_VARIANT={{ lms_variant }} django-admin.py collectstatic --pythonpath={{ platform_code_dir }} --settings=lms.envs.aws --noinput --verbosity=0
when: grep_gather_assets.rc != 0 and check_lms_collect_static.rc == 0 when: grep_gather_assets.rc != 0 and check_lms_collect_static.rc == 0
notify: notify:
- restart edxapp - stop edxapp
- start edxapp
sudo: yes sudo: yes
sudo_user: www-data sudo_user: www-data
environment: "{{ deploy_environment }}" environment: "{{ deploy_environment }}"
...@@ -158,7 +184,8 @@ ...@@ -158,7 +184,8 @@
shell: executable=/bin/bash chdir={{ platform_code_dir }} SERVICE_VARIANT={{ cms_variant }} rake cms:gather_assets:aws shell: executable=/bin/bash chdir={{ platform_code_dir }} SERVICE_VARIANT={{ cms_variant }} rake cms:gather_assets:aws
when: grep_gather_assets.rc == 0 when: grep_gather_assets.rc == 0
notify: notify:
- restart edxapp - stop edxapp
- start edxapp
sudo: yes sudo: yes
sudo_user: www-data sudo_user: www-data
environment: "{{ deploy_environment }}" environment: "{{ deploy_environment }}"
...@@ -170,7 +197,8 @@ ...@@ -170,7 +197,8 @@
shell: SERVICE_VARIANT={{ cms_variant }} django-admin.py collectstatic --pythonpath={{ platform_code_dir }} --settings=lms.envs.aws --noinput --verbosity=0 shell: SERVICE_VARIANT={{ cms_variant }} django-admin.py collectstatic --pythonpath={{ platform_code_dir }} --settings=lms.envs.aws --noinput --verbosity=0
when: grep_gather_assets.rc != 0 and check_cms_collect_static.rc == 0 when: grep_gather_assets.rc != 0 and check_cms_collect_static.rc == 0
notify: notify:
- restart edxapp - stop edxapp
- start edxapp
sudo: yes sudo: yes
sudo_user: www-data sudo_user: www-data
environment: "{{ deploy_environment }}" environment: "{{ deploy_environment }}"
...@@ -182,7 +210,8 @@ ...@@ -182,7 +210,8 @@
shell: SERVICE_VARIANT={{ cms_variant }} django-admin.py update_templates --pythonpath={{ platform_code_dir }} --settings=cms.envs.aws shell: SERVICE_VARIANT={{ cms_variant }} django-admin.py update_templates --pythonpath={{ platform_code_dir }} --settings=cms.envs.aws
when: check_cms_update_templates.rc == 0 when: check_cms_update_templates.rc == 0
notify: notify:
- restart edxapp - stop edxapp
- start edxapp
sudo: yes sudo: yes
sudo_user: www-data sudo_user: www-data
environment: "{{ deploy_environment }}" environment: "{{ deploy_environment }}"
...@@ -206,3 +235,21 @@ ...@@ -206,3 +235,21 @@
tags: tags:
- cms - cms
- deploy - deploy
- name: stop edxapp
service: name=edxapp state=stopped
tags:
- lms
- lms-xml
- lms-preview
- cms
- deploy
- name: start edxapp
service: name=edxapp state=started
tags:
- lms
- lms-xml
- lms-preview
- cms
- deploy
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
- lms - lms
- cms - cms
- install - install
- deploy
# Do Post Checkout Tasks. # Do Post Checkout Tasks.
- name: create platform code dir - name: create platform code dir
...@@ -26,6 +27,18 @@ ...@@ -26,6 +27,18 @@
- cms - cms
- install - install
- name: checkout theme
git: dest={{app_base_dir}}/themes/{{edxapp_theme_name}} repo={{edxapp_theme_source_repo}} version={{edxapp_theme_version}}
when: edxapp_theme_name != ''
tags:
- cms
- lms-xml
- lms-preview
- lms
- update
- deploy
# TODO: Check git.py _run_if_changed() to see if the logic there to skip running certain # TODO: Check git.py _run_if_changed() to see if the logic there to skip running certain
# portions of the deploy needs to be incorporated here. # portions of the deploy needs to be incorporated here.
...@@ -33,27 +46,19 @@ ...@@ -33,27 +46,19 @@
file: path={{platform_code_dir}} state=directory owner=www-data group=www-data recurse=yes file: path={{platform_code_dir}} state=directory owner=www-data group=www-data recurse=yes
# Post Checkout tasks will get run as handlers when the {{ platform_code_dir }} is ready. # Post Checkout tasks will get run as handlers when the {{ platform_code_dir }} is ready.
# Look at the handlers/main.yml in this role for a description of the tasks stated below. # Look at the handlers/main.yml in this role for a description of the tasks stated below.
notify:
- gem | gem install bundler
- bundle | bundle install
- Install edx-platform npm dependencies
- install python pre-requirements
- install python base-requirements
- install python post-requirements
- install python post-post requirements
- check if rake gather_assets is available
- check if django can collect lms static data
- check if django can collect cms static data
- check if django can update cms templates
- gather lms static assets with rake
- gather lms static assets with django
- gather cms static assets with rake
- gather cms static assets with django
- update cms templates
- lms asset static failure check
- cms asset static failure check
tags: tags:
- lms - lms
- cms - cms
- install - install
- deploy
# want deploy handlers to always run when deploy tag is specified, so move into a no op task
- name: run deploy handlers
shell: echo "running deploy handlers"
notify:
- invoke all deploy handlers
tags:
- lms
- cms
- install
- deploy
...@@ -15,6 +15,14 @@ ...@@ -15,6 +15,14 @@
- lms-preview - lms-preview
- lms-preview-env - lms-preview-env
- name: Create lms-preview log target directory
file: path={{log_base_dir}}/lms-preview state=directory owner=syslog group=adm mode=2770
tags:
- lms-preview
- lms-preview-env
- logging
- update
- include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-preview - include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-preview
- include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-preview-backend - include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-preview-backend
......
...@@ -6,17 +6,25 @@ ...@@ -6,17 +6,25 @@
- name: create lms-xml application config - name: create lms-xml application config
template: src=lms-xml.env.json.j2 dest=$app_base_dir/lms-xml.env.json mode=640 owner=www-data group=adm template: src=lms-xml.env.json.j2 dest=$app_base_dir/lms-xml.env.json mode=640 owner=www-data group=adm
tags: tags:
- cms-env - lms-xml-env
- cms - lmx-xml
- update - update
- name: create lms-xml auth file - name: create lms-xml auth file
template: src=lms-xml.auth.json.j2 dest=$app_base_dir/lms-xml.auth.json mode=640 owner=www-data group=adm template: src=lms-xml.auth.json.j2 dest=$app_base_dir/lms-xml.auth.json mode=640 owner=www-data group=adm
tags: tags:
- cms-env - lms-xml-env
- cms - lmx-xml
- update - update
- name: Create lms-xml log target directory
file: path={{log_base_dir}}/lms-xml state=directory owner=syslog group=adm mode=2770
tags:
- lms-xml
- lms-xml-env
- logging
- update
- include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-xml - include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-xml
- include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-xml-backend - include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-xml-backend
......
...@@ -13,6 +13,14 @@ ...@@ -13,6 +13,14 @@
- lms-env - lms-env
- update - update
- name: Create lms log target directory
file: path={{log_base_dir}}/lms state=directory owner=syslog group=adm mode=2770
tags:
- lms
- lms-env
- logging
- update
- include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms - include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms
- include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-backend - include: ../../nginx/tasks/nginx_site.yml state=link site_name=lms-backend
# Creates LMS upstart file # Creates LMS upstart file
......
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
- lms-env - lms-env
- update - update
- name: Create theming directory
- name: Create lms log target directory file: path={{ app_base_dir }}/themes state=directory mode=2775 group=adm owner=www-data
file: path={{log_base_dir}}/lms state=directory owner=syslog group=adm mode=2770
tags: tags:
- cms
- lms - lms
- cms-env
- lms-env - lms-env
- logging
- update - update
# Install ssh keys for ubuntu account to be able to check out from edx-platform # Install ssh keys for ubuntu account to be able to check out from edx-platform
......
...@@ -24,10 +24,18 @@ cms_env_config: {} ...@@ -24,10 +24,18 @@ cms_env_config: {}
lms_xml_auth_config: {} lms_xml_auth_config: {}
lms_xml_env_config: {} lms_xml_env_config: {}
lms_source_repo: git@github.com:edx/edx-platform.git #Theming
#To turn off theming, specify edxapp_theme_name: ''
#Stanford, for example, uses edxapp_theme_name: 'stanford'
edxapp_theme_name: ''
edxapp_theme_source_repo: 'git://github.com/Stanford-Online/edx-theme.git'
edxapp_theme_version: 'HEAD'
# make this the public URL instead of writable
lms_source_repo: git://github.com/edx/edx-platform.git
lms_version: 'HEAD' lms_version: 'HEAD'
local_requirements_file: "{{ platform_code_dir }}/requirements/edx/local.txt" local_requirements_file: "{{ platform_code_dir }}/requirements/edx/local.txt"
pre_requirements_file: "{{ platform_code_dir }}/requirements/edx/pre.txt" pre_requirements_file: "{{ platform_code_dir }}/requirements/edx/pre.txt"
post_requirements_file: "{{ platform_code_dir }}/requirements/edx/post.txt" post_requirements_file: "{{ platform_code_dir }}/requirements/edx/post.txt"
base_requirements_file: "{{ platform_code_dir }}/requirements/edx/base.txt" base_requirements_file: "{{ platform_code_dir }}/requirements/edx/base.txt"
github_requirements_file: "{{ platform_code_dir }}/requirements/edx/github.txt" github_requirements_file: "{{ platform_code_dir }}/requirements/edx/github.txt"
...@@ -117,6 +125,7 @@ lms_variant: lms ...@@ -117,6 +125,7 @@ lms_variant: lms
cms_variant: cms cms_variant: cms
deploy_environment: deploy_environment:
LANG: "en_US.UTF-8"
NO_PREREQ_INSTALL: 1 NO_PREREQ_INSTALL: 1
SKIP_WS_MIGRATIONS: 1 SKIP_WS_MIGRATIONS: 1
RBENV_ROOT: "{{ rbenv_root }}" RBENV_ROOT: "{{ rbenv_root }}"
......
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