diff --git a/.github/workflows/lint-code-base.yml b/.github/workflows/lint-code-base.yml index 92e0275ad..205b8a9d0 100644 --- a/.github/workflows/lint-code-base.yml +++ b/.github/workflows/lint-code-base.yml @@ -25,6 +25,6 @@ jobs: uses: github/super-linter@v6 # https://github.com/github/super-linter env: DEFAULT_BRANCH: main - FILTER_REGEX_EXCLUDE: eng/common/.*|eng/readme-templates/.*|.portal-docs/.* + FILTER_REGEX_EXCLUDE: eng/docker-tools/.*|eng/readme-templates/.*|.portal-docs/.* GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VALIDATE_MARKDOWN: true diff --git a/build-and-test.ps1 b/build-and-test.ps1 index 28a9f16c4..f6b5697ec 100644 --- a/build-and-test.ps1 +++ b/build-and-test.ps1 @@ -24,14 +24,14 @@ if ($Repos.Count -eq 0) { else { $Paths = @() $Repos | foreach { - + $Paths += "src/$_/$Version/$OS" } $testCategories = $Repos } if ($Mode -eq "BuildAndTest" -or $Mode -eq "Build") { - & ./eng/common/build.ps1 ` + & ./eng/docker-tools/build.ps1 ` -Version $Version ` -OS $OS ` -Paths $Paths ` diff --git a/eng/common/pull-image.sh b/eng/common/pull-image.sh deleted file mode 100755 index d6c6ec85b..000000000 --- a/eng/common/pull-image.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -# Stop script on NZEC -set -e -# Stop script if unbound variable found (use ${var:-} if intentional) -set -u - -say_err() { - printf "%b\n" "Error: $1" >&2 -} - -# Executes a command and retries if it fails. -execute() { - local count=0 - until "$@"; do - local exit=$? - count=$(( $count + 1 )) - if [ $count -lt $retries ]; then - local wait=$(( waitFactor ** (( count - 1 )) )) - echo "Retry $count/$retries exited $exit, retrying in $wait seconds..." - sleep $wait - else - say_err "Retry $count/$retries exited $exit, no more retries left." - return $exit - fi - done - - return 0 -} - -scriptName=$0 -retries=5 -waitFactor=6 -image=$1 - -echo "Pulling Docker image $image" -execute docker pull $image diff --git a/eng/common/templates/jobs/validate-image-sizes.yml b/eng/common/templates/jobs/validate-image-sizes.yml deleted file mode 100644 index 18639a00b..000000000 --- a/eng/common/templates/jobs/validate-image-sizes.yml +++ /dev/null @@ -1,50 +0,0 @@ -parameters: - internalProjectName: null - publicProjectName: null - -jobs: -- ${{ if eq(variables['System.TeamProject'], parameters.internalProjectName) }}: - # Split the Linux images into separate jobs in order to compensate for less - # disk space on the Linux agents. See https://github.com/dotnet/dotnet-docker/issues/1588 - - job: LinuxAmd64PerfTests - pool: - vmImage: $(defaultLinuxAmd64PoolImage) - workspace: - clean: all - steps: - - template: ../steps/validate-image-sizes.yml - parameters: - dockerClientOS: linux - architecture: amd64 - validationMode: size - - job: LinuxArmPerfTests - pool: - vmImage: $(defaultLinuxAmd64PoolImage) - workspace: - clean: all - steps: - - template: ../steps/validate-image-sizes.yml - parameters: - dockerClientOS: linux - architecture: arm* - validationMode: size -- job: LinuxBaselineIntegrityPerfTests - pool: - vmImage: $(defaultLinuxAmd64PoolImage) - workspace: - clean: all - steps: - - template: ../steps/validate-image-sizes.yml - parameters: - dockerClientOS: linux - validationMode: integrity -- job: WindowsPerfTests - pool: Docker-2022-${{ variables['System.TeamProject'] }} - workspace: - clean: all - steps: - - template: ../steps/validate-image-sizes.yml - parameters: - dockerClientOS: windows - ${{ if eq(variables['System.TeamProject'], parameters.publicProjectName) }}: - validationMode: integrity diff --git a/eng/common/templates/jobs/wait-for-ingestion.yml b/eng/common/templates/jobs/wait-for-ingestion.yml deleted file mode 100644 index 38bc25f6d..000000000 --- a/eng/common/templates/jobs/wait-for-ingestion.yml +++ /dev/null @@ -1,26 +0,0 @@ -jobs: -- job: WaitForIngestion - pool: - vmImage: $(defaultLinuxAmd64PoolImage) - steps: - - template: ../steps/init-docker-linux.yml - - template: ../steps/download-build-artifact.yml - parameters: - targetPath: $(Build.ArtifactStagingDirectory) - condition: ne(variables['sourceBuildId'], '') - - powershell: | - # Get the last image info artifact that was published - $imageInfoDirName = @($(dir $(Build.ArtifactStagingDirectory)/image-info-final-* | select -ExpandProperty Name))[-1] - $imageInfoPath = "$(artifactsPath)/$imageInfoDirName/image-info.json" - echo "##vso[task.setvariable variable=imageInfoPath]$imageInfoPath" - displayName: Get Image Info Path - condition: and(succeeded(), ne(variables['sourceBuildId'], '')) - - template: ../steps/wait-for-mcr-image-ingestion.yml - parameters: - imageInfoPath: $(imageInfoPath) - minQueueTime: $(minQueueTime) - condition: and(succeeded(), ne(variables['sourceBuildId'], '')) - - template: ../steps/wait-for-mcr-doc-ingestion.yml - parameters: - commitDigest: $(readmeCommitDigest) - condition: and(succeeded(), ne(variables['readmeCommitDigest'], '')) diff --git a/eng/common/templates/stages/build-test-publish-repo.yml b/eng/common/templates/stages/build-test-publish-repo.yml deleted file mode 100644 index aa29b2ba1..000000000 --- a/eng/common/templates/stages/build-test-publish-repo.yml +++ /dev/null @@ -1,378 +0,0 @@ -parameters: - buildMatrixType: platformDependencyGraph - testMatrixType: platformVersionedOs - buildMatrixCustomBuildLegGroupArgs: "" - testMatrixCustomBuildLegGroupArgs: "" - customCopyBaseImagesInitSteps: [] - customGenerateMatrixInitSteps: [] - customBuildInitSteps: [] - customTestInitSteps: [] - customPublishInitSteps: [] - customPublishVariables: [] - - linuxAmdBuildJobTimeout: 60 - linuxArmBuildJobTimeout: 60 - windowsAmdBuildJobTimeout: 60 - - linuxAmdTestJobTimeout: 60 - linuxArmTestJobTimeout: 60 - windowsAmdTestJobTimeout: 60 - - noCache: false - - internalProjectName: null - publicProjectName: null - - internalVersionsRepoRef: null - publicVersionsRepoRef: null - - isInternalServicingValidation: false - - linuxAmd64Pool: - vmImage: $(defaultLinuxAmd64PoolImage) - linuxArm32Pool: - vmImage: $(defaultLinuxArm32PoolImage) - linuxArm64Pool: - vmImage: $(defaultLinuxArm64PoolImage) - windows2016Pool: - vmImage: $(defaultWindows2016PoolImage) - windows1809Pool: - vmImage: $(defaultWindows1809PoolImage) - windows2022Pool: - vmImage: $(defaultWindows2022PoolImage) - windows2025Pool: - vmImage: $(defaultWindows2025PoolImage) - -stages: - -################################################################################ -# Build Images -################################################################################ -- stage: Build - condition: and(succeeded(), contains(variables['stages'], 'build')) - jobs: - - template: /eng/common/templates/jobs/test-images-linux-client.yml@self - parameters: - name: PreBuildValidation - pool: ${{ parameters.linuxAmd64Pool }} - testJobTimeout: ${{ parameters.linuxAmdTestJobTimeout }} - preBuildValidation: true - internalProjectName: ${{ parameters.internalProjectName }} - customInitSteps: - - ${{ parameters.customTestInitSteps }} - # These variables are normally set by the matrix. Since this test job is not generated - # by a matrix, we need to set them manually. They can be set to empty values since their - # values aren't actually used for the pre-build tests. - - powershell: | - echo "##vso[task.setvariable variable=productVersion]" - echo "##vso[task.setvariable variable=imageBuilderPaths]" - echo "##vso[task.setvariable variable=osVersions]" - echo "##vso[task.setvariable variable=architecture]" - displayName: Initialize Test Variables - - template: /eng/common/templates/jobs/copy-base-images-staging.yml@self - parameters: - name: CopyBaseImages - pool: ${{ parameters.linuxAmd64Pool }} - additionalOptions: "--manifest '$(manifest)' $(imageBuilder.pathArgs) $(manifestVariables)" - customInitSteps: ${{ parameters.customCopyBaseImagesInitSteps }} - - template: /eng/common/templates/jobs/generate-matrix.yml@self - parameters: - matrixType: ${{ parameters.buildMatrixType }} - name: GenerateBuildMatrix - pool: ${{ parameters.linuxAmd64Pool }} - customBuildLegGroupArgs: ${{ parameters.buildMatrixCustomBuildLegGroupArgs }} - internalProjectName: ${{ parameters.internalProjectName }} - noCache: ${{ parameters.noCache }} - customInitSteps: ${{ parameters.customGenerateMatrixInitSteps }} - commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/common-init-for-matrix-and-build.yml@self - parameters: - noCache: ${{ parameters.noCache }} - internalVersionsRepoRef: ${{ parameters.internalVersionsRepoRef }} - publicVersionsRepoRef: ${{ parameters.publicVersionsRepoRef }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - - template: /eng/common/templates/jobs/build-images.yml@self - parameters: - name: Linux_amd64 - pool: ${{ parameters.linuxAmd64Pool }} - matrix: dependencies.GenerateBuildMatrix.outputs['matrix.LinuxAmd64'] - dockerClientOS: linux - buildJobTimeout: ${{ parameters.linuxAmdBuildJobTimeout }} - commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/common-init-for-matrix-and-build.yml@self - parameters: - noCache: ${{ parameters.noCache }} - internalVersionsRepoRef: ${{ parameters.internalVersionsRepoRef }} - publicVersionsRepoRef: ${{ parameters.publicVersionsRepoRef }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - customInitSteps: ${{ parameters.customBuildInitSteps }} - noCache: ${{ parameters.noCache }} - internalProjectName: ${{ parameters.internalProjectName }} - publicProjectName: ${{ parameters.publicProjectName }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - - template: /eng/common/templates/jobs/build-images.yml@self - parameters: - name: Linux_arm64 - pool: ${{ parameters.linuxArm64Pool }} - matrix: dependencies.GenerateBuildMatrix.outputs['matrix.LinuxArm64'] - dockerClientOS: linux - buildJobTimeout: ${{ parameters.linuxArmBuildJobTimeout }} - commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/common-init-for-matrix-and-build.yml@self - parameters: - noCache: ${{ parameters.noCache }} - internalVersionsRepoRef: ${{ parameters.internalVersionsRepoRef }} - publicVersionsRepoRef: ${{ parameters.publicVersionsRepoRef }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - customInitSteps: ${{ parameters.customBuildInitSteps }} - noCache: ${{ parameters.noCache }} - internalProjectName: ${{ parameters.internalProjectName }} - publicProjectName: ${{ parameters.publicProjectName }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - - template: /eng/common/templates/jobs/build-images.yml@self - parameters: - name: Linux_arm32 - pool: ${{ parameters.linuxArm32Pool }} - matrix: dependencies.GenerateBuildMatrix.outputs['matrix.LinuxArm32'] - dockerClientOS: linux - buildJobTimeout: ${{ parameters.linuxArmBuildJobTimeout }} - commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/common-init-for-matrix-and-build.yml@self - parameters: - noCache: ${{ parameters.noCache }} - internalVersionsRepoRef: ${{ parameters.internalVersionsRepoRef }} - publicVersionsRepoRef: ${{ parameters.publicVersionsRepoRef }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - customInitSteps: ${{ parameters.customBuildInitSteps }} - noCache: ${{ parameters.noCache }} - internalProjectName: ${{ parameters.internalProjectName }} - publicProjectName: ${{ parameters.publicProjectName }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - - template: /eng/common/templates/jobs/build-images.yml@self - parameters: - name: Windows1809_amd64 - pool: ${{ parameters.windows1809Pool }} - matrix: dependencies.GenerateBuildMatrix.outputs['matrix.Windows1809Amd64'] - dockerClientOS: windows - buildJobTimeout: ${{ parameters.windowsAmdBuildJobTimeout }} - commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/common-init-for-matrix-and-build.yml@self - parameters: - noCache: ${{ parameters.noCache }} - internalVersionsRepoRef: ${{ parameters.internalVersionsRepoRef }} - publicVersionsRepoRef: ${{ parameters.publicVersionsRepoRef }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - customInitSteps: ${{ parameters.customBuildInitSteps }} - noCache: ${{ parameters.noCache }} - internalProjectName: ${{ parameters.internalProjectName }} - publicProjectName: ${{ parameters.publicProjectName }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - - template: /eng/common/templates/jobs/build-images.yml@self - parameters: - name: Windows2022_amd64 - pool: ${{ parameters.windows2022Pool }} - matrix: dependencies.GenerateBuildMatrix.outputs['matrix.WindowsLtsc2022Amd64'] - dockerClientOS: windows - buildJobTimeout: ${{ parameters.windowsAmdBuildJobTimeout }} - commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/common-init-for-matrix-and-build.yml@self - parameters: - noCache: ${{ parameters.noCache }} - internalVersionsRepoRef: ${{ parameters.internalVersionsRepoRef }} - publicVersionsRepoRef: ${{ parameters.publicVersionsRepoRef }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - customInitSteps: ${{ parameters.customBuildInitSteps }} - noCache: ${{ parameters.noCache }} - internalProjectName: ${{ parameters.internalProjectName }} - publicProjectName: ${{ parameters.publicProjectName }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - - template: /eng/common/templates/jobs/build-images.yml@self - parameters: - name: Windows2025_amd64 - pool: ${{ parameters.windows2025Pool }} - matrix: dependencies.GenerateBuildMatrix.outputs['matrix.WindowsLtsc2025Amd64'] - dockerClientOS: windows - buildJobTimeout: ${{ parameters.windowsAmdBuildJobTimeout }} - commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/common-init-for-matrix-and-build.yml@self - parameters: - noCache: ${{ parameters.noCache }} - internalVersionsRepoRef: ${{ parameters.internalVersionsRepoRef }} - publicVersionsRepoRef: ${{ parameters.publicVersionsRepoRef }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - customInitSteps: ${{ parameters.customBuildInitSteps }} - noCache: ${{ parameters.noCache }} - internalProjectName: ${{ parameters.internalProjectName }} - publicProjectName: ${{ parameters.publicProjectName }} - internalVersionsRepoRef: ${{ parameters.internalVersionsRepoRef }} - publicVersionsRepoRef: ${{ parameters.publicVersionsRepoRef }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - - template: /eng/common/templates/jobs/build-images.yml@self - parameters: - name: WindowsLtsc2016_amd64 - pool: ${{ parameters.windows2016Pool }} - matrix: dependencies.GenerateBuildMatrix.outputs['matrix.WindowsLtsc2016Amd64'] - dockerClientOS: windows - buildJobTimeout: ${{ parameters.windowsAmdBuildJobTimeout }} - commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/common-init-for-matrix-and-build.yml@self - parameters: - noCache: ${{ parameters.noCache }} - internalVersionsRepoRef: ${{ parameters.internalVersionsRepoRef }} - publicVersionsRepoRef: ${{ parameters.publicVersionsRepoRef }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - customInitSteps: ${{ parameters.customBuildInitSteps }} - noCache: ${{ parameters.noCache }} - internalProjectName: ${{ parameters.internalProjectName }} - publicProjectName: ${{ parameters.publicProjectName }} - isInternalServicingValidation: ${{ parameters.isInternalServicingValidation }} - -################################################################################ -# Post-Build -################################################################################ -- stage: Post_Build - dependsOn: Build - condition: and(succeeded(), contains(variables['stages'], 'build')) - jobs: - - template: /eng/common/templates/jobs/post-build.yml@self - parameters: - pool: ${{ parameters.linuxAmd64Pool }} - internalProjectName: ${{ parameters.internalProjectName }} - publicProjectName: ${{ parameters.publicProjectName }} - -################################################################################ -# Test Images -################################################################################ -- ${{ if and(eq(variables['System.TeamProject'], parameters.internalProjectName), ne(variables['Build.Reason'], 'PullRequest'), eq(parameters.isInternalServicingValidation, 'false')) }}: - - stage: Test - dependsOn: Post_Build - condition: " - and( - ne(stageDependencies.Post_Build.outputs['Build.MergeImageInfoFiles.noImageInfos'], 'true'), - ne(variables['testScriptPath'], ''), - and( - contains(variables['stages'], 'test'), - or( - and( - succeeded(), - contains(variables['stages'], 'build')), - not(contains(variables['stages'], 'build')))))" - jobs: - - template: /eng/common/templates/jobs/generate-matrix.yml@self - parameters: - matrixType: ${{ parameters.testMatrixType }} - name: GenerateTestMatrix - pool: ${{ parameters.linuxAmd64Pool }} - customBuildLegGroupArgs: ${{ parameters.testMatrixCustomBuildLegGroupArgs }} - isTestStage: true - internalProjectName: ${{ parameters.internalProjectName }} - publicProjectName: ${{ parameters.publicProjectName }} - customInitSteps: ${{ parameters.customGenerateMatrixInitSteps }} - commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/common-init-for-matrix-and-build.yml@self - parameters: - noCache: ${{ parameters.noCache }} - internalVersionsRepoRef: ${{ parameters.internalVersionsRepoRef }} - publicVersionsRepoRef: ${{ parameters.publicVersionsRepoRef }} - - template: /eng/common/templates/jobs/test-images-linux-client.yml@self - parameters: - name: Linux_amd64 - pool: ${{ parameters.linuxAmd64Pool }} - matrix: dependencies.GenerateTestMatrix.outputs['matrix.LinuxAmd64'] - testJobTimeout: ${{ parameters.linuxAmdTestJobTimeout }} - internalProjectName: ${{ parameters.internalProjectName }} - customInitSteps: ${{ parameters.customTestInitSteps }} - - template: /eng/common/templates/jobs/test-images-linux-client.yml@self - parameters: - name: Linux_arm64 - pool: ${{ parameters.linuxArm64Pool }} - matrix: dependencies.GenerateTestMatrix.outputs['matrix.LinuxArm64'] - testJobTimeout: ${{ parameters.linuxArmTestJobTimeout }} - internalProjectName: ${{ parameters.internalProjectName }} - customInitSteps: ${{ parameters.customTestInitSteps }} - - template: /eng/common/templates/jobs/test-images-linux-client.yml@self - parameters: - name: Linux_arm32 - pool: ${{ parameters.linuxArm32Pool }} - matrix: dependencies.GenerateTestMatrix.outputs['matrix.LinuxArm32'] - testJobTimeout: ${{ parameters.linuxArmTestJobTimeout }} - internalProjectName: ${{ parameters.internalProjectName }} - customInitSteps: ${{ parameters.customTestInitSteps }} - - template: /eng/common/templates/jobs/test-images-windows-client.yml@self - parameters: - name: Windows1809_amd64 - pool: ${{ parameters.windows1809Pool }} - matrix: dependencies.GenerateTestMatrix.outputs['matrix.Windows1809Amd64'] - testJobTimeout: ${{ parameters.windowsAmdTestJobTimeout }} - internalProjectName: ${{ parameters.internalProjectName }} - customInitSteps: ${{ parameters.customTestInitSteps }} - - template: /eng/common/templates/jobs/test-images-windows-client.yml@self - parameters: - name: Windows2022_amd64 - pool: ${{ parameters.windows2022Pool }} - matrix: dependencies.GenerateTestMatrix.outputs['matrix.WindowsLtsc2022Amd64'] - testJobTimeout: ${{ parameters.windowsAmdTestJobTimeout }} - internalProjectName: ${{ parameters.internalProjectName }} - customInitSteps: ${{ parameters.customTestInitSteps }} - - template: /eng/common/templates/jobs/test-images-windows-client.yml@self - parameters: - name: Windows2025_amd64 - pool: ${{ parameters.windows2025Pool }} - matrix: dependencies.GenerateTestMatrix.outputs['matrix.WindowsLtsc2025Amd64'] - testJobTimeout: ${{ parameters.windowsAmdTestJobTimeout }} - internalProjectName: ${{ parameters.internalProjectName }} - customInitSteps: ${{ parameters.customTestInitSteps }} - - template: /eng/common/templates/jobs/test-images-windows-client.yml@self - parameters: - name: WindowsLtsc2016_amd64 - pool: ${{ parameters.windows2016Pool }} - matrix: dependencies.GenerateTestMatrix.outputs['matrix.WindowsLtsc2016Amd64'] - testJobTimeout: ${{ parameters.windowsAmdTestJobTimeout }} - internalProjectName: ${{ parameters.internalProjectName }} - customInitSteps: ${{ parameters.customTestInitSteps }} - -################################################################################ -# Publish Images -################################################################################ -- ${{ if eq(parameters.isInternalServicingValidation, 'false') }}: - - stage: Publish - ${{ if and(eq(variables['System.TeamProject'], parameters.internalProjectName), ne(variables['Build.Reason'], 'PullRequest')) }}: - dependsOn: Test - ${{ else }}: - dependsOn: Post_Build - condition: " - and( - not(canceled()), - and( - contains(variables['stages'], 'publish'), - or( - or( - and( - and( - contains(variables['stages'], 'build'), - succeeded('Post_Build')), - and( - contains(variables['stages'], 'test'), - in(dependencies.Test.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'))), - or( - and( - not(contains(variables['stages'], 'build')), - and( - contains(variables['stages'], 'test'), - in(dependencies.Test.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'))), - and( - not(contains(variables['stages'], 'test')), - and( - contains(variables['stages'], 'build'), - succeeded('Post_Build'))))), - not( - or( - contains(variables['stages'], 'build'), - contains(variables['stages'], 'test'))))))" - jobs: - - template: /eng/common/templates/jobs/publish.yml@self - parameters: - pool: ${{ parameters.linuxAmd64Pool }} - internalProjectName: ${{ parameters.internalProjectName }} - customPublishVariables: ${{ parameters.customPublishVariables }} - customInitSteps: ${{ parameters.customPublishInitSteps }} diff --git a/eng/common/templates/steps/common-init-for-matrix-and-build.yml b/eng/common/templates/steps/common-init-for-matrix-and-build.yml deleted file mode 100644 index ce34eaf26..000000000 --- a/eng/common/templates/steps/common-init-for-matrix-and-build.yml +++ /dev/null @@ -1,74 +0,0 @@ -parameters: - noCache: false - internalVersionsRepoRef: null - publicVersionsRepoRef: null - versionsRepoPath: versions - isInternalServicingValidation: false - -steps: -- checkout: self -- ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(parameters.noCache, false)) }}: - - checkout: ${{ parameters.publicVersionsRepoRef }} - path: s/${{ parameters.versionsRepoPath }} -- ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.noCache, false)) }}: - - checkout: ${{ parameters.internalVersionsRepoRef }} - path: s/${{ parameters.versionsRepoPath }} -- powershell: | - $commonMatrixAndBuildOptions = "--source-repo $(publicGitRepoUri)" - if ("$(System.TeamProject)" -eq "internal" -and "$(Build.Reason)" -ne "PullRequest" -and "${{ parameters.isInternalServicingValidation }}" -ne "true") { - $commonMatrixAndBuildOptions = "$commonMatrixAndBuildOptions --source-repo-prefix $(mirrorRepoPrefix) --registry-override $(acr-staging.server)" - } - - if ("$(System.TeamProject)" -eq "public" -and "$(public-mirror.server)" -ne "") { - $commonMatrixAndBuildOptions = "$commonMatrixAndBuildOptions --base-override-regex '^(?!mcr\.microsoft\.com)' --base-override-sub '$(public-mirror.server)/'" - } - - if ("${{ parameters.noCache }}" -eq "false") { - $versionsBasePath = "${{ parameters.versionsRepoPath }}/" - $pipelineDisabledCache = "false" - - $pathSeparatorIndex = "$(Build.Repository.Name)".IndexOf("/") - if ($pathSeparatorIndex -ge 0) { - $buildRepoName = "$(Build.Repository.Name)".Substring($pathSeparatorIndex + 1) - } - else { - $buildRepoName = "$(Build.Repository.Name)" - } - - $engCommonPath = "$(Build.Repository.LocalPath)/$buildRepoName/$(engCommonRelativePath)" - - $engPath = "$(Build.Repository.LocalPath)/$buildRepoName/eng" - $manifest = "$buildRepoName/$(manifest)" - $testResultsDirectory = "$buildRepoName/$testResultsDirectory" - - if ("$(testScriptPath)") { - $testScriptPath = "$buildRepoName/$(testScriptPath)" - } - - echo "##vso[task.setvariable variable=buildRepoName]$buildRepoName" - echo "##vso[task.setvariable variable=engCommonPath]$engCommonPath" - echo "##vso[task.setvariable variable=manifest]$manifest" - echo "##vso[task.setvariable variable=engPath]$engPath" - echo "##vso[task.setvariable variable=testScriptPath]$testScriptPath" - echo "##vso[task.setvariable variable=testResultsDirectory]$testResultsDirectory" - } - else { - $versionsBasePath = "" - $pipelineDisabledCache = "true" - } - - echo "##vso[task.setvariable variable=commonMatrixAndBuildOptions]$commonMatrixAndBuildOptions" - echo "##vso[task.setvariable variable=versionsBasePath]$versionsBasePath" - echo "##vso[task.setvariable variable=pipelineDisabledCache]$pipelineDisabledCache" - displayName: Set Common Variables for Matrix and Build - -- ${{ if eq(parameters.noCache, false) }}: - # Special logic is needed to copy the tsaoptions.json file to a well known location for the 1ES PT. - # This template has multiple checkouts and AzDO doesn't have support for dynamically determining the - # default repo path therefore the 1es-official logic can't calculate the repo's tsa config file path. - - task: CopyFiles@2 - displayName: Copy TSA Config - inputs: - SourceFolder: '$(Build.Repository.LocalPath)/$(buildRepoName)' - Contents: '.config/tsaoptions.json' - TargetFolder: '$(Build.SourcesDirectory)' diff --git a/eng/common/templates/steps/copy-base-images-staging.yml b/eng/common/templates/steps/copy-base-images-staging.yml deleted file mode 100644 index 9735fc9b0..000000000 --- a/eng/common/templates/steps/copy-base-images-staging.yml +++ /dev/null @@ -1,19 +0,0 @@ -parameters: -- name: additionalOptions - type: string - default: null -- name: continueOnError - type: string - default: false - -steps: -- template: /eng/common/templates/steps/copy-base-images.yml@self - parameters: - additionalOptions: ${{ parameters.additionalOptions }} - continueOnError: ${{ parameters.continueOnError }} - repoPrefix: $(mirrorRepoPrefix) - acr: - resourceGroup: $(acr-staging.resourceGroup) - server: $(acr-staging.server) - serviceConnection: $(acr-staging.serviceConnectionName) - subscription: $(acr-staging.subscription) diff --git a/eng/common/templates/steps/validate-image-sizes.yml b/eng/common/templates/steps/validate-image-sizes.yml deleted file mode 100644 index 9cd6e95a0..000000000 --- a/eng/common/templates/steps/validate-image-sizes.yml +++ /dev/null @@ -1,16 +0,0 @@ -parameters: - dockerClientOS: null - architecture: "*" - validationMode: "all" - -steps: - - template: ${{ format('../steps/init-docker-{0}.yml', parameters.dockerClientOS) }} - parameters: - # Get some disk space back, pipeline run time is not a concern here - cleanupDocker: true - - powershell: > - ./tests/performance/Validate-ImageSize.ps1 - -ImageBuilderCustomArgs "--architecture '${{ parameters.architecture }}'" - -ValidationMode:${{ parameters.validationMode }} - -PullImages - displayName: Run Image Size Tests diff --git a/eng/common/templates/variables/codeql.yml b/eng/common/templates/variables/codeql.yml deleted file mode 100644 index 0973342b9..000000000 --- a/eng/common/templates/variables/codeql.yml +++ /dev/null @@ -1,16 +0,0 @@ -parameters: -- name: TSAEnabled - displayName: Publish CodeQL results to TSA - type: boolean - default: true - -variables: - # Force CodeQL enabled so it may be run on any branch -- name: Codeql.Enabled - value: true - # Do not let CodeQL 3000 Extension gate scan frequency -- name: Codeql.Cadence - value: 0 - # CodeQL needs this plumbed along as a variable to enable TSA -- name: Codeql.TSAEnabled - value: ${{ parameters.TSAEnabled }} diff --git a/eng/common/templates/variables/common-paths.yml b/eng/common/templates/variables/common-paths.yml deleted file mode 100644 index 6e8864e4a..000000000 --- a/eng/common/templates/variables/common-paths.yml +++ /dev/null @@ -1,5 +0,0 @@ -variables: - engCommonRelativePath: eng/common - engCommonPath: $(Build.Repository.LocalPath)/$(engCommonRelativePath) - engPath: $(Build.Repository.LocalPath)/eng - testScriptPath: "" diff --git a/eng/common/Dockerfile.WithRepo b/eng/docker-tools/Dockerfile.WithRepo similarity index 100% rename from eng/common/Dockerfile.WithRepo rename to eng/docker-tools/Dockerfile.WithRepo diff --git a/eng/common/Dockerfile.syft b/eng/docker-tools/Dockerfile.syft similarity index 100% rename from eng/common/Dockerfile.syft rename to eng/docker-tools/Dockerfile.syft diff --git a/eng/common/Get-BaseImageStatus.ps1 b/eng/docker-tools/Get-BaseImageStatus.ps1 similarity index 100% rename from eng/common/Get-BaseImageStatus.ps1 rename to eng/docker-tools/Get-BaseImageStatus.ps1 diff --git a/eng/common/Get-ImageBuilder.ps1 b/eng/docker-tools/Get-ImageBuilder.ps1 similarity index 100% rename from eng/common/Get-ImageBuilder.ps1 rename to eng/docker-tools/Get-ImageBuilder.ps1 diff --git a/eng/common/Get-ImageNameVars.ps1 b/eng/docker-tools/Get-ImageNameVars.ps1 similarity index 100% rename from eng/common/Get-ImageNameVars.ps1 rename to eng/docker-tools/Get-ImageNameVars.ps1 diff --git a/eng/common/Install-DotNetSdk.ps1 b/eng/docker-tools/Install-DotNetSdk.ps1 similarity index 100% rename from eng/common/Install-DotNetSdk.ps1 rename to eng/docker-tools/Install-DotNetSdk.ps1 diff --git a/eng/common/Invoke-CleanupDocker.ps1 b/eng/docker-tools/Invoke-CleanupDocker.ps1 similarity index 100% rename from eng/common/Invoke-CleanupDocker.ps1 rename to eng/docker-tools/Invoke-CleanupDocker.ps1 diff --git a/eng/common/Invoke-ImageBuilder.ps1 b/eng/docker-tools/Invoke-ImageBuilder.ps1 similarity index 93% rename from eng/common/Invoke-ImageBuilder.ps1 rename to eng/docker-tools/Invoke-ImageBuilder.ps1 index fb349557b..4cec5ba2b 100644 --- a/eng/common/Invoke-ImageBuilder.ps1 +++ b/eng/docker-tools/Invoke-ImageBuilder.ps1 @@ -64,9 +64,9 @@ try { # On Linux, ImageBuilder is run within a container. $imageBuilderImageName = "microsoft-dotnet-imagebuilder-withrepo" if ($ReuseImageBuilderImage -ne $True) { - & ./eng/common/Get-ImageBuilder.ps1 + & ./eng/docker-tools/Get-ImageBuilder.ps1 Exec ("docker build -t $imageBuilderImageName --build-arg " ` - + "IMAGE=${imageNames.imageBuilderName} -f eng/common/Dockerfile.WithRepo .") + + "IMAGE=${imageNames.imageBuilderName} -f eng/docker-tools/Dockerfile.WithRepo .") } $imageBuilderCmd = "docker run --name $imageBuilderContainerName -v /var/run/docker.sock:/var/run/docker.sock $imageBuilderImageName" @@ -78,7 +78,7 @@ try { $imageBuilderFolder = ".Microsoft.DotNet.ImageBuilder" $imageBuilderCmd = [System.IO.Path]::Combine($imageBuilderFolder, "Microsoft.DotNet.ImageBuilder.exe") if (-not (Test-Path -Path "$imageBuilderCmd" -PathType Leaf)) { - & ./eng/common/Get-ImageBuilder.ps1 + & ./eng/docker-tools/Get-ImageBuilder.ps1 Exec "docker create --name $imageBuilderContainerName ${imageNames.imageBuilderName}" $containerCreated = $true if (Test-Path -Path $imageBuilderFolder) diff --git a/eng/common/Invoke-WithRetry.ps1 b/eng/docker-tools/Invoke-WithRetry.ps1 similarity index 100% rename from eng/common/Invoke-WithRetry.ps1 rename to eng/docker-tools/Invoke-WithRetry.ps1 diff --git a/eng/common/Pull-Image.ps1 b/eng/docker-tools/Pull-Image.ps1 similarity index 100% rename from eng/common/Pull-Image.ps1 rename to eng/docker-tools/Pull-Image.ps1 diff --git a/eng/common/Retain-Build.ps1 b/eng/docker-tools/Retain-Build.ps1 similarity index 90% rename from eng/common/Retain-Build.ps1 rename to eng/docker-tools/Retain-Build.ps1 index ee601c950..7f836e121 100644 --- a/eng/common/Retain-Build.ps1 +++ b/eng/docker-tools/Retain-Build.ps1 @@ -1,7 +1,7 @@ -# Adapted from https://github.com/dotnet/arcade/blob/main/eng/common/retain-build.ps1 +# Adapted from https://github.com/dotnet/arcade/blob/main/eng/docker-tools/retain-build.ps1 Param( [Parameter(Mandatory = $true)][int] $BuildId, - [Parameter(Mandatory = $true)][string] $AzdoOrgUri, + [Parameter(Mandatory = $true)][string] $AzdoOrgUri, [Parameter(Mandatory = $true)][string] $AzdoProject, [Parameter(Mandatory = $true)][string] $Token ) diff --git a/eng/common/build.ps1 b/eng/docker-tools/build.ps1 similarity index 95% rename from eng/common/build.ps1 rename to eng/docker-tools/build.ps1 index 845c4e081..13c0806fb 100644 --- a/eng/common/build.ps1 +++ b/eng/docker-tools/build.ps1 @@ -69,7 +69,7 @@ try { $args += ' --manifest "{0}"' -f $Manifest } - ./eng/common/Invoke-ImageBuilder.ps1 "build $args" + ./eng/docker-tools/Invoke-ImageBuilder.ps1 "build $args" } finally { popd diff --git a/eng/common/readme.md b/eng/docker-tools/readme.md similarity index 100% rename from eng/common/readme.md rename to eng/docker-tools/readme.md diff --git a/eng/common/templates/1es-official.yml b/eng/docker-tools/templates/1es-official.yml similarity index 93% rename from eng/common/templates/1es-official.yml rename to eng/docker-tools/templates/1es-official.yml index 49721aa1c..ebf8fcd70 100644 --- a/eng/common/templates/1es-official.yml +++ b/eng/docker-tools/templates/1es-official.yml @@ -41,7 +41,7 @@ resources: ref: refs/tags/release extends: - template: /eng/common/templates/task-prefix-decorator.yml@self + template: /eng/docker-tools/templates/task-prefix-decorator.yml@self parameters: baseTemplate: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates templateParameters: @@ -63,7 +63,7 @@ extends: enabled: true stages: - ${{ if gt(length(parameters.serviceConnections), 0) }}: - - template: /eng/common/templates/stages/setup-service-connections.yml@self + - template: /eng/docker-tools/templates/stages/setup-service-connections.yml@self parameters: pool: ${{ parameters.pool }} serviceConnections: ${{ parameters.serviceConnections }} diff --git a/eng/common/templates/1es-unofficial.yml b/eng/docker-tools/templates/1es-unofficial.yml similarity index 94% rename from eng/common/templates/1es-unofficial.yml rename to eng/docker-tools/templates/1es-unofficial.yml index 541f92f29..bc584cd38 100644 --- a/eng/common/templates/1es-unofficial.yml +++ b/eng/docker-tools/templates/1es-unofficial.yml @@ -44,7 +44,7 @@ resources: ref: refs/tags/release extends: - template: /eng/common/templates/task-prefix-decorator.yml@self + template: /eng/docker-tools/templates/task-prefix-decorator.yml@self parameters: # Use a unique task prefix for unofficial pipelines taskPrefix: "🟦" @@ -72,7 +72,7 @@ extends: enabled: true stages: - ${{ if gt(length(parameters.serviceConnections), 0) }}: - - template: /eng/common/templates/stages/setup-service-connections.yml@self + - template: /eng/docker-tools/templates/stages/setup-service-connections.yml@self parameters: pool: ${{ parameters.pool }} serviceConnections: ${{ parameters.serviceConnections }} diff --git a/eng/common/templates/1es.yml b/eng/docker-tools/templates/1es.yml similarity index 97% rename from eng/common/templates/1es.yml rename to eng/docker-tools/templates/1es.yml index 95a44b2a1..5fde4a73d 100644 --- a/eng/common/templates/1es.yml +++ b/eng/docker-tools/templates/1es.yml @@ -48,7 +48,7 @@ resources: ref: refs/tags/release extends: - template: /eng/common/templates/task-prefix-decorator.yml@self + template: /eng/docker-tools/templates/task-prefix-decorator.yml@self parameters: baseTemplate: v1/1ES.${{ iif(contains(variables['Build.DefinitionName'], '-official'), 'Official', 'Unofficial') }}.PipelineTemplate.yml@1ESPipelineTemplates templateParameters: diff --git a/eng/common/templates/jobs/build-images.yml b/eng/docker-tools/templates/jobs/build-images.yml similarity index 88% rename from eng/common/templates/jobs/build-images.yml rename to eng/docker-tools/templates/jobs/build-images.yml index 24fa3e795..1f7f9b566 100644 --- a/eng/common/templates/jobs/build-images.yml +++ b/eng/docker-tools/templates/jobs/build-images.yml @@ -30,11 +30,11 @@ jobs: imageInfoContainerDir: $(artifactsPath)/imageInfo steps: - ${{ parameters.commonInitStepsForMatrixAndBuild }} - - template: /eng/common/templates/jobs/${{ format('../steps/init-docker-{0}.yml', parameters.dockerClientOS) }}@self + - template: /eng/docker-tools/templates/jobs/${{ format('../steps/init-docker-{0}.yml', parameters.dockerClientOS) }}@self parameters: cleanupDocker: true - ${{ parameters.customInitSteps }} - - template: /eng/common/templates/steps/set-image-info-path-var.yml@self + - template: /eng/docker-tools/templates/steps/set-image-info-path-var.yml@self parameters: publicSourceBranch: $(publicSourceBranch) - powershell: echo "##vso[task.setvariable variable=imageBuilderBuildArgs]" @@ -62,7 +62,7 @@ jobs: echo "imageBuilderBuildArgs: $imageBuilderBuildArgs" echo "##vso[task.setvariable variable=imageBuilderBuildArgs]$imageBuilderBuildArgs" displayName: Set Image Builder Build Args - - template: /eng/common/templates/steps/run-imagebuilder.yml@self + - template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: name: BuildImages displayName: Build Images @@ -93,7 +93,7 @@ jobs: --acr-resource-group '${{ parameters.publishConfig.buildAcr.resourceGroup }}' $(manifestVariables) $(imageBuilderBuildArgs) - - template: /eng/common/templates/steps/publish-artifact.yml@self + - template: /eng/docker-tools/templates/steps/publish-artifact.yml@self parameters: path: $(imageInfoHostDir) artifactName: $(legName)-image-info-$(System.JobAttempt) @@ -105,23 +105,23 @@ jobs: $images = "$(BuildImages.builtImages)" if (-not $images) { return 0 } $syftImageName = "${{ parameters.publishConfig.publicMirrorAcr.server }}/$(imageNames.syft)" - & $(engCommonPath)/Pull-Image.ps1 $syftImageName + & $(engDockerToolsPath)/Pull-Image.ps1 $syftImageName $images -Split ',' | ForEach-Object { echo "Generating SBOM for $_"; $targetImageName = "$_"; $formattedImageName = $targetImageName.Replace('${{ parameters.publishConfig.buildAcr.server }}/${{ parameters.publishConfig.buildAcr.repoPrefix }}', "").Replace('/', '_').Replace(':', '_'); $sbomChildDir = "$(sbomDirectory)/$formattedImageName"; New-Item -Type Directory -Path $sbomChildDir > $null; - docker build --output=$sbomChildDir -f $(engCommonPath)/Dockerfile.syft --build-arg SYFT_IMAGE_NAME=$syftImageName --build-arg TARGET_IMAGE_NAME=$targetImageName -t syft-sbom $(engCommonPath); + docker build --output=$sbomChildDir -f $(engDockerToolsPath)/Dockerfile.syft --build-arg SYFT_IMAGE_NAME=$syftImageName --build-arg TARGET_IMAGE_NAME=$targetImageName -t syft-sbom $(engDockerToolsPath); } displayName: Generate SBOMs condition: and(succeeded(), ne(variables['BuildImages.builtImages'], '')) - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - - template: /eng/common/templates/jobs/${{ format('../steps/test-images-{0}-client.yml', parameters.dockerClientOS) }}@self + - template: /eng/docker-tools/templates/jobs/${{ format('../steps/test-images-{0}-client.yml', parameters.dockerClientOS) }}@self parameters: condition: ne(variables.testScriptPath, '') - ${{ if and(eq(variables['System.TeamProject'], parameters.internalProjectName), ne(variables['Build.Reason'], 'PullRequest'), eq(parameters.dockerClientOS, 'linux')) }}: - - template: /eng/common/templates/steps/publish-artifact.yml@self + - template: /eng/docker-tools/templates/steps/publish-artifact.yml@self parameters: path: $(sbomDirectory) artifactName: $(legName)-sboms diff --git a/eng/common/templates/jobs/cg-build-projects.yml b/eng/docker-tools/templates/jobs/cg-build-projects.yml similarity index 95% rename from eng/common/templates/jobs/cg-build-projects.yml rename to eng/docker-tools/templates/jobs/cg-build-projects.yml index de372c4c4..845a6719c 100644 --- a/eng/common/templates/jobs/cg-build-projects.yml +++ b/eng/docker-tools/templates/jobs/cg-build-projects.yml @@ -22,7 +22,7 @@ jobs: os: linux steps: - powershell: > - ./eng/common/Install-DotNetSdk.ps1 -Channel ${{ parameters.dotnetVersionChannel }} -InstallPath "/usr/share/.dotnet" + ./eng/docker-tools/Install-DotNetSdk.ps1 -Channel ${{ parameters.dotnetVersionChannel }} -InstallPath "/usr/share/.dotnet" displayName: Run Dotnet Install Script - script: > find . -name '*.csproj' | grep $(cgBuildGrepArgs) | xargs -n 1 /usr/share/.dotnet/dotnet build diff --git a/eng/common/templates/jobs/copy-base-images-staging.yml b/eng/docker-tools/templates/jobs/copy-base-images-staging.yml similarity index 90% rename from eng/common/templates/jobs/copy-base-images-staging.yml rename to eng/docker-tools/templates/jobs/copy-base-images-staging.yml index 17f4d359c..20ce1f4da 100644 --- a/eng/common/templates/jobs/copy-base-images-staging.yml +++ b/eng/docker-tools/templates/jobs/copy-base-images-staging.yml @@ -19,7 +19,7 @@ parameters: default: false jobs: -- template: /eng/common/templates/jobs/copy-base-images.yml@self +- template: /eng/docker-tools/templates/jobs/copy-base-images.yml@self parameters: name: ${{ parameters.name }} pool: ${{ parameters.pool }} diff --git a/eng/common/templates/jobs/copy-base-images.yml b/eng/docker-tools/templates/jobs/copy-base-images.yml similarity index 84% rename from eng/common/templates/jobs/copy-base-images.yml rename to eng/docker-tools/templates/jobs/copy-base-images.yml index 3068a43cb..ffc5aee15 100644 --- a/eng/common/templates/jobs/copy-base-images.yml +++ b/eng/docker-tools/templates/jobs/copy-base-images.yml @@ -28,9 +28,9 @@ jobs: - job: ${{ parameters.name }} pool: ${{ parameters.pool }} steps: - - template: /eng/common/templates/steps/init-docker-linux.yml@self + - template: /eng/docker-tools/templates/steps/init-docker-linux.yml@self - ${{ parameters.customInitSteps }} - - template: /eng/common/templates/steps/copy-base-images.yml@self + - template: /eng/docker-tools/templates/steps/copy-base-images.yml@self parameters: acr: ${{ parameters.acr }} repoPrefix: ${{ parameters.repoPrefix }} diff --git a/eng/common/templates/jobs/generate-matrix.yml b/eng/docker-tools/templates/jobs/generate-matrix.yml similarity index 85% rename from eng/common/templates/jobs/generate-matrix.yml rename to eng/docker-tools/templates/jobs/generate-matrix.yml index 663aeb01f..606dec57f 100644 --- a/eng/common/templates/jobs/generate-matrix.yml +++ b/eng/docker-tools/templates/jobs/generate-matrix.yml @@ -16,18 +16,18 @@ jobs: pool: ${{ parameters.pool }} steps: - ${{ parameters.commonInitStepsForMatrixAndBuild }} - - template: /eng/common/templates/steps/retain-build.yml@self - - template: /eng/common/templates/steps/init-docker-linux.yml@self + - template: /eng/docker-tools/templates/steps/retain-build.yml@self + - template: /eng/docker-tools/templates/steps/init-docker-linux.yml@self - ${{ parameters.customInitSteps }} - - template: /eng/common/templates/steps/validate-branch.yml@self + - template: /eng/docker-tools/templates/steps/validate-branch.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} internalProjectName: ${{ parameters.internalProjectName }} - - template: /eng/common/templates/steps/set-image-info-path-var.yml + - template: /eng/docker-tools/templates/steps/set-image-info-path-var.yml parameters: publicSourceBranch: $(publicSourceBranch) - ${{ if eq(parameters.isTestStage, true) }}: - - template: /eng/common/templates/steps/download-build-artifact.yml@self + - template: /eng/docker-tools/templates/steps/download-build-artifact.yml@self parameters: targetPath: $(Build.ArtifactStagingDirectory) artifactName: image-info @@ -59,7 +59,7 @@ jobs: $(commonMatrixAndBuildOptions) $(additionalGenerateBuildMatrixOptions)" displayName: Set GenerateBuildMatrix Command - - template: /eng/common/templates/steps/run-imagebuilder.yml@self + - template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: name: matrix displayName: Generate ${{ parameters.matrixType }} Matrix diff --git a/eng/common/templates/jobs/post-build.yml b/eng/docker-tools/templates/jobs/post-build.yml similarity index 92% rename from eng/common/templates/jobs/post-build.yml rename to eng/docker-tools/templates/jobs/post-build.yml index 31ad2eff0..33b91ec03 100644 --- a/eng/common/templates/jobs/post-build.yml +++ b/eng/docker-tools/templates/jobs/post-build.yml @@ -13,8 +13,8 @@ jobs: imageInfosOutputSubDir: "/output" sbomOutputDir: "$(Build.ArtifactStagingDirectory)/sbom" steps: - - template: /eng/common/templates/steps/init-docker-linux.yml@self - - template: /eng/common/templates/steps/download-build-artifact.yml@self + - template: /eng/docker-tools/templates/steps/init-docker-linux.yml@self + - template: /eng/docker-tools/templates/steps/download-build-artifact.yml@self parameters: targetPath: $(Build.ArtifactStagingDirectory) # This can fail if no build jobs ran to produce any artifacts @@ -69,7 +69,7 @@ jobs: $(manifestVariables) name: MergeImageInfoFiles displayName: Merge Image Info Files - - template: /eng/common/templates/steps/publish-artifact.yml@self + - template: /eng/docker-tools/templates/steps/publish-artifact.yml@self parameters: condition: and(succeeded(), ne(variables['MergeImageInfoFiles.noImageInfos'], 'true')) path: $(sbomOutputDir) @@ -77,7 +77,7 @@ jobs: displayName: Publish SBOM Artifact internalProjectName: ${{ parameters.internalProjectName }} publicProjectName: ${{ parameters.publicProjectName }} - - template: /eng/common/templates/steps/publish-artifact.yml@self + - template: /eng/docker-tools/templates/steps/publish-artifact.yml@self parameters: condition: and(succeeded(), ne(variables['MergeImageInfoFiles.noImageInfos'], 'true')) path: $(imageInfosHostDir)$(imageInfosOutputSubDir) diff --git a/eng/common/templates/jobs/publish.yml b/eng/docker-tools/templates/jobs/publish.yml similarity index 88% rename from eng/common/templates/jobs/publish.yml rename to eng/docker-tools/templates/jobs/publish.yml index 463d9af45..cb9b454ac 100644 --- a/eng/common/templates/jobs/publish.yml +++ b/eng/docker-tools/templates/jobs/publish.yml @@ -45,14 +45,14 @@ jobs: - ${{ parameters.customPublishVariables }} steps: - - template: /eng/common/templates/steps/init-matrix-build-publish.yml@self + - template: /eng/docker-tools/templates/steps/init-matrix-build-publish.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} versionsRepoRef: ${{ parameters.versionsRepoRef }} - - template: /eng/common/templates/steps/retain-build.yml@self + - template: /eng/docker-tools/templates/steps/retain-build.yml@self - - template: /eng/common/templates/steps/init-docker-linux.yml@self + - template: /eng/docker-tools/templates/steps/init-docker-linux.yml@self - pwsh: | $azdoOrgName = Split-Path -Leaf $Env:SYSTEM_COLLECTIONURI @@ -63,11 +63,11 @@ jobs: - ${{ parameters.customInitSteps }} - - template: /eng/common/templates/steps/validate-branch.yml@self + - template: /eng/docker-tools/templates/steps/validate-branch.yml@self parameters: internalProjectName: ${{ parameters.internalProjectName }} - - template: /eng/common/templates/steps/download-build-artifact.yml@self + - template: /eng/docker-tools/templates/steps/download-build-artifact.yml@self parameters: targetPath: $(imageInfoHostDir) artifactName: image-info @@ -76,11 +76,11 @@ jobs: # This can fail in scenarios where no build jobs have run to produce any artifacts continueOnError: true - - template: /eng/common/templates/steps/set-image-info-path-var.yml@self + - template: /eng/docker-tools/templates/steps/set-image-info-path-var.yml@self parameters: publicSourceBranch: $(publicSourceBranch) - - template: /eng/common/templates/steps/set-dry-run.yml@self + - template: /eng/docker-tools/templates/steps/set-dry-run.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} @@ -92,7 +92,7 @@ jobs: '$(imageInfoContainerDir)/image-info.json' displayName: Trim Unchanged Images - - template: /eng/common/templates/steps/run-imagebuilder.yml@self + - template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: displayName: Copy Images serviceConnections: @@ -115,7 +115,7 @@ jobs: $(imageBuilder.pathArgs) $(imageBuilder.commonCmdArgs) - - template: /eng/common/templates/steps/run-imagebuilder.yml@self + - template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: displayName: Publish Manifest serviceConnections: @@ -135,7 +135,7 @@ jobs: $(imageBuilder.pathArgs) $(imageBuilder.commonCmdArgs) - - template: /eng/common/templates/steps/publish-artifact.yml@self + - template: /eng/docker-tools/templates/steps/publish-artifact.yml@self parameters: path: $(imageInfoHostDir) artifactName: image-info-final-$(System.JobAttempt) @@ -143,7 +143,7 @@ jobs: internalProjectName: ${{ parameters.internalProjectName }} publicProjectName: ${{ parameters.publicProjectName }} - - template: /eng/common/templates/steps/wait-for-mcr-image-ingestion.yml@self + - template: /eng/docker-tools/templates/steps/wait-for-mcr-image-ingestion.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} imageInfoPath: '$(imageinfoContainerDir)/image-info.json' @@ -151,7 +151,7 @@ jobs: dryRunArg: $(dryRunArg) condition: succeeded() - - template: /eng/common/templates/steps/publish-readmes.yml@self + - template: /eng/docker-tools/templates/steps/publish-readmes.yml@self parameters: dryRunArg: $(dryRunArg) condition: and(succeeded(), eq(variables['publishReadme'], 'true')) @@ -183,7 +183,7 @@ jobs: condition: and(succeeded(), eq(variables['publishImageInfo'], 'true')) displayName: Merge Image Info - - template: /eng/common/templates/steps/run-imagebuilder.yml@self + - template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: displayName: Ingest Kusto Image Info serviceConnections: @@ -205,7 +205,7 @@ jobs: $(dryRunArg) $(imageBuilder.commonCmdArgs) - - template: /eng/common/templates/steps/run-imagebuilder.yml@self + - template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: displayName: Generate EOL Annotation Data serviceConnections: @@ -225,7 +225,7 @@ jobs: $(generateEolAnnotationDataExtraOptions) $(dryRunArg) - - template: /eng/common/templates/steps/publish-artifact.yml@self + - template: /eng/docker-tools/templates/steps/publish-artifact.yml@self parameters: path: $(Build.ArtifactStagingDirectory)/eol-annotation-data artifactName: eol-annotation-data-$(System.JobAttempt) @@ -234,7 +234,7 @@ jobs: publicProjectName: public condition: and(succeeded(), eq(variables['publishEolAnnotations'], 'true')) - - template: /eng/common/templates/steps/annotate-eol-digests.yml@self + - template: /eng/docker-tools/templates/steps/annotate-eol-digests.yml@self parameters: acr: ${{ parameters.publishConfig.publishAcr }} dataFile: $(artifactsPath)/eol-annotation-data/eol-annotation-data.json @@ -255,10 +255,10 @@ jobs: displayName: Publish Image Info # Task displayNames names are hardcoded to reference the task prefix used by 1ES official - # pipelines in eng/common/templates/1es-official.yml. + # pipelines in eng/docker-tools/templates/1es-official.yml. # # These will fail if they are dependend on by an unofficial pipeline since they use a unique task - # prefix compared to official pipelines (see eng/common/templates/1es-unofficial.yml). This is + # prefix compared to official pipelines (see eng/docker-tools/templates/1es-unofficial.yml). This is # acceptable because unofficial pipelines should not publish images. # # https://github.com/dotnet/docker-tools/issues/1698 tracks making this command no longer depend @@ -303,7 +303,7 @@ jobs: condition: succeeded() displayName: Write Source Build ID to File - - template: /eng/common/templates/steps/publish-artifact.yml@self + - template: /eng/docker-tools/templates/steps/publish-artifact.yml@self parameters: path: $(sourceBuildIdOutputDir) artifactName: source-build-id diff --git a/eng/common/templates/jobs/test-images-linux-client.yml b/eng/docker-tools/templates/jobs/test-images-linux-client.yml similarity index 92% rename from eng/common/templates/jobs/test-images-linux-client.yml rename to eng/docker-tools/templates/jobs/test-images-linux-client.yml index 9aa30e659..44e9e2fb7 100644 --- a/eng/common/templates/jobs/test-images-linux-client.yml +++ b/eng/docker-tools/templates/jobs/test-images-linux-client.yml @@ -21,7 +21,7 @@ jobs: pool: ${{ parameters.pool }} timeoutInMinutes: ${{ parameters.testJobTimeout }} steps: - - template: /eng/common/templates/steps/test-images-linux-client.yml@self + - template: /eng/docker-tools/templates/steps/test-images-linux-client.yml@self parameters: preBuildValidation: ${{ parameters.preBuildValidation }} internalProjectName: ${{ parameters.internalProjectName }} diff --git a/eng/common/templates/jobs/test-images-windows-client.yml b/eng/docker-tools/templates/jobs/test-images-windows-client.yml similarity index 89% rename from eng/common/templates/jobs/test-images-windows-client.yml rename to eng/docker-tools/templates/jobs/test-images-windows-client.yml index 94965f4cf..390f01da6 100644 --- a/eng/common/templates/jobs/test-images-windows-client.yml +++ b/eng/docker-tools/templates/jobs/test-images-windows-client.yml @@ -17,7 +17,7 @@ jobs: matrix: $[ ${{ parameters.matrix }} ] timeoutInMinutes: ${{ parameters.testJobTimeout }} steps: - - template: /eng/common/templates/steps/test-images-windows-client.yml@self + - template: /eng/docker-tools/templates/steps/test-images-windows-client.yml@self parameters: internalProjectName: ${{ parameters.internalProjectName }} publishConfig: ${{ parameters.publishConfig }} diff --git a/eng/common/templates/stages/build-and-test.yml b/eng/docker-tools/templates/stages/build-and-test.yml similarity index 86% rename from eng/common/templates/stages/build-and-test.yml rename to eng/docker-tools/templates/stages/build-and-test.yml index 2d5ed7026..b9df61a4c 100644 --- a/eng/common/templates/stages/build-and-test.yml +++ b/eng/docker-tools/templates/stages/build-and-test.yml @@ -52,7 +52,7 @@ stages: dependsOn: [] jobs: - - template: /eng/common/templates/jobs/test-images-linux-client.yml@self + - template: /eng/docker-tools/templates/jobs/test-images-linux-client.yml@self parameters: name: PreBuildValidation pool: ${{ parameters.linuxAmd64Pool }} @@ -72,7 +72,7 @@ stages: echo "##vso[task.setvariable variable=architecture]" displayName: Initialize Test Variables - - template: /eng/common/templates/jobs/copy-base-images-staging.yml@self + - template: /eng/docker-tools/templates/jobs/copy-base-images-staging.yml@self parameters: name: CopyBaseImages publishConfig: ${{ parameters.publishConfig }} @@ -80,7 +80,7 @@ stages: additionalOptions: "--manifest '$(manifest)' $(imageBuilder.pathArgs) $(manifestVariables)" customInitSteps: ${{ parameters.customCopyBaseImagesInitSteps }} - - template: /eng/common/templates/jobs/generate-matrix.yml@self + - template: /eng/docker-tools/templates/jobs/generate-matrix.yml@self parameters: matrixType: ${{ parameters.buildMatrixType }} name: GenerateBuildMatrix @@ -91,12 +91,12 @@ stages: publishConfig: ${{ parameters.publishConfig }} customInitSteps: ${{ parameters.customGenerateMatrixInitSteps }} commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/init-matrix-build-publish.yml@self + - template: /eng/docker-tools/templates/steps/init-matrix-build-publish.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} versionsRepoRef: ${{ parameters.versionsRepoRef }} - - template: /eng/common/templates/jobs/build-images.yml@self + - template: /eng/docker-tools/templates/jobs/build-images.yml@self parameters: name: Linux_amd64 pool: ${{ parameters.linuxAmd64Pool }} @@ -104,7 +104,7 @@ stages: dockerClientOS: linux buildJobTimeout: ${{ parameters.linuxAmdBuildJobTimeout }} commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/init-matrix-build-publish.yml@self + - template: /eng/docker-tools/templates/steps/init-matrix-build-publish.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} versionsRepoRef: ${{ parameters.versionsRepoRef }} @@ -114,7 +114,7 @@ stages: internalProjectName: ${{ parameters.internalProjectName }} publicProjectName: ${{ parameters.publicProjectName }} storageAccountServiceConnection: ${{ parameters.storageAccountServiceConnection }} - - template: /eng/common/templates/jobs/build-images.yml@self + - template: /eng/docker-tools/templates/jobs/build-images.yml@self parameters: name: Linux_arm64 pool: ${{ parameters.linuxArm64Pool }} @@ -122,7 +122,7 @@ stages: dockerClientOS: linux buildJobTimeout: ${{ parameters.linuxArmBuildJobTimeout }} commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/init-matrix-build-publish.yml@self + - template: /eng/docker-tools/templates/steps/init-matrix-build-publish.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} versionsRepoRef: ${{ parameters.versionsRepoRef }} @@ -132,7 +132,7 @@ stages: internalProjectName: ${{ parameters.internalProjectName }} publicProjectName: ${{ parameters.publicProjectName }} storageAccountServiceConnection: ${{ parameters.storageAccountServiceConnection }} - - template: /eng/common/templates/jobs/build-images.yml@self + - template: /eng/docker-tools/templates/jobs/build-images.yml@self parameters: name: Linux_arm32 pool: ${{ parameters.linuxArm32Pool }} @@ -140,7 +140,7 @@ stages: dockerClientOS: linux buildJobTimeout: ${{ parameters.linuxArmBuildJobTimeout }} commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/init-matrix-build-publish.yml@self + - template: /eng/docker-tools/templates/steps/init-matrix-build-publish.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} versionsRepoRef: ${{ parameters.versionsRepoRef }} @@ -150,7 +150,7 @@ stages: internalProjectName: ${{ parameters.internalProjectName }} publicProjectName: ${{ parameters.publicProjectName }} storageAccountServiceConnection: ${{ parameters.storageAccountServiceConnection }} - - template: /eng/common/templates/jobs/build-images.yml@self + - template: /eng/docker-tools/templates/jobs/build-images.yml@self parameters: name: Windows1809_amd64 pool: ${{ parameters.windows1809Pool }} @@ -158,7 +158,7 @@ stages: dockerClientOS: windows buildJobTimeout: ${{ parameters.windowsAmdBuildJobTimeout }} commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/init-matrix-build-publish.yml@self + - template: /eng/docker-tools/templates/steps/init-matrix-build-publish.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} versionsRepoRef: ${{ parameters.versionsRepoRef }} @@ -168,7 +168,7 @@ stages: internalProjectName: ${{ parameters.internalProjectName }} publicProjectName: ${{ parameters.publicProjectName }} storageAccountServiceConnection: ${{ parameters.storageAccountServiceConnection }} - - template: /eng/common/templates/jobs/build-images.yml@self + - template: /eng/docker-tools/templates/jobs/build-images.yml@self parameters: name: Windows2022_amd64 pool: ${{ parameters.windows2022Pool }} @@ -176,7 +176,7 @@ stages: dockerClientOS: windows buildJobTimeout: ${{ parameters.windowsAmdBuildJobTimeout }} commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/init-matrix-build-publish.yml@self + - template: /eng/docker-tools/templates/steps/init-matrix-build-publish.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} versionsRepoRef: ${{ parameters.versionsRepoRef }} @@ -186,7 +186,7 @@ stages: internalProjectName: ${{ parameters.internalProjectName }} publicProjectName: ${{ parameters.publicProjectName }} storageAccountServiceConnection: ${{ parameters.storageAccountServiceConnection }} - - template: /eng/common/templates/jobs/build-images.yml@self + - template: /eng/docker-tools/templates/jobs/build-images.yml@self parameters: name: Windows2025_amd64 pool: ${{ parameters.windows2025Pool }} @@ -194,7 +194,7 @@ stages: dockerClientOS: windows buildJobTimeout: ${{ parameters.windowsAmdBuildJobTimeout }} commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/init-matrix-build-publish.yml@self + - template: /eng/docker-tools/templates/steps/init-matrix-build-publish.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} versionsRepoRef: ${{ parameters.versionsRepoRef }} @@ -205,7 +205,7 @@ stages: publicProjectName: ${{ parameters.publicProjectName }} versionsRepoRef: ${{ parameters.versionsRepoRef }} storageAccountServiceConnection: ${{ parameters.storageAccountServiceConnection }} - - template: /eng/common/templates/jobs/build-images.yml@self + - template: /eng/docker-tools/templates/jobs/build-images.yml@self parameters: name: WindowsLtsc2016_amd64 pool: ${{ parameters.windows2016Pool }} @@ -213,7 +213,7 @@ stages: dockerClientOS: windows buildJobTimeout: ${{ parameters.windowsAmdBuildJobTimeout }} commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/init-matrix-build-publish.yml@self + - template: /eng/docker-tools/templates/steps/init-matrix-build-publish.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} versionsRepoRef: ${{ parameters.versionsRepoRef }} @@ -231,7 +231,7 @@ stages: dependsOn: Build condition: and(succeeded(), contains(variables['stages'], 'build')) jobs: - - template: /eng/common/templates/jobs/post-build.yml@self + - template: /eng/docker-tools/templates/jobs/post-build.yml@self parameters: pool: ${{ parameters.linuxAmd64Pool }} internalProjectName: ${{ parameters.internalProjectName }} @@ -255,7 +255,7 @@ stages: contains(variables['stages'], 'build')), not(contains(variables['stages'], 'build')))))" jobs: - - template: /eng/common/templates/jobs/generate-matrix.yml@self + - template: /eng/docker-tools/templates/jobs/generate-matrix.yml@self parameters: matrixType: ${{ parameters.testMatrixType }} name: GenerateTestMatrix @@ -267,11 +267,11 @@ stages: customInitSteps: ${{ parameters.customGenerateMatrixInitSteps }} sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} commonInitStepsForMatrixAndBuild: - - template: /eng/common/templates/steps/init-matrix-build-publish.yml@self + - template: /eng/docker-tools/templates/steps/init-matrix-build-publish.yml@self parameters: versionsRepoRef: ${{ parameters.versionsRepoRef }} publishConfig: ${{ parameters.publishConfig }} - - template: /eng/common/templates/jobs/test-images-linux-client.yml@self + - template: /eng/docker-tools/templates/jobs/test-images-linux-client.yml@self parameters: name: Linux_amd64 pool: ${{ parameters.linuxAmd64Pool }} @@ -281,7 +281,7 @@ stages: publishConfig: ${{ parameters.publishConfig }} customInitSteps: ${{ parameters.customTestInitSteps }} sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} - - template: /eng/common/templates/jobs/test-images-linux-client.yml@self + - template: /eng/docker-tools/templates/jobs/test-images-linux-client.yml@self parameters: name: Linux_arm64 pool: ${{ parameters.linuxArm64Pool }} @@ -291,7 +291,7 @@ stages: publishConfig: ${{ parameters.publishConfig }} customInitSteps: ${{ parameters.customTestInitSteps }} sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} - - template: /eng/common/templates/jobs/test-images-linux-client.yml@self + - template: /eng/docker-tools/templates/jobs/test-images-linux-client.yml@self parameters: name: Linux_arm32 pool: ${{ parameters.linuxArm32Pool }} @@ -301,7 +301,7 @@ stages: publishConfig: ${{ parameters.publishConfig }} customInitSteps: ${{ parameters.customTestInitSteps }} sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} - - template: /eng/common/templates/jobs/test-images-windows-client.yml@self + - template: /eng/docker-tools/templates/jobs/test-images-windows-client.yml@self parameters: name: Windows1809_amd64 pool: ${{ parameters.windows1809Pool }} @@ -311,7 +311,7 @@ stages: publishConfig: ${{ parameters.publishConfig }} customInitSteps: ${{ parameters.customTestInitSteps }} sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} - - template: /eng/common/templates/jobs/test-images-windows-client.yml@self + - template: /eng/docker-tools/templates/jobs/test-images-windows-client.yml@self parameters: name: Windows2022_amd64 pool: ${{ parameters.windows2022Pool }} @@ -321,7 +321,7 @@ stages: publishConfig: ${{ parameters.publishConfig }} customInitSteps: ${{ parameters.customTestInitSteps }} sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} - - template: /eng/common/templates/jobs/test-images-windows-client.yml@self + - template: /eng/docker-tools/templates/jobs/test-images-windows-client.yml@self parameters: name: Windows2025_amd64 pool: ${{ parameters.windows2025Pool }} @@ -331,7 +331,7 @@ stages: publishConfig: ${{ parameters.publishConfig }} customInitSteps: ${{ parameters.customTestInitSteps }} sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} - - template: /eng/common/templates/jobs/test-images-windows-client.yml@self + - template: /eng/docker-tools/templates/jobs/test-images-windows-client.yml@self parameters: name: WindowsLtsc2016_amd64 pool: ${{ parameters.windows2016Pool }} diff --git a/eng/common/templates/stages/dotnet/build-and-test.yml b/eng/docker-tools/templates/stages/dotnet/build-and-test.yml similarity index 98% rename from eng/common/templates/stages/dotnet/build-and-test.yml rename to eng/docker-tools/templates/stages/dotnet/build-and-test.yml index dd8afd9ec..311b16133 100644 --- a/eng/common/templates/stages/dotnet/build-and-test.yml +++ b/eng/docker-tools/templates/stages/dotnet/build-and-test.yml @@ -40,7 +40,7 @@ parameters: versionsRepoRef: null stages: -- template: /eng/common/templates/stages/build-and-test.yml@self +- template: /eng/docker-tools/templates/stages/build-and-test.yml@self parameters: noCache: ${{ parameters.noCache }} publishConfig: ${{ parameters.publishConfig }} diff --git a/eng/common/templates/stages/dotnet/build-test-publish-repo.yml b/eng/docker-tools/templates/stages/dotnet/build-test-publish-repo.yml similarity index 94% rename from eng/common/templates/stages/dotnet/build-test-publish-repo.yml rename to eng/docker-tools/templates/stages/dotnet/build-test-publish-repo.yml index ee8f43af7..c412f00d2 100644 --- a/eng/common/templates/stages/dotnet/build-test-publish-repo.yml +++ b/eng/docker-tools/templates/stages/dotnet/build-test-publish-repo.yml @@ -35,7 +35,7 @@ parameters: versionsRepoRef: "" stages: -- template: /eng/common/templates/stages/dotnet/build-and-test.yml@self +- template: /eng/docker-tools/templates/stages/dotnet/build-and-test.yml@self parameters: linuxAmd64Pool: ${{ parameters.linuxAmd64Pool }} # Pre-build @@ -63,7 +63,7 @@ stages: publicProjectName: ${{ parameters.publicProjectName }} versionsRepoRef: ${{ parameters.versionsRepoRef }} -- template: /eng/common/templates/stages/dotnet/publish.yml@self +- template: /eng/docker-tools/templates/stages/dotnet/publish.yml@self parameters: pool: ${{ parameters.linuxAmd64Pool }} customPublishInitSteps: ${{ parameters.customPublishInitSteps }} diff --git a/eng/common/templates/stages/dotnet/publish-config-nonprod.yml b/eng/docker-tools/templates/stages/dotnet/publish-config-nonprod.yml similarity index 100% rename from eng/common/templates/stages/dotnet/publish-config-nonprod.yml rename to eng/docker-tools/templates/stages/dotnet/publish-config-nonprod.yml diff --git a/eng/common/templates/stages/dotnet/publish-config-prod.yml b/eng/docker-tools/templates/stages/dotnet/publish-config-prod.yml similarity index 100% rename from eng/common/templates/stages/dotnet/publish-config-prod.yml rename to eng/docker-tools/templates/stages/dotnet/publish-config-prod.yml diff --git a/eng/common/templates/stages/dotnet/publish.yml b/eng/docker-tools/templates/stages/dotnet/publish.yml similarity index 97% rename from eng/common/templates/stages/dotnet/publish.yml rename to eng/docker-tools/templates/stages/dotnet/publish.yml index d041b3d54..66cb2c8bd 100644 --- a/eng/common/templates/stages/dotnet/publish.yml +++ b/eng/docker-tools/templates/stages/dotnet/publish.yml @@ -14,7 +14,7 @@ parameters: overrideImageInfoCommit: false stages: -- template: /eng/common/templates/stages/publish.yml@self +- template: /eng/docker-tools/templates/stages/publish.yml@self parameters: internalProjectName: ${{ parameters.internalProjectName }} publicProjectName: ${{ parameters.publicProjectName }} diff --git a/eng/common/templates/stages/publish.yml b/eng/docker-tools/templates/stages/publish.yml similarity index 97% rename from eng/common/templates/stages/publish.yml rename to eng/docker-tools/templates/stages/publish.yml index f1569fbac..ffdd594c2 100644 --- a/eng/common/templates/stages/publish.yml +++ b/eng/docker-tools/templates/stages/publish.yml @@ -66,7 +66,7 @@ stages: contains(variables['stages'], 'build'), contains(variables['stages'], 'test'))))))" jobs: - - template: /eng/common/templates/jobs/publish.yml@self + - template: /eng/docker-tools/templates/jobs/publish.yml@self parameters: pool: ${{ parameters.pool }} internalProjectName: ${{ parameters.internalProjectName }} diff --git a/eng/common/templates/stages/setup-service-connections.yml b/eng/docker-tools/templates/stages/setup-service-connections.yml similarity index 100% rename from eng/common/templates/stages/setup-service-connections.yml rename to eng/docker-tools/templates/stages/setup-service-connections.yml diff --git a/eng/common/templates/steps/annotate-eol-digests.yml b/eng/docker-tools/templates/steps/annotate-eol-digests.yml similarity index 89% rename from eng/common/templates/steps/annotate-eol-digests.yml rename to eng/docker-tools/templates/steps/annotate-eol-digests.yml index 57c5221fc..0cb090c1c 100644 --- a/eng/common/templates/steps/annotate-eol-digests.yml +++ b/eng/docker-tools/templates/steps/annotate-eol-digests.yml @@ -8,7 +8,7 @@ parameters: steps: - script: mkdir -p $(Build.ArtifactStagingDirectory)/annotation-digests displayName: Create Annotation Digests Directory - - template: /eng/common/templates/steps/run-imagebuilder.yml@self + - template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: displayName: Annotate EOL Images (${{ parameters.acr.server }}) serviceConnections: @@ -25,7 +25,7 @@ steps: "${{ parameters.acr.repoPrefix }}" $(artifactsPath)/annotation-digests/annotation-digests.txt $(dryRunArg) - - template: /eng/common/templates/steps/publish-artifact.yml@self + - template: /eng/docker-tools/templates/steps/publish-artifact.yml@self parameters: path: $(Build.ArtifactStagingDirectory)/annotation-digests artifactName: annotation-digests-${{ parameters.acr.server }}-$(System.JobAttempt) @@ -33,7 +33,7 @@ steps: internalProjectName: internal publicProjectName: public condition: and(succeeded(), eq(variables['publishEolAnnotations'], 'true')) - - template: /eng/common/templates/steps/run-imagebuilder.yml@self + - template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: displayName: Wait for Annotation Ingestion (${{ parameters.acr.server }}) serviceConnections: diff --git a/eng/common/templates/steps/clean-acr-images.yml b/eng/docker-tools/templates/steps/clean-acr-images.yml similarity index 94% rename from eng/common/templates/steps/clean-acr-images.yml rename to eng/docker-tools/templates/steps/clean-acr-images.yml index 0361df442..b791de305 100644 --- a/eng/common/templates/steps/clean-acr-images.yml +++ b/eng/docker-tools/templates/steps/clean-acr-images.yml @@ -7,7 +7,7 @@ parameters: internalProjectName: null publishConfig: null steps: - - template: /eng/common/templates/steps/run-imagebuilder.yml@self + - template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: # Options are documented in CleanAcrImagesOptions.cs ${{ if eq(parameters.action, 'delete') }}: diff --git a/eng/common/templates/steps/cleanup-docker-linux.yml b/eng/docker-tools/templates/steps/cleanup-docker-linux.yml similarity index 100% rename from eng/common/templates/steps/cleanup-docker-linux.yml rename to eng/docker-tools/templates/steps/cleanup-docker-linux.yml diff --git a/eng/common/templates/steps/cleanup-docker-windows.yml b/eng/docker-tools/templates/steps/cleanup-docker-windows.yml similarity index 91% rename from eng/common/templates/steps/cleanup-docker-windows.yml rename to eng/docker-tools/templates/steps/cleanup-docker-windows.yml index 98fc52969..a2c41c20b 100644 --- a/eng/common/templates/steps/cleanup-docker-windows.yml +++ b/eng/docker-tools/templates/steps/cleanup-docker-windows.yml @@ -1,11 +1,11 @@ parameters: condition: true - + steps: ################################################################################ # Cleanup Docker Resources ################################################################################ -- powershell: $(engCommonPath)/Invoke-CleanupDocker.ps1 +- powershell: $(engDockerToolsPath)/Invoke-CleanupDocker.ps1 displayName: Cleanup Docker Images condition: and(always(), ${{ parameters.condition }}) continueOnError: true diff --git a/eng/common/templates/steps/copy-base-images.yml b/eng/docker-tools/templates/steps/copy-base-images.yml similarity index 95% rename from eng/common/templates/steps/copy-base-images.yml rename to eng/docker-tools/templates/steps/copy-base-images.yml index f78b1c5dc..d54737083 100644 --- a/eng/common/templates/steps/copy-base-images.yml +++ b/eng/docker-tools/templates/steps/copy-base-images.yml @@ -25,7 +25,7 @@ parameters: steps: - ${{ if or(eq(parameters.forceDryRun, true), eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - script: echo "##vso[task.setvariable variable=dryRunArg]--dry-run" -- template: /eng/common/templates/steps/run-imagebuilder.yml@self +- template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: displayName: Copy Base Images serviceConnections: diff --git a/eng/common/templates/steps/download-build-artifact.yml b/eng/docker-tools/templates/steps/download-build-artifact.yml similarity index 100% rename from eng/common/templates/steps/download-build-artifact.yml rename to eng/docker-tools/templates/steps/download-build-artifact.yml diff --git a/eng/common/templates/steps/init-common.yml b/eng/docker-tools/templates/steps/init-common.yml similarity index 100% rename from eng/common/templates/steps/init-common.yml rename to eng/docker-tools/templates/steps/init-common.yml diff --git a/eng/common/templates/steps/init-docker-linux.yml b/eng/docker-tools/templates/steps/init-docker-linux.yml similarity index 88% rename from eng/common/templates/steps/init-docker-linux.yml rename to eng/docker-tools/templates/steps/init-docker-linux.yml index 8c554ad9b..c8669e19b 100644 --- a/eng/common/templates/steps/init-docker-linux.yml +++ b/eng/docker-tools/templates/steps/init-docker-linux.yml @@ -5,7 +5,7 @@ parameters: condition: true steps: -- template: /eng/common/templates/steps/init-common.yml@self +- template: /eng/docker-tools/templates/steps/init-common.yml@self parameters: condition: ${{ parameters.condition }} - script: echo "##vso[task.setvariable variable=artifactsPath]/artifacts" @@ -16,7 +16,7 @@ steps: # Cleanup Docker Resources ################################################################################ - ${{ if eq(parameters.cleanupDocker, 'true') }}: - - template: /eng/common/templates/steps/cleanup-docker-linux.yml@self + - template: /eng/docker-tools/templates/steps/cleanup-docker-linux.yml@self parameters: condition: ${{ parameters.condition }} @@ -25,7 +25,7 @@ steps: ################################################################################ - ${{ if eq(parameters.setupImageBuilder, 'true') }}: - - powershell: $(engCommonPath)/Pull-Image.ps1 $(imageNames.imageBuilder) + - powershell: $(engDockerToolsPath)/Pull-Image.ps1 $(imageNames.imageBuilder) displayName: Pull Image Builder condition: and(succeeded(), ${{ parameters.condition }}) @@ -33,7 +33,7 @@ steps: docker build -t $(imageNames.imageBuilder.withrepo) --build-arg IMAGE=$(imageNames.imageBuilder) - -f $(engCommonPath)/Dockerfile.WithRepo . + -f $(engDockerToolsPath)/Dockerfile.WithRepo . displayName: Build Image for Image Builder condition: and(succeeded(), ${{ parameters.condition }}) @@ -78,13 +78,13 @@ steps: # Setup Test Runner (Optional) ################################################################################ - ${{ if eq(parameters.setupTestRunner, 'true') }}: - - powershell: $(engCommonPath)/Pull-Image.ps1 $(imageNames.testrunner) + - powershell: $(engDockerToolsPath)/Pull-Image.ps1 $(imageNames.testrunner) displayName: Pull Test Runner condition: and(succeeded(), ${{ parameters.condition }}) - script: > docker build -t $(imageNames.testRunner.withrepo) --build-arg IMAGE=$(imageNames.testrunner) - -f $(engCommonPath)/Dockerfile.WithRepo . + -f $(engDockerToolsPath)/Dockerfile.WithRepo . displayName: Build Test Runner Image condition: and(succeeded(), ${{ parameters.condition }}) diff --git a/eng/common/templates/steps/init-docker-windows.yml b/eng/docker-tools/templates/steps/init-docker-windows.yml similarity index 89% rename from eng/common/templates/steps/init-docker-windows.yml rename to eng/docker-tools/templates/steps/init-docker-windows.yml index ae867f9e8..e8593b5eb 100644 --- a/eng/common/templates/steps/init-docker-windows.yml +++ b/eng/docker-tools/templates/steps/init-docker-windows.yml @@ -3,7 +3,7 @@ parameters: condition: true steps: -- template: /eng/common/templates/steps/init-common.yml@self +- template: /eng/docker-tools/templates/steps/init-common.yml@self parameters: condition: ${{ parameters.condition }} - powershell: echo "##vso[task.setvariable variable=artifactsPath]$(Build.ArtifactStagingDirectory)" @@ -13,7 +13,7 @@ steps: ################################################################################ # Cleanup Docker Resources ################################################################################ -- template: /eng/common/templates/steps/cleanup-docker-windows.yml@self +- template: /eng/docker-tools/templates/steps/cleanup-docker-windows.yml@self parameters: condition: ${{ parameters.condition }} @@ -21,7 +21,7 @@ steps: # Setup Image Builder (Optional) ################################################################################ - ${{ if eq(parameters.setupImageBuilder, 'true') }}: - - powershell: $(engCommonPath)/Invoke-WithRetry.ps1 "docker pull $(imageNames.imageBuilder)" + - powershell: $(engDockerToolsPath)/Invoke-WithRetry.ps1 "docker pull $(imageNames.imageBuilder)" displayName: Pull Image Builder condition: and(succeeded(), ${{ parameters.condition }}) - script: docker create --name setupImageBuilder-$(Build.BuildId)-$(System.JobId) $(imageNames.imageBuilder) diff --git a/eng/common/templates/steps/init-matrix-build-publish.yml b/eng/docker-tools/templates/steps/init-matrix-build-publish.yml similarity index 94% rename from eng/common/templates/steps/init-matrix-build-publish.yml rename to eng/docker-tools/templates/steps/init-matrix-build-publish.yml index 5ba018fee..8a555eccd 100644 --- a/eng/common/templates/steps/init-matrix-build-publish.yml +++ b/eng/docker-tools/templates/steps/init-matrix-build-publish.yml @@ -39,7 +39,7 @@ steps: $buildRepoName = "$(Build.Repository.Name)" } - $engCommonPath = "$(Build.Repository.LocalPath)/$buildRepoName/$(engCommonRelativePath)" + $engDockerToolsPath = "$(Build.Repository.LocalPath)/$buildRepoName/$(engDockerToolsRelativePath)" $engPath = "$(Build.Repository.LocalPath)/$buildRepoName/eng" $manifest = "$buildRepoName/$(manifest)" @@ -50,7 +50,7 @@ steps: } echo "##vso[task.setvariable variable=buildRepoName]$buildRepoName" - echo "##vso[task.setvariable variable=engCommonPath]$engCommonPath" + echo "##vso[task.setvariable variable=engDockerToolsPath]$engDockerToolsPath" echo "##vso[task.setvariable variable=manifest]$manifest" echo "##vso[task.setvariable variable=engPath]$engPath" echo "##vso[task.setvariable variable=testScriptPath]$testScriptPath" diff --git a/eng/common/templates/steps/parse-test-arg-arrays.yml b/eng/docker-tools/templates/steps/parse-test-arg-arrays.yml similarity index 100% rename from eng/common/templates/steps/parse-test-arg-arrays.yml rename to eng/docker-tools/templates/steps/parse-test-arg-arrays.yml diff --git a/eng/common/templates/steps/publish-artifact.yml b/eng/docker-tools/templates/steps/publish-artifact.yml similarity index 100% rename from eng/common/templates/steps/publish-artifact.yml rename to eng/docker-tools/templates/steps/publish-artifact.yml diff --git a/eng/common/templates/steps/publish-readmes.yml b/eng/docker-tools/templates/steps/publish-readmes.yml similarity index 91% rename from eng/common/templates/steps/publish-readmes.yml rename to eng/docker-tools/templates/steps/publish-readmes.yml index 4cf80ecf7..270898050 100644 --- a/eng/common/templates/steps/publish-readmes.yml +++ b/eng/docker-tools/templates/steps/publish-readmes.yml @@ -22,7 +22,7 @@ steps: name: PublishReadmes displayName: Publish Readmes condition: ${{ parameters.condition }} -- template: /eng/common/templates/steps/wait-for-mcr-doc-ingestion.yml@self +- template: /eng/docker-tools/templates/steps/wait-for-mcr-doc-ingestion.yml@self parameters: commitDigest: $(PublishReadmes.readmeCommitDigest) condition: and(${{ parameters.condition }}, ne(variables['PublishReadmes.readmeCommitDigest'], '')) diff --git a/eng/common/templates/steps/retain-build.yml b/eng/docker-tools/templates/steps/retain-build.yml similarity index 86% rename from eng/common/templates/steps/retain-build.yml rename to eng/docker-tools/templates/steps/retain-build.yml index 0cb192c68..bcf11d57e 100644 --- a/eng/common/templates/steps/retain-build.yml +++ b/eng/docker-tools/templates/steps/retain-build.yml @@ -1,6 +1,6 @@ steps: - powershell: > - $(engCommonPath)/Retain-Build.ps1 + $(engDockerToolsPath)/Retain-Build.ps1 -BuildId $(Build.BuildId) -AzdoOrgUri '$(System.CollectionUri)' -AzdoProject '$(System.TeamProject)' diff --git a/eng/common/templates/steps/run-imagebuilder.yml b/eng/docker-tools/templates/steps/run-imagebuilder.yml similarity index 100% rename from eng/common/templates/steps/run-imagebuilder.yml rename to eng/docker-tools/templates/steps/run-imagebuilder.yml diff --git a/eng/common/templates/steps/run-pwsh-with-auth.yml b/eng/docker-tools/templates/steps/run-pwsh-with-auth.yml similarity index 100% rename from eng/common/templates/steps/run-pwsh-with-auth.yml rename to eng/docker-tools/templates/steps/run-pwsh-with-auth.yml diff --git a/eng/common/templates/steps/set-dry-run.yml b/eng/docker-tools/templates/steps/set-dry-run.yml similarity index 100% rename from eng/common/templates/steps/set-dry-run.yml rename to eng/docker-tools/templates/steps/set-dry-run.yml diff --git a/eng/common/templates/steps/set-image-info-path-var.yml b/eng/docker-tools/templates/steps/set-image-info-path-var.yml similarity index 100% rename from eng/common/templates/steps/set-image-info-path-var.yml rename to eng/docker-tools/templates/steps/set-image-info-path-var.yml diff --git a/eng/common/templates/steps/test-images-linux-client.yml b/eng/docker-tools/templates/steps/test-images-linux-client.yml similarity index 92% rename from eng/common/templates/steps/test-images-linux-client.yml rename to eng/docker-tools/templates/steps/test-images-linux-client.yml index e97f015c7..38426ab2a 100644 --- a/eng/common/templates/steps/test-images-linux-client.yml +++ b/eng/docker-tools/templates/steps/test-images-linux-client.yml @@ -7,7 +7,7 @@ parameters: sourceBuildPipelineRunId: "" steps: -- template: /eng/common/templates/steps/init-docker-linux.yml@self +- template: /eng/docker-tools/templates/steps/init-docker-linux.yml@self parameters: setupImageBuilder: false setupTestRunner: true @@ -44,7 +44,7 @@ steps: displayName: Start Test Runner Container condition: and(succeeded(), ${{ parameters.condition }}) - ${{ if and(eq(variables['System.TeamProject'], parameters.internalProjectName), ne(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/common/templates/steps/run-pwsh-with-auth.yml@self + - template: /eng/docker-tools/templates/steps/run-pwsh-with-auth.yml@self parameters: displayName: Docker login serviceConnection: ${{ parameters.publishConfig.testServiceConnection.name }} @@ -52,16 +52,16 @@ steps: command: >- $azLoginArgs = '--service-principal --tenant $env:AZURE_TENANT_ID -u $env:AZURE_CLIENT_ID --federated-token $env:AZURE_FEDERATED_TOKEN'; docker exec -e AZURE_TENANT_ID=$env:tenantId -e AZURE_CLIENT_ID=$env:servicePrincipalId -e AZURE_FEDERATED_TOKEN=$env:idToken $(testRunner.container) pwsh - -File $(engCommonRelativePath)/Invoke-WithRetry.ps1 + -File $(engDockerToolsRelativePath)/Invoke-WithRetry.ps1 "az login $azLoginArgs; az acr login -n ${{ parameters.publishConfig.buildAcr.server }}" - ${{ if eq(parameters.preBuildValidation, 'false') }}: - - template: /eng/common/templates/steps/download-build-artifact.yml@self + - template: /eng/docker-tools/templates/steps/download-build-artifact.yml@self parameters: targetPath: $(Build.ArtifactStagingDirectory) artifactName: image-info condition: ${{ parameters.condition }} pipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} -- template: /eng/common/templates/steps/parse-test-arg-arrays.yml@self +- template: /eng/docker-tools/templates/steps/parse-test-arg-arrays.yml@self - powershell: > $(test.init); docker exec diff --git a/eng/common/templates/steps/test-images-windows-client.yml b/eng/docker-tools/templates/steps/test-images-windows-client.yml similarity index 90% rename from eng/common/templates/steps/test-images-windows-client.yml rename to eng/docker-tools/templates/steps/test-images-windows-client.yml index 00fa062fd..ad84cff0e 100644 --- a/eng/common/templates/steps/test-images-windows-client.yml +++ b/eng/docker-tools/templates/steps/test-images-windows-client.yml @@ -7,12 +7,12 @@ parameters: steps: - ${{ if and(eq(variables['System.TeamProject'], parameters.internalProjectName), ne(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/common/templates/steps/init-docker-windows.yml@self + - template: /eng/docker-tools/templates/steps/init-docker-windows.yml@self parameters: cleanupDocker: true setupImageBuilder: false condition: ${{ parameters.condition }} - - template: /eng/common/templates/steps/run-pwsh-with-auth.yml@self + - template: /eng/docker-tools/templates/steps/run-pwsh-with-auth.yml@self parameters: displayName: Docker login serviceConnection: ${{ parameters.publishConfig.testServiceConnection.name }} @@ -34,13 +34,13 @@ steps: displayName: Cleanup Old Test Results condition: and(succeeded(), ${{ parameters.condition }}) - ${{ if and(eq(variables['System.TeamProject'], parameters.internalProjectName), ne(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/common/templates/steps/download-build-artifact.yml@self + - template: /eng/docker-tools/templates/steps/download-build-artifact.yml@self parameters: targetPath: $(Build.ArtifactStagingDirectory) artifactName: image-info condition: ${{ parameters.condition }} pipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} -- template: /eng/common/templates/steps/parse-test-arg-arrays.yml@self +- template: /eng/docker-tools/templates/steps/parse-test-arg-arrays.yml@self - powershell: > $(test.init); $(testScriptPath) diff --git a/eng/common/templates/steps/validate-branch.yml b/eng/docker-tools/templates/steps/validate-branch.yml similarity index 100% rename from eng/common/templates/steps/validate-branch.yml rename to eng/docker-tools/templates/steps/validate-branch.yml diff --git a/eng/common/templates/steps/wait-for-mcr-doc-ingestion.yml b/eng/docker-tools/templates/steps/wait-for-mcr-doc-ingestion.yml similarity index 89% rename from eng/common/templates/steps/wait-for-mcr-doc-ingestion.yml rename to eng/docker-tools/templates/steps/wait-for-mcr-doc-ingestion.yml index 05112cc5b..5f64438bb 100644 --- a/eng/common/templates/steps/wait-for-mcr-doc-ingestion.yml +++ b/eng/docker-tools/templates/steps/wait-for-mcr-doc-ingestion.yml @@ -4,7 +4,7 @@ parameters: dryRunArg: "" steps: -- template: /eng/common/templates/steps/run-imagebuilder.yml@self +- template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: displayName: Wait for MCR Doc Ingestion condition: and(${{ parameters.condition }}, eq(variables['waitForIngestionEnabled'], 'true')) diff --git a/eng/common/templates/steps/wait-for-mcr-image-ingestion.yml b/eng/docker-tools/templates/steps/wait-for-mcr-image-ingestion.yml similarity index 93% rename from eng/common/templates/steps/wait-for-mcr-image-ingestion.yml rename to eng/docker-tools/templates/steps/wait-for-mcr-image-ingestion.yml index f8ad85d57..6c7236439 100644 --- a/eng/common/templates/steps/wait-for-mcr-image-ingestion.yml +++ b/eng/docker-tools/templates/steps/wait-for-mcr-image-ingestion.yml @@ -16,7 +16,7 @@ parameters: default: "true" steps: -- template: /eng/common/templates/steps/run-imagebuilder.yml@self +- template: /eng/docker-tools/templates/steps/run-imagebuilder.yml@self parameters: displayName: Wait for Image Ingestion condition: and(${{ parameters.condition }}, eq(variables['waitForIngestionEnabled'], 'true')) diff --git a/eng/common/templates/task-prefix-decorator.yml b/eng/docker-tools/templates/task-prefix-decorator.yml similarity index 100% rename from eng/common/templates/task-prefix-decorator.yml rename to eng/docker-tools/templates/task-prefix-decorator.yml diff --git a/eng/docker-tools/templates/variables/common-paths.yml b/eng/docker-tools/templates/variables/common-paths.yml new file mode 100644 index 000000000..d8a520025 --- /dev/null +++ b/eng/docker-tools/templates/variables/common-paths.yml @@ -0,0 +1,5 @@ +variables: + engDockerToolsRelativePath: eng/docker-tools + engDockerToolsPath: $(Build.Repository.LocalPath)/$(engDockerToolsRelativePath) + engPath: $(Build.Repository.LocalPath)/eng + testScriptPath: "" diff --git a/eng/common/templates/variables/common.yml b/eng/docker-tools/templates/variables/common.yml similarity index 88% rename from eng/common/templates/variables/common.yml rename to eng/docker-tools/templates/variables/common.yml index 525709f45..1a994f684 100644 --- a/eng/common/templates/variables/common.yml +++ b/eng/docker-tools/templates/variables/common.yml @@ -1,6 +1,6 @@ variables: -- template: /eng/common/templates/variables/docker-images.yml@self -- template: /eng/common/templates/variables/common-paths.yml@self +- template: /eng/docker-tools/templates/variables/docker-images.yml@self +- template: /eng/docker-tools/templates/variables/common-paths.yml@self - name: publishReadme value: true @@ -68,10 +68,7 @@ variables: - name: default1ESInternalPoolImage value: 1es-ubuntu-2204 -- name: defaultSourceAnalysisPoolName - value: NetCore1ESPool-Internal -- name: defaultSourceAnalysisPoolImage - value: 1es-windows-2022 +- template: /eng/docker-tools/templates/variables/sdl-pool.yml@self # Define these as placeholder values to allow string validation to succeed since we don't have the # variable group with the actual values in public builds. For internal builds, the variable group diff --git a/eng/common/templates/variables/docker-images.yml b/eng/docker-tools/templates/variables/docker-images.yml similarity index 94% rename from eng/common/templates/variables/docker-images.yml rename to eng/docker-tools/templates/variables/docker-images.yml index 4eb56e122..fff171d69 100644 --- a/eng/common/templates/variables/docker-images.yml +++ b/eng/docker-tools/templates/variables/docker-images.yml @@ -1,5 +1,5 @@ variables: - imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2830238 + imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2852433 imageNames.imageBuilder: $(imageNames.imageBuilderName) imageNames.imageBuilder.withrepo: imagebuilder-withrepo:$(Build.BuildId)-$(System.JobId) imageNames.testRunner: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux3.0-docker-testrunner diff --git a/eng/common/templates/variables/dotnet/build-test-publish.yml b/eng/docker-tools/templates/variables/dotnet/build-test-publish.yml similarity index 90% rename from eng/common/templates/variables/dotnet/build-test-publish.yml rename to eng/docker-tools/templates/variables/dotnet/build-test-publish.yml index 94732039b..96a0cf500 100644 --- a/eng/common/templates/variables/dotnet/build-test-publish.yml +++ b/eng/docker-tools/templates/variables/dotnet/build-test-publish.yml @@ -1,7 +1,7 @@ # Common variables for building/testing/publishing in the .NET team's pipelines variables: -- template: /eng/common/templates/variables/dotnet/common.yml@self +- template: /eng/docker-tools/templates/variables/dotnet/common.yml@self - name: commonVersionsImageInfoPath value: build-info/docker @@ -28,7 +28,7 @@ variables: - name: gitHubNotificationsRepoInfo.repo value: dotnet-docker-internal # $(gitHubNotificationsRepoInfo.authArgs) is needed by the "Post Publish -# Notification" step in eng/common/templates/jobs/publish.yml#L271, even during +# Notification" step in eng/docker-tools/templates/jobs/publish.yml#L271, even during # a dry-run. This value is a placeholder that gets replaced when referencing # the secrets.yml variable template. - name: gitHubNotificationsRepoInfo.authArgs diff --git a/eng/common/templates/variables/dotnet/common.yml b/eng/docker-tools/templates/variables/dotnet/common.yml similarity index 92% rename from eng/common/templates/variables/dotnet/common.yml rename to eng/docker-tools/templates/variables/dotnet/common.yml index bb39d82c2..8f98c0921 100644 --- a/eng/common/templates/variables/dotnet/common.yml +++ b/eng/docker-tools/templates/variables/dotnet/common.yml @@ -1,5 +1,5 @@ variables: -- template: /eng/common/templates/variables/common.yml@self +- template: /eng/docker-tools/templates/variables/common.yml@self - name: publicProjectName value: public @@ -7,7 +7,7 @@ variables: value: internal # $(dockerHubRegistryCreds) is needed by the copy-base-images step in -# eng/common/templates/stages/build-and-test.yml#L73-L78, even during a dry-run. +# eng/docker-tools/templates/stages/build-and-test.yml#L73-L78, even during a dry-run. # This is a placeholder that gets replaced when referencing the secrets.yml # variable template. - name: dockerHubRegistryCreds diff --git a/eng/common/templates/variables/dotnet/secrets-unofficial.yml b/eng/docker-tools/templates/variables/dotnet/secrets-unofficial.yml similarity index 100% rename from eng/common/templates/variables/dotnet/secrets-unofficial.yml rename to eng/docker-tools/templates/variables/dotnet/secrets-unofficial.yml diff --git a/eng/common/templates/variables/dotnet/secrets.yml b/eng/docker-tools/templates/variables/dotnet/secrets.yml similarity index 100% rename from eng/common/templates/variables/dotnet/secrets.yml rename to eng/docker-tools/templates/variables/dotnet/secrets.yml diff --git a/eng/docker-tools/templates/variables/sdl-pool.yml b/eng/docker-tools/templates/variables/sdl-pool.yml new file mode 100644 index 000000000..18ae9b9fd --- /dev/null +++ b/eng/docker-tools/templates/variables/sdl-pool.yml @@ -0,0 +1,9 @@ +# This template provides default variables for the source analysis pool and +# image used by 1ES pipeline templates for the "SDL Sources Analysis" stage. +variables: +- name: defaultSourceAnalysisPoolName + value: NetCore1ESPool-Internal + readonly: true +- name: defaultSourceAnalysisPoolImage + value: 1es-windows-2022 + readonly: true diff --git a/eng/dockerfile-templates/Get-GeneratedDockerfiles.ps1 b/eng/dockerfile-templates/Get-GeneratedDockerfiles.ps1 index 275c7669b..21ad83024 100644 --- a/eng/dockerfile-templates/Get-GeneratedDockerfiles.ps1 +++ b/eng/dockerfile-templates/Get-GeneratedDockerfiles.ps1 @@ -22,10 +22,10 @@ $onDockerfilesGeneratedLinux = { # On Windows, ImageBuilder is run locally due to limitations with running Docker client within a container. # Remove when https://github.com/dotnet/docker-tools/issues/159 is resolved if ($dockerOs -eq "windows") { - & $PSScriptRoot/../common/Invoke-ImageBuilder.ps1 ` + & $PSScriptRoot/../docker-tools/Invoke-ImageBuilder.ps1 ` -ImageBuilderArgs $imageBuilderArgs } else { - & $PSScriptRoot/../common/Invoke-ImageBuilder.ps1 ` + & $PSScriptRoot/../docker-tools/Invoke-ImageBuilder.ps1 ` -ImageBuilderArgs $imageBuilderArgs ` -OnCommandExecuted $onDockerfilesGeneratedLinux } diff --git a/eng/pipelines/cg-detection.yml b/eng/pipelines/cg-detection.yml index 40c73395f..146cacc99 100644 --- a/eng/pipelines/cg-detection.yml +++ b/eng/pipelines/cg-detection.yml @@ -23,13 +23,13 @@ variables: value: false extends: - template: /eng/common/templates/1es-official.yml@self + template: /eng/docker-tools/templates/1es-official.yml@self parameters: cgDryRun: ${{ parameters.cgDryRun }} stages: - stage: CgDetection displayName: CG Detection jobs: - - template: /eng/common/templates/jobs/cg-build-projects.yml@self + - template: /eng/docker-tools/templates/jobs/cg-build-projects.yml@self parameters: cgDryRun: ${{ parameters.cgDryRun }} diff --git a/eng/pipelines/dotnet-framework-pr-no-cache.yml b/eng/pipelines/dotnet-framework-pr-no-cache.yml index d1634a9df..e58a5de4f 100644 --- a/eng/pipelines/dotnet-framework-pr-no-cache.yml +++ b/eng/pipelines/dotnet-framework-pr-no-cache.yml @@ -24,7 +24,7 @@ variables: readonly: true stages: -- template: /eng/common/templates/stages/dotnet/publish-config-nonprod.yml@self +- template: /eng/docker-tools/templates/stages/dotnet/publish-config-nonprod.yml@self parameters: stagesTemplate: /eng/pipelines/stages/dotnet-framework-base.yml@self stagesTemplateParameters: diff --git a/eng/pipelines/dotnet-framework-pr.yml b/eng/pipelines/dotnet-framework-pr.yml index 59bccfd5c..735e3ca14 100644 --- a/eng/pipelines/dotnet-framework-pr.yml +++ b/eng/pipelines/dotnet-framework-pr.yml @@ -23,7 +23,7 @@ variables: value: manifest.json stages: -- template: /eng/common/templates/stages/dotnet/publish-config-nonprod.yml@self +- template: /eng/docker-tools/templates/stages/dotnet/publish-config-nonprod.yml@self parameters: stagesTemplate: /eng/pipelines/stages/dotnet-framework-base.yml@self stagesTemplateParameters: diff --git a/eng/pipelines/dotnet-framework-samples.yml b/eng/pipelines/dotnet-framework-samples.yml index 2692b59df..d747611dd 100644 --- a/eng/pipelines/dotnet-framework-samples.yml +++ b/eng/pipelines/dotnet-framework-samples.yml @@ -28,19 +28,19 @@ parameters: variables: - template: /eng/pipelines/variables/common.yml@self -- template: /eng/common/templates/variables/dotnet/secrets${{ iif(contains(variables['Build.DefinitionName'], '-official'), '', '-unofficial') }}.yml@self +- template: /eng/docker-tools/templates/variables/dotnet/secrets${{ iif(contains(variables['Build.DefinitionName'], '-official'), '', '-unofficial') }}.yml@self - name: manifest value: manifest.samples.json - name: imageInfoVariant value: "-samples" extends: - template: /eng/common/templates/1es.yml@self + template: /eng/docker-tools/templates/1es.yml@self parameters: reposToExcludeFromScanning: - VersionsRepo stages: - - template: /eng/common/templates/stages/dotnet/publish-config-${{ iif(contains(variables['Build.DefinitionName'], '-official'), 'prod', 'nonprod') }}.yml@self + - template: /eng/docker-tools/templates/stages/dotnet/publish-config-${{ iif(contains(variables['Build.DefinitionName'], '-official'), 'prod', 'nonprod') }}.yml@self parameters: sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} stagesTemplate: /eng/pipelines/stages/dotnet-framework-base.yml@self diff --git a/eng/pipelines/dotnet-framework.yml b/eng/pipelines/dotnet-framework.yml index 5708171b6..372931ea2 100644 --- a/eng/pipelines/dotnet-framework.yml +++ b/eng/pipelines/dotnet-framework.yml @@ -28,19 +28,19 @@ parameters: variables: - template: /eng/pipelines/variables/common.yml@self -- template: /eng/common/templates/variables/dotnet/secrets${{ iif(contains(variables['Build.DefinitionName'], '-official'), '', '-unofficial') }}.yml@self +- template: /eng/docker-tools/templates/variables/dotnet/secrets${{ iif(contains(variables['Build.DefinitionName'], '-official'), '', '-unofficial') }}.yml@self - name: manifest value: manifest.json - name: mcrImageIngestionTimeout value: "00:30:00" extends: - template: /eng/common/templates/1es.yml@self + template: /eng/docker-tools/templates/1es.yml@self parameters: reposToExcludeFromScanning: - VersionsRepo stages: - - template: /eng/common/templates/stages/dotnet/publish-config-${{ iif(contains(variables['Build.DefinitionName'], '-official'), 'prod', 'nonprod') }}.yml@self + - template: /eng/docker-tools/templates/stages/dotnet/publish-config-${{ iif(contains(variables['Build.DefinitionName'], '-official'), 'prod', 'nonprod') }}.yml@self parameters: sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} stagesTemplate: /eng/pipelines/stages/dotnet-framework-base.yml@self diff --git a/eng/pipelines/stages/dotnet-framework-base.yml b/eng/pipelines/stages/dotnet-framework-base.yml index 641f02aea..81d1e4b37 100644 --- a/eng/pipelines/stages/dotnet-framework-base.yml +++ b/eng/pipelines/stages/dotnet-framework-base.yml @@ -24,7 +24,7 @@ parameters: stages: - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - - template: /eng/common/templates/stages/setup-service-connections.yml@self + - template: /eng/docker-tools/templates/stages/setup-service-connections.yml@self parameters: serviceConnections: - name: ${{ parameters.publishConfig.internalMirrorAcr.serviceConnection.name }} @@ -33,7 +33,7 @@ stages: - ${{ each serviceConnection in parameters.additionalServiceConnections }}: - name: ${{ serviceConnection.name }} -- template: /eng/common/templates/stages/dotnet/build-test-publish-repo.yml@self +- template: /eng/docker-tools/templates/stages/dotnet/build-test-publish-repo.yml@self parameters: publishConfig: ${{ parameters.publishConfig }} internalProjectName: ${{ parameters.internalProjectName }} diff --git a/eng/pipelines/update-readmes.yml b/eng/pipelines/update-readmes.yml index c8e47480e..c629c767c 100644 --- a/eng/pipelines/update-readmes.yml +++ b/eng/pipelines/update-readmes.yml @@ -7,7 +7,7 @@ variables: value: manifest.json extends: - template: /eng/common/templates/1es-official.yml@self + template: /eng/docker-tools/templates/1es-official.yml@self parameters: stages: - stage: UpdateReadmes @@ -16,6 +16,6 @@ extends: - job: UpdateReadmes displayName: Update Readmes steps: - - template: /eng/common/templates/steps/init-docker-linux.yml@self - - template: /eng/common/templates/steps/publish-readmes.yml@self - - template: /eng/common/templates/steps/cleanup-docker-linux.yml@self \ No newline at end of file + - template: /eng/docker-tools/templates/steps/init-docker-linux.yml@self + - template: /eng/docker-tools/templates/steps/publish-readmes.yml@self + - template: /eng/docker-tools/templates/steps/cleanup-docker-linux.yml@self diff --git a/eng/pipelines/variables/common.yml b/eng/pipelines/variables/common.yml index 94d4af5a2..e61eed718 100644 --- a/eng/pipelines/variables/common.yml +++ b/eng/pipelines/variables/common.yml @@ -1,5 +1,5 @@ variables: -- template: /eng/common/templates/variables/dotnet/build-test-publish.yml@self +- template: /eng/docker-tools/templates/variables/dotnet/build-test-publish.yml@self - name: "publicGitRepoUri" value: "https://github.com/microsoft/dotnet-framework-docker" diff --git a/eng/readme-templates/Get-GeneratedReadmes.ps1 b/eng/readme-templates/Get-GeneratedReadmes.ps1 index 4f2d6b3e8..2819c8a6e 100644 --- a/eng/readme-templates/Get-GeneratedReadmes.ps1 +++ b/eng/readme-templates/Get-GeneratedReadmes.ps1 @@ -51,10 +51,10 @@ function Invoke-GenerateReadme { # On Windows, ImageBuilder is run locally due to limitations with running Docker client within a container. # Remove when https://github.com/dotnet/docker-tools/issues/159 is resolved if ($dockerOs -eq "windows") { - & $PSScriptRoot/../common/Invoke-ImageBuilder.ps1 ` + & $PSScriptRoot/../docker-tools/Invoke-ImageBuilder.ps1 ` -ImageBuilderArgs $imageBuilderArgs } else { - & $PSScriptRoot/../common/Invoke-ImageBuilder.ps1 ` + & $PSScriptRoot/../docker-tools/Invoke-ImageBuilder.ps1 ` -ImageBuilderArgs $imageBuilderArgs ` -OnCommandExecuted $onDockerfilesGeneratedLinux } diff --git a/tests/run-tests.ps1 b/tests/run-tests.ps1 index 177c1ccf5..4dd11eee3 100644 --- a/tests/run-tests.ps1 +++ b/tests/run-tests.ps1 @@ -12,15 +12,15 @@ param( [string[]]$Paths = @(), [string]$Architecture, - + [string[]]$OSVersions = @(), - + [string]$Registry, - + [string]$RepoPrefix, - + [switch]$PullImages, - + [string]$ImageInfoPath, [ValidateSet('runtime', 'sdk', 'aspnet', 'wcf', 'pre-build')] @@ -54,7 +54,7 @@ $ErrorActionPreference = 'Stop' # Install the .NET Core SDK $DotnetInstallDir = "$PSScriptRoot/../.dotnet" -& $PSScriptRoot/../eng/common/Install-DotNetSdk.ps1 $dotnetInstallDir +& $PSScriptRoot/../eng/docker-tools/Install-DotNetSdk.ps1 $dotnetInstallDir $activeOS = docker version -f "{{ .Server.Os }}"