File tree Expand file tree Collapse file tree 7 files changed +17
-2
lines changed Expand file tree Collapse file tree 7 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 8484    condition : eq(variables.imageBuilderBuildArgs, '') 
8585    displayName : Initialize Image Builder Build Args 
8686  - powershell : | 
87-       $imageBuilderBuildArgs = "$(imageBuilderBuildArgs) $(imageBuilder.queueArgs) --image-info-output-path $(artifactsPath)/$(legName)-image-info.json" 
87+       # Reference the existing imageBuilderBuildArgs variable as an environment variable rather than injecting it directly 
88+       # with the $(imageBuilderBuildArgs) syntax. This is to avoid issues where the string may contain single quotes $ chars 
89+       # which really mess up assigning to a variable. It would require assigning the string with single quotes but also needing 
90+       # to escape the single quotes that are in the string which would need to be done outside the context of PowerShell. Since 
91+       # all we need is for that value to be in a PowerShell variable, we can get that by the fact that AzDO automatically creates 
92+       # the environment variable for us. 
93+       $imageBuilderBuildArgs = "$env:IMAGEBUILDERBUILDARGS $(imageBuilder.queueArgs) --image-info-output-path $(artifactsPath)/$(legName)-image-info.json" 
8894      if ($env:SYSTEM_TEAMPROJECT -eq "${{ parameters.internalProjectName }}") { 
8995        $imageBuilderBuildArgs = "$imageBuilderBuildArgs --registry-override $(acr.server) --repo-prefix $(stagingRepoPrefix) --source-repo-prefix $(mirrorRepoPrefix) --push --registry-creds ""$(acr.server)=$(acr.userName);$(acr.password)""" 
9096      } 
Original file line number Diff line number Diff line change @@ -3,12 +3,14 @@ parameters:
33  pool : {} 
44  additionalOptions : null 
55  publicProjectName : null 
6+   customInitSteps : [] 
67
78jobs :
89- job : ${{ parameters.name }} 
910  pool : ${{ parameters.pool }} 
1011  steps :
1112  - template : ../steps/init-docker-linux.yml 
13+   - ${{ parameters.customInitSteps }} 
1214  - template : ../steps/copy-base-images.yml 
1315    parameters :
1416      additionalOptions : ${{ parameters.additionalOptions }} 
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ parameters:
33  testMatrixType : platformVersionedOs 
44  buildMatrixCustomBuildLegGroupArgs : " " 
55  testMatrixCustomBuildLegGroupArgs : " " 
6+   customCopyBaseImagesInitSteps : [] 
67  customBuildInitSteps : [] 
78  customTestInitSteps : [] 
89  customPublishInitSteps : [] 
@@ -70,6 +71,7 @@ stages:
7071      pool : ${{ parameters.linuxAmd64Pool }} 
7172      additionalOptions : " --manifest '$(manifest)' $(manifestVariables)" 
7273      publicProjectName : ${{ parameters.publicProjectName }} 
74+       customInitSteps : ${{ parameters.customCopyBaseImagesInitSteps}} 
7375  - template : ../jobs/generate-matrix.yml 
7476    parameters :
7577      matrixType : ${{ parameters.buildMatrixType }} 
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ parameters:
77  publicProjectName : null 
88  buildMatrixCustomBuildLegGroupArgs : " " 
99  testMatrixCustomBuildLegGroupArgs : " " 
10+   customCopyBaseImagesInitSteps : [] 
1011  customBuildInitSteps : [] 
1112  customTestInitSteps : [] 
1213  customPublishInitSteps : [] 
@@ -25,6 +26,7 @@ stages:
2526    publicProjectName : ${{ parameters.publicProjectName }} 
2627    buildMatrixCustomBuildLegGroupArgs : ${{ parameters.buildMatrixCustomBuildLegGroupArgs }} 
2728    testMatrixCustomBuildLegGroupArgs : ${{ parameters.testMatrixCustomBuildLegGroupArgs }} 
29+     customCopyBaseImagesInitSteps : ${{ parameters.customCopyBaseImagesInitSteps}} 
2830    customBuildInitSteps : ${{ parameters.customBuildInitSteps }} 
2931    customTestInitSteps : ${{ parameters.customTestInitSteps }} 
3032    customPublishInitSteps :
Original file line number Diff line number Diff line change 1515    '$(acr.subscription)' 
1616    '$(acr.resourceGroup)' 
1717    $(dockerHubRegistryCreds) 
18+     $(customCopyBaseImagesArgs) 
1819    --repo-prefix $(mirrorRepoPrefix) 
1920    --registry-override '$(acr.server)' 
2021    --os-type 'linux' 
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ variables:
3838  value : " " 
3939- name : testRunner.options 
4040  value : " " 
41+ - name : customCopyBaseImagesArgs 
42+   value : " " 
4143
4244- name : defaultLinuxAmd64PoolImage 
4345  value : ubuntu-latest 
Original file line number Diff line number Diff line change 11variables :
2-   imageNames.imageBuilder : mcr.microsoft.com/dotnet-buildtools/image-builder:1916215  
2+   imageNames.imageBuilder : mcr.microsoft.com/dotnet-buildtools/image-builder:1925523  
33  imageNames.imageBuilder.withrepo : imagebuilder-withrepo:$(Build.BuildId)-$(System.JobId) 
44  imageNames.testRunner : mcr.microsoft.com/dotnet-buildtools/prereqs:debian-buster-slim-docker-testrunner-974165 
55  imageNames.testRunner.withrepo : testrunner-withrepo:$(Build.BuildId)-$(System.JobId) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments