Skip to content

Commit

Permalink
Merge pull request #1151 from TangRufus/git-clone-clean
Browse files Browse the repository at this point in the history
Run `git clean` after checking `git clone` is successful
  • Loading branch information
tangrufus authored Feb 13, 2020
2 parents ca56ae5 + 24b40b6 commit 82438ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
14 changes: 7 additions & 7 deletions roles/deploy/tasks/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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:
Expand Down

0 comments on commit 82438ad

Please sign in to comment.