Commit 38156281 by Fred Smith Committed by GitHub

Merge pull request #3640 from edx/derf/Build_Notes_Docker_OPS-1993

Build Notes Docker OPS-1993
parents cfabf00c f910e514
# To build this Dockerfile:
#
# From the root of configuration:
#
# docker build -f docker/build/notes/Dockerfile .
#
# This allows the dockerfile to update /edx/app/edx_ansible/edx_ansible
# with the currently checked-out configuration repo.
FROM edxops/xenial-common:latest
MAINTAINER edxops
ENV NOTES_VERSION=master
ENV REPO_OWNER=edx
ADD . /edx/app/edx_ansible/edx_ansible
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
COPY docker/build/notes/ansible_overrides.yml /
RUN sudo /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook notes.yml \
-c local -i '127.0.0.1,' \
-t 'install,assets,devstack:install' \
--extra-vars="@/ansible_overrides.yml" \
--extra-vars="EDX_NOTES_API_VERSION=$NOTES_VERSION" \
--extra-vars="COMMON_GIT_PATH=$REPO_OWNER"
USER root
CMD ["/edx/app/supervisor/venvs/supervisor/bin/supervisord", "-n", "--configuration", "/edx/app/supervisor/supervisord.conf"]
---
edx_notes_api_gunicorn_host: 0.0.0.0
EDX_NOTES_API_MYSQL_HOST: 'db'
EDX_NOTES_API_ELASTICSEARCH_URL: 'http://es:9200/'
COMMON_MYSQL_MIGRATE_USER: '{{ EDX_NOTES_API_MYSQL_DB_USER }}'
COMMON_MYSQL_MIGRATE_PASS: '{{ EDX_NOTES_API_MYSQL_DB_PASSWORD }}'
- name: Deploy Notes
hosts: all
sudo: True
gather_facts: True
vars:
serial_count: 1
serial: "{{ serial_count }}"
roles:
- role: nginx
nginx_sites:
- edx_notes_api
- role: edx_notes_api
......@@ -52,6 +52,9 @@
extra_args: "--exists-action w"
become_user: "{{ edx_notes_api_user }}"
with_items: "{{ edx_notes_api_requirements }}"
tags:
- install
- install:system-requirements
- name: Migrate
shell: >
......@@ -64,6 +67,9 @@
environment:
EDXNOTES_CONFIG_ROOT: "{{ COMMON_CFG_DIR }}"
when: migrate_db is defined and migrate_db|lower == "yes"
tags:
- migrate
- migrate:db
- name: Write out gunicorn.py
template:
......@@ -73,7 +79,8 @@
group: "{{ common_web_user }}"
mode: "0650"
tags:
- deploy
- install
- install:configuration
- name: Write out the supervisor wrapper
template:
......@@ -95,7 +102,8 @@
group: "{{ common_web_user }}"
mode: "0644"
tags:
- deploy
- install
- install:configuration
- name: Setup the edx_notes_api env file
template:
......@@ -117,13 +125,15 @@
force: yes
when: not disable_edx_services
tags:
- deploy
- install
- install:configuration
- name: Update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
when: not disable_edx_services
tags:
- deploy
- manage
- manage:start
- name: Restart supervisor
supervisorctl:
......@@ -133,7 +143,8 @@
state: restarted
when: not disable_edx_services
tags:
- deploy
- manage
- manage:start
- name: Create symlinks from the venv bin dir
file:
......@@ -144,12 +155,18 @@
- python
- pip
- django-admin.py
tags:
- install
- install:app-requirements
- name: Create manage.py symlink
file:
src: "{{ edx_notes_api_manage }}"
dest: "{{ COMMON_BIN_DIR }}/manage.{{ edx_notes_api_service_name }}"
state: link
tags:
- install
- install:app-requirements
- name: Restart edx_notes_api
supervisorctl:
......@@ -159,3 +176,6 @@
state: restarted
when: not disable_edx_services
become_user: "{{ supervisor_service_user }}"
tags:
- manage
- manage:start
......@@ -28,3 +28,4 @@ weights:
- docker-tools: 3
- tools_jenkins: 8
- ecomworker: 4
- notes: 2
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