Skip to content

Commit b0d2cde

Browse files
committed
ci: fix verify windows job by preserving artifacts across workspace cleanup
Applies the same GIT_STRATEGY: none + manual clone pattern to the verify windows job, saving/restoring the packages/ artifact around the workspace cleanup to avoid git checkout failures on locked/junction files.
1 parent d8abbcf commit b0d2cde

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.gitlab/generate-common.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ function windows_git_setup() {
8888
<?php
8989
}
9090

91+
function windows_git_setup_with_packages() {
92+
?>
93+
# Preserve artifact packages before workspace cleanup, then restore after clone.
94+
Move-Item packages $env:TEMP\dd-artifacts-packages -Force -ErrorAction SilentlyContinue
95+
<?php windows_git_setup() ?>
96+
if (Test-Path "$env:TEMP\dd-artifacts-packages") {
97+
Move-Item $env:TEMP\dd-artifacts-packages packages -Force
98+
}
99+
<?php
100+
}
101+
91102
?>
92103
default:
93104
retry:

.gitlab/generate-package.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,19 +1086,16 @@
10861086
stage: verify
10871087
tags: [ "windows-v2:2019"]
10881088
variables:
1089-
GIT_CONFIG_COUNT: 2
1090-
GIT_CONFIG_KEY_0: core.longpaths
1091-
GIT_CONFIG_VALUE_0: true
1092-
GIT_CONFIG_KEY_1: core.symlinks
1093-
GIT_CONFIG_VALUE_1: true
1089+
GIT_STRATEGY: none
10941090
needs:
10951091
- job: "package extension windows"
10961092
artifacts: true
10971093
- job: datadog-setup.php
10981094
artifacts: true
1099-
before_script:
1100-
- mkdir build
1101-
- move packages build
1095+
before_script: |
1096+
<?php windows_git_setup_with_packages() ?>
1097+
mkdir build
1098+
move packages build
11021099
script:
11031100
- Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) # chocolatey install
11041101
- .\dockerfiles\verify_packages\verify_windows.ps1

0 commit comments

Comments
 (0)