Configure pipeline to run offline correctly (#18304)

This commit is contained in:
Matt Thalman 2024-01-19 15:52:25 -06:00 committed by GitHub
parent 9b36bbc4ab
commit 48271da430
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -228,8 +228,6 @@ jobs:
customBuildArgs="--ci"
if [[ '${{ parameters.runOnline }}' == 'True' ]]; then
customBuildArgs="$customBuildArgs --online"
else
customRunArgs="$customRunArgs --network none"
fi
if [[ '${{ parameters.enablePoison }}' == 'True' ]]; then
@ -267,10 +265,16 @@ jobs:
# Only use Docker stuff on Linux
if [[ "$useDocker" == "true" ]]; then
customDockerRunArgs=""
for envVar in $customEnvVars; do
customEnvVarsWithDockerSyntax="$customEnvVarsWithDockerSyntax -e $envVar"
customDockerRunArgs="$customDockerRunArgs -e $envVar"
done
docker run --rm -v "$(sourcesPath):/vmr" -w /vmr $customEnvVarsWithDockerSyntax ${{ parameters.container }} ./build.sh --clean-while-building $(additionalBuildArgs) $customBuildArgs $extraBuildProperties
if [[ '${{ parameters.runOnline }}' == 'False' ]]; then
customDockerRunArgs="$customDockerRunArgs --network none"
fi
docker run --rm -v "$(sourcesPath):/vmr" -w /vmr $customDockerRunArgs ${{ parameters.container }} ./build.sh --clean-while-building $(additionalBuildArgs) $customBuildArgs $extraBuildProperties
else
for envVar in $customEnvVars; do
customEnvVarsWithBashSyntax="$customEnvVarsWithBashSyntax export $envVar;"