Skip to content

Commit

Permalink
Merge pull request openedx-unsupported#1798 from edx/max/fix-prune
Browse files Browse the repository at this point in the history
Fix git prune task failing when repo doesn't yet exist
  • Loading branch information
maxrothman committed Jan 23, 2015
2 parents 607a1d2 + 18d5126 commit 66d3b2b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion playbooks/roles/edxapp/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
force=yes owner={{ edxapp_user }} mode=0600
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
shell: cd {{ edxapp_code_dir }} && git remote prune origin
environment:
Expand All @@ -42,7 +46,8 @@
notify:
- "restart edxapp"
- "restart edxapp_workers"

when: git_dir.stat.exists and (git_dir.isdir is defined) and git_dir.stat.isdir

# Do A Checkout
- name: checkout edx-platform repo into {{ edxapp_code_dir }}
git: >
Expand Down

0 comments on commit 66d3b2b

Please sign in to comment.