Commit ae0ad293 by John Jarvis

skip some tasks when the edx-platfor checkout hasn't changed

parent 73bff7d6
...@@ -30,14 +30,14 @@ ...@@ -30,14 +30,14 @@
# Do A Checkout # Do A Checkout
- name: edxapp | checkout edx-platform repo into {{edxapp_code_dir}} - name: edxapp | checkout edx-platform repo into {{edxapp_code_dir}}
git: dest={{edxapp_code_dir}} repo={{edx_platform_repo}} version={{edx_platform_commit}} git: dest={{edxapp_code_dir}} repo={{edx_platform_repo}} version={{edx_platform_commit}}
register: edx_platform_checkout register: chkout
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags: tags:
- deploy - deploy
- name: edxapp | git clean after checking out edx-platform - name: edxapp | git clean after checking out edx-platform
shell: cd {{edxapp_code_dir}} && git clean -xdf shell: cd {{edxapp_code_dir}} && git clean -xdf
when: edx_platform_checkout.changed when: chkout.changed
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags: tags:
- deploy - deploy
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
/usr/bin/md5sum {{ " ".join(edxapp_all_req_files) }} 2>/dev/null > /var/tmp/edxapp.req.new /usr/bin/md5sum {{ " ".join(edxapp_all_req_files) }} 2>/dev/null > /var/tmp/edxapp.req.new
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
ignore_errors: true ignore_errors: true
when: chkout.changed
tags: tags:
- deploy - deploy
...@@ -72,7 +73,7 @@ ...@@ -72,7 +73,7 @@
/bin/sed -i -e 's/github\.com/{{ COMMON_GIT_MIRROR }}/g' {{ item }} /bin/sed -i -e 's/github\.com/{{ COMMON_GIT_MIRROR }}/g' {{ item }}
with_items: edxapp_all_req_files with_items: edxapp_all_req_files
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5 when: chkout.changed and not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy tags: deploy
...@@ -84,7 +85,7 @@ ...@@ -84,7 +85,7 @@
executable=/bin/bash executable=/bin/bash
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5 when: chkout.changed and not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy tags: deploy
- name: edxapp | bundle install - name: edxapp | bundle install
...@@ -94,7 +95,7 @@ ...@@ -94,7 +95,7 @@
executable=/bin/bash executable=/bin/bash
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5 when: chkout.changed and not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy tags: deploy
# Node play that need to be run after platform updates. # Node play that need to be run after platform updates.
...@@ -102,7 +103,7 @@ ...@@ -102,7 +103,7 @@
shell: npm install chdir={{ edxapp_code_dir }} shell: npm install chdir={{ edxapp_code_dir }}
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5 when: chkout.changed and not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy tags: deploy
...@@ -115,7 +116,7 @@ ...@@ -115,7 +116,7 @@
extra_args="-i {{ edxapp_pypi_local_mirror }}" extra_args="-i {{ edxapp_pypi_local_mirror }}"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5 when: chkout.changed and not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy tags: deploy
# Install the python modules into {{ edxapp_venv_dir }} # Install the python modules into {{ edxapp_venv_dir }}
...@@ -128,7 +129,7 @@ ...@@ -128,7 +129,7 @@
chdir={{ edxapp_code_dir }} chdir={{ edxapp_code_dir }}
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5 when: chkout.changed and not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy tags: deploy
# Install the python post requirements into {{ edxapp_venv_dir }} # Install the python post requirements into {{ edxapp_venv_dir }}
...@@ -140,7 +141,7 @@ ...@@ -140,7 +141,7 @@
extra_args="-i {{ edxapp_pypi_local_mirror }}" extra_args="-i {{ edxapp_pypi_local_mirror }}"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5 when: chkout.changed and not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy tags: deploy
# Install the final python modules into {{ edxapp_venv_dir }} # Install the final python modules into {{ edxapp_venv_dir }}
...@@ -154,7 +155,7 @@ ...@@ -154,7 +155,7 @@
- "{{ github_requirements_file }}" - "{{ github_requirements_file }}"
- "{{ local_requirements_file }}" - "{{ local_requirements_file }}"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5 when: chkout.changed and not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy tags: deploy
...@@ -170,12 +171,13 @@ ...@@ -170,12 +171,13 @@
- "{{ sandbox_post_requirements }}" - "{{ sandbox_post_requirements }}"
when: install_sandbox_reqs_into_regular_venv when: install_sandbox_reqs_into_regular_venv
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5 when: chkout.changed and not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy tags: deploy
- name: edxapp | create checksum for installed requirements - name: edxapp | create checksum for installed requirements
shell: cp /var/tmp/edxapp.req.new /var/tmp/edxapp.req.installed shell: cp /var/tmp/edxapp.req.new /var/tmp/edxapp.req.installed
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
when: chkout.changed
tags: deploy tags: deploy
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
executable=/bin/bash executable=/bin/bash
chdir={{ edxapp_code_dir }} chdir={{ edxapp_code_dir }}
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
when: celery_worker is not defined when: chkout.changed and celery_worker is not defined
with_items: service_variants_enabled with_items: service_variants_enabled
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
tags: tags:
...@@ -68,13 +68,13 @@ ...@@ -68,13 +68,13 @@
- name: edxapp | syncdb and migrate - name: edxapp | syncdb and migrate
shell: sudo -u {{ edxapp_user }} SERVICE_VARIANT=lms {{ edxapp_venv_bin}}/django-admin.py syncdb --migrate --noinput --settings=lms.envs.aws --pythonpath={{ edxapp_code_dir }} shell: sudo -u {{ edxapp_user }} SERVICE_VARIANT=lms {{ edxapp_venv_bin}}/django-admin.py syncdb --migrate --noinput --settings=lms.envs.aws --pythonpath={{ edxapp_code_dir }}
when: migrate_db is defined and migrate_db|lower == "yes" when: chkout and migrate_db is defined and migrate_db|lower == "yes"
tags: tags:
- deploy - deploy
- name: edxapp | db migrate - name: edxapp | db migrate
shell: sudo -u {{ edxapp_user }} SERVICE_VARIANT=lms {{ edxapp_venv_bin }}/django-admin.py migrate --noinput --settings=lms.envs.aws --pythonpath={{ edxapp_code_dir }} shell: sudo -u {{ edxapp_user }} SERVICE_VARIANT=lms {{ edxapp_venv_bin }}/django-admin.py migrate --noinput --settings=lms.envs.aws --pythonpath={{ edxapp_code_dir }}
when: migrate_only is defined and migrate_only|lower == "yes" when: chkout.changed and migrate_only is defined and migrate_only|lower == "yes"
tags: tags:
- deploy - deploy
......
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