Skip to content

Commit

Permalink
fix: Enhance Windows build reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Jan 9, 2025
1 parent 2e75f43 commit fc7aa97
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,16 @@ jobs:
- name: Build & push container
run: |
$params = @(
# Required build arguments
# Dockerfile location
"--file", "src/docker/Dockerfile-${{ matrix.os }}"
# Network fix
# See: https://github.com/GoogleContainerTools/skaffold/issues/1771#issuecomment-800288547
# See: https://stackoverflow.com/a/63385154
# See: https://stackoverflow.com/a/73704138
"--network", "host"
# Build arguments
"--build-arg", "AWS_CLI_VERSION=${{ env.AWS_CLI_VERSION }}",
"--build-arg", "AZP_AGENT_VERSION=${{ env.AZP_AGENT_VERSION }}",
"--build-arg", "AZURE_CLI_VERSION=${{ env.AZURE_CLI_VERSION }}",
Expand All @@ -622,20 +631,21 @@ jobs:
"--build-arg", "VS_BUILDTOOLS_VERSION=${{ env.VS_BUILDTOOLS_WIN_VERSION }}",
"--build-arg", "YQ_VERSION=${{ env.YQ_VERSION }}",
"--build-arg", "ZSTD_VERSION=${{ env.ZSTD_WIN_VERSION }}",
"--file", "src/docker/Dockerfile-${{ matrix.os }}"
)
# Output tags
$tags = ('${{ steps.meta.outputs.tags }}').Split([Environment]::NewLine)
foreach ($tag in $tags) {
$params += "--tag", $tag
}
# Output labels
$labels = ('${{ steps.meta.outputs.labels }}').Split([Environment]::NewLine)
foreach ($label in $labels) {
$params += "--label", $label
}
# Debug arguments to console
Write-Host "Build arguments:"
$params | ForEach-Object -Begin { $i = 0 } -Process {
if ($i % 2 -eq 0) {
Expand All @@ -647,9 +657,11 @@ jobs:
}
Write-Host
# Build
Write-Host "Building"
docker build @params src\docker
# Push
Write-Host "Pushing"
foreach ($tag in $tags) {
docker push --quiet $tag
Expand Down

0 comments on commit fc7aa97

Please sign in to comment.