Commit 3c0e2bed by Bill DeRusha

Add node dependencies to discovery role

parent ef9d734e
......@@ -65,7 +65,7 @@ DISCOVERY_JWT_AUDIENCE: '{{ EDXAPP_JWT_AUDIENCE | default("SET-ME-PLEASE") }}'
DISCOVERY_JWT_ISSUER: '{{ DISCOVERY_OAUTH_URL_ROOT }}'
DISCOVERY_JWT_SECRET_KEY: '{{ EDXAPP_JWT_SECRET_KEY | default("lms-secret") }}'
DISCOVERY_JWT_AUTH:
DISCOVERY_JWT_AUTH:
JWT_ISSUERS:
- AUDIENCE: '{{ DISCOVERY_JWT_AUDIENCE }}'
ISSUER: '{{ DISCOVERY_JWT_ISSUER }}'
......@@ -156,7 +156,8 @@ discovery_environment:
DJANGO_SETTINGS_MODULE: "{{ DISCOVERY_DJANGO_SETTINGS_MODULE }}"
# rename should synch with app
COURSE_DISCOVERY_CFG: "{{ COMMON_CFG_DIR }}/{{ discovery_service_name }}.yml"
PATH: "{{ discovery_venv_dir }}/bin:{{ ansible_env.PATH }}"
PATH: "{{ discovery_nodeenv_bin }}:{{ discovery_venv_dir }}/bin:{{ ansible_env.PATH }}"
discovery_migration_environment:
DJANGO_SETTINGS_MODULE: "{{ DISCOVERY_DJANGO_SETTINGS_MODULE }}"
......@@ -171,6 +172,12 @@ discovery_user: "{{ discovery_service_name }}"
discovery_home: "{{ COMMON_APP_DIR }}/{{ discovery_service_name }}"
discovery_code_dir: "{{ discovery_home }}/{{ discovery_service_name }}"
discovery_nodeenv_dir: "{{ discovery_home }}/nodeenvs/{{ discovery_service_name }}"
discovery_nodeenv_bin: "{{ discovery_nodeenv_dir }}/bin"
discovery_node_modules_dir: "{{ discovery_code_dir }}/node_modules"
discovery_node_bin: "{{ discovery_node_modules_dir }}/.bin"
discovery_node_version: "4.4.7"
discovery_gunicorn_host: "127.0.0.1"
discovery_gunicorn_port: 8381
discovery_gunicorn_timeout: 300
......
......@@ -10,13 +10,13 @@
#
#
# Tasks for role discovery
#
#
# Overview:
#
#
#
# Dependencies:
#
#
#
# Example play:
#
#
......@@ -38,7 +38,7 @@
- install:system-requirements
- name: install python3.5
apt:
apt:
name: "{{ item }}"
with_items:
- python3.5
......@@ -76,6 +76,42 @@
- devstack
- devstack:install
- name: create nodeenv
shell: >
creates={{ discovery_nodeenv_dir }}
{{ discovery_venv_dir }}/bin/nodeenv {{ discovery_nodeenv_dir }} --node={{ discovery_node_version }} --prebuilt
become_user: "{{ discovery_user }}"
tags:
- install
- install:app-requirements
- name: install node dependencies
npm: executable={{ discovery_nodeenv_bin }}/npm path={{ discovery_code_dir }} production=yes
become_user: "{{ discovery_user }}"
environment: "{{ discovery_environment }}"
tags:
- install
- install:app-requirements
- name: install bower dependencies
shell: >
chdir={{ discovery_code_dir }}
. {{ discovery_nodeenv_bin }}/activate && {{ discovery_node_bin }}/bower install --production --config.interactive=false
become_user: "{{ discovery_user }}"
tags:
- install
- install:app-requirements
- name: install js requirements
command: make requirement.js
args:
chdir: "{{ discovery_code_dir }}"
become_user: "{{ discovery_user }}"
environment: "{{ discovery_environment }}"
tags:
- install
- install:app-requirements
- name: migrate database
command: make migrate
args:
......@@ -172,7 +208,7 @@
tags:
- install
- install:app-requirements
- name: run collectstatic
command: make static
args:
......@@ -184,7 +220,7 @@
- assets:gather
- name: restart the application
supervisorctl:
supervisorctl:
state: restarted
supervisorctl_path: "{{ supervisor_ctl }}"
config: "{{ supervisor_cfg }}"
......@@ -199,7 +235,7 @@
template:
src: "edx/app/nginx/sites-available/discovery.j2"
dest: "{{ nginx_sites_available_dir }}/discovery"
owner: root
owner: root
group: "{{ common_web_user }}"
mode: 0640
notify: reload nginx
......@@ -211,8 +247,8 @@
file:
src: "{{ nginx_sites_available_dir }}/discovery"
dest: "{{ nginx_sites_enabled_dir }}/discovery"
state: link
owner: root
state: link
owner: root
group: root
notify: reload nginx
tags:
......
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