Skip to content

Commit

Permalink
Optionally cleanup Azure Windows image
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Jun 28, 2024
1 parent 4563707 commit 2df379e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
21 changes: 21 additions & 0 deletions conda_smithy/templates/azure-pipelines-win.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@ jobs:
- checkout: self
fetchDepth: {{ clone_depth }}
{%- endif %}
{%- if azure.free_disk_space %}
- script: |
{%- if (azure.free_disk_space == true) or ('cache' in azure.free_disk_space) %}
set CLEANUP_DIRS=^
C:\hostedtoolcache\windows;^
;

mkdir C:\empty
for %%f in (%CLEANUP_DIRS:;= %) do (
if not [%%f] == [] (
echo Removing %%f
dir %%f
robocopy /mir /mt /zb /ns /nc /nfl /ndl /np /njh /njs C:\empty %%f > nul 2>&1
rmdir /q %%f
)
)
rmdir /q C:\empty
{%- endif %}
wmic logicaldisk get size,freespace,caption
displayName: Manage disk space
{%- endif %}
{%- for choco_pkg in choco %}
- script: |
choco install {{ choco_pkg }} -fdv -y --debug
Expand Down
23 changes: 23 additions & 0 deletions news/azure_win_add_optional_cleanup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Enable cleanup on Azure Windows as well

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>

0 comments on commit 2df379e

Please sign in to comment.