Commit 18d5126b by Max Rothman

Fix git prune task failing when repo doesn't yet exist

parent 607a1d27
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
force=yes owner={{ edxapp_user }} mode=0600 force=yes owner={{ edxapp_user }} mode=0600
when: EDXAPP_USE_GIT_IDENTITY when: EDXAPP_USE_GIT_IDENTITY
- name: check if git repo exists before pruning
stat: path={{ edxapp_code_dir }}/.git
register: git_dir
- name: git prune before checking out - name: git prune before checking out
shell: cd {{ edxapp_code_dir }} && git remote prune origin shell: cd {{ edxapp_code_dir }} && git remote prune origin
environment: environment:
...@@ -42,7 +46,8 @@ ...@@ -42,7 +46,8 @@
notify: notify:
- "restart edxapp" - "restart edxapp"
- "restart edxapp_workers" - "restart edxapp_workers"
when: git_dir.stat.exists and (git_dir.isdir is defined) and git_dir.stat.isdir
# Do A Checkout # Do A Checkout
- name: checkout edx-platform repo into {{ edxapp_code_dir }} - name: checkout edx-platform repo into {{ edxapp_code_dir }}
git: > git: >
......
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