Skip to content

Commit

Permalink
replace env var BUILD_CONTEXT by its unvariable value './'
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherve committed Oct 29, 2023
1 parent fd03442 commit a4bb4f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand All @@ -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
}
}
Expand Down
3 changes: 1 addition & 2 deletions tests/agent.Tests.ps1
Original file line number Diff line number Diff line change
@@ -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("-")
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit a4bb4f4

Please sign in to comment.