diff --git a/CHANGELOG.md b/CHANGELOG.md index 872957ed6f..5f9d9836f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Fix `DEPLOY_UNFINISHED` not being copied over to `release` folder (#[1145])(https://github.com/roots/trellis/pull/1145) * Deploy: Remove untracked files from project folder ([#1146](https://github.com/roots/trellis/pull/1146)) * Nginx: Block `composer/installed.json` ([#1150](https://github.com/roots/trellis/pull/1150)) +* Run `git clean` after checking `git clone` is successful ([#1151](https://github.com/roots/trellis/pull/1151)) ### 1.3.0: December 7th, 2019 * Add `git_sha` and `release_version` to `.env` on deploy ([#1124](https://github.com/roots/trellis/pull/1124)) diff --git a/roles/deploy/tasks/update.yml b/roles/deploy/tasks/update.yml index 61bb72013a..305bc82f59 100644 --- a/roles/deploy/tasks/update.yml +++ b/roles/deploy/tasks/update.yml @@ -24,13 +24,6 @@ no_log: true register: git_clone -- name: Remove untracked files from project folder - command: git clean -fdx - args: - chdir: "{{ project_source_path }}" - register: git_clean - changed_when: not not(git_clean.stdout) - - name: Failed connection to remote repo fail: msg: | @@ -40,6 +33,13 @@ > https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-agent-forwarding when: git_clone is failed +- name: Remove untracked files from project folder + command: git clean -fdx + args: + chdir: "{{ project_source_path }}" + register: git_clean + changed_when: not not(git_clean.stdout) + - include_tasks: "{{ include_path }}" with_items: "{{ deploy_update_after | default([]) }}" loop_control: