From a4bb4f4b31ffa0d8888df7a86050e7c51fb00b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 29 Oct 2023 23:49:51 +0100 Subject: [PATCH] replace env var BUILD_CONTEXT by its unvariable value './' --- build.ps1 | 2 -- tests/agent.Tests.ps1 | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/build.ps1 b/build.ps1 index 8309a5508..7eeb7affc 100644 --- a/build.ps1 +++ b/build.ps1 @@ -116,7 +116,6 @@ function Test-Image { Write-Host "= TEST: Testing image ${ImageName}:" $env:AGENT_IMAGE = $ImageName - $env:BUILD_CONTEXT = './' $env:VERSION = "$RemotingVersion-$BuildNumber" if(Test-Path ".\target\$ImageName") { @@ -132,7 +131,6 @@ function Test-Image { Write-Host "There were $($TestResults.PassedCount) passed tests out of $($TestResults.TotalCount) in $ImageName" } Remove-Item env:\AGENT_IMAGE - Remove-Item env:\BUILD_CONTEXT Remove-Item env:\VERSION } } diff --git a/tests/agent.Tests.ps1 b/tests/agent.Tests.ps1 index 6421ef380..d7a11db71 100644 --- a/tests/agent.Tests.ps1 +++ b/tests/agent.Tests.ps1 @@ -1,7 +1,6 @@ Import-Module -DisableNameChecking -Force $PSScriptRoot/test_helpers.psm1 $global:AGENT_IMAGE = Get-EnvOrDefault 'AGENT_IMAGE' '' -$global:BUILD_CONTEXT = Get-EnvOrDefault 'BUILD_CONTEXT' '' $global:VERSION = Get-EnvOrDefault 'VERSION' '' $items = $global:AGENT_IMAGE.Split("-") @@ -138,7 +137,7 @@ Describe "[$global:AGENT_IMAGE] can be built with custom build arguments" { BeforeAll { Push-Location -StackName 'agent' -Path "$PSScriptRoot/.." - $exitCode, $stdout, $stderr = Run-Program 'docker' "build --build-arg `"VERSION=${global:TEST_VERSION}`" --build-arg `"WINDOWS_VERSION_TAG=${global:WINDOWSVERSIONTAG}`" --build-arg `"TOOLS_WINDOWS_VERSION=${global:WINDOWSVERSIONFALLBACKTAG}`" --build-arg `"user=${global:TEST_USER}`" --build-arg `"AGENT_WORKDIR=${global:TEST_AGENT_WORKDIR}`" --tag ${global:AGENT_IMAGE} --file ./windows/${global:WINDOWSFLAVOR}/Dockerfile ${global:BUILD_CONTEXT}" + $exitCode, $stdout, $stderr = Run-Program 'docker' "build --build-arg `"VERSION=${global:TEST_VERSION}`" --build-arg `"WINDOWS_VERSION_TAG=${global:WINDOWSVERSIONTAG}`" --build-arg `"TOOLS_WINDOWS_VERSION=${global:WINDOWSVERSIONFALLBACKTAG}`" --build-arg `"user=${global:TEST_USER}`" --build-arg `"AGENT_WORKDIR=${global:TEST_AGENT_WORKDIR}`" --tag ${global:AGENT_IMAGE} --file ./windows/${global:WINDOWSFLAVOR}/Dockerfile ./" $exitCode | Should -Be 0 docker run -d -it --name "$global:CONTAINERNAME" -P "$global:AGENT_IMAGE" "$global:CONTAINERSHELL"