-
Notifications
You must be signed in to change notification settings - Fork 60
Update ImageBuilder and update pipelines to use appsettings.json for configuration #1900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Pass publish config to init template
* Initial plan * Condition output publish configuration step on not being a pull request The publish configuration contains Azure DevOps variable references that are only available when running internally. This change prevents failures in public CI by skipping the step during pull request builds. Co-authored-by: lbussell <36081148+lbussell@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lbussell <36081148+lbussell@users.noreply.github.com>
| - ${{ if and(parameters.publishConfig, ne(variables['Build.Reason'], 'PullRequest')) }}: | ||
| # .NET Microsoft.Extensions.Configuration reads appsettings.json from the working directory | ||
| # where ImageBuilder is run, not from the executable's directory. Place it in the repo root. | ||
| - powershell: |- | ||
| $appsettingsJsonContent = @" | ||
| { | ||
| "PublishConfiguration": ${{ convertToJson(parameters.publishConfig) }} | ||
| } | ||
| "@ | ||
| Set-Content -Path "appsettings.json" -Value $appsettingsJsonContent | ||
| Get-Content -Path "appsettings.json" | ||
| displayName: Output publish configuration | ||
| condition: and(succeeded(), ${{ parameters.condition }}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this has the same implementation as init-docker-linux.yml. This can be factored out into a step template file instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b6fc71a, testing in build#2872503
…changes (#1915) #1900 did not update the check-base-image-updates pipeline to initialize appsettings.json, so it was failing authenticate when copying base images. In the process of fixing this, I discovered #1914. I had to work around it in this PR. I also moved the pipeline to the shared 1es.yml template and renamed it to have the correct `-official` suffix. Now it follows the patterns used by other pipelines.
…tings.json (#1917) Ever since #1900 was merged, scheduled runs of the mirror-base-images-public pipeline have been failing with the error: `/eng/pipelines/templates/jobs/copy-base-images-public-mirror.yml (Line: 31, Col: 17): Unexpected parameter 'repoPrefix'`. The pipeline needed to be updated to use repoPrefix as part of the acr object in the publishConfig, instead of using a separate parameter. Other changes include: * Updated mirror-base-images-public pipeline to use the 1es.yml template instead of 1es-official.yml (part of #1892) * Renamed pipeline in azure devops: `dotnet-docker-tools-mirror-base-images-public` -> `dotnet-docker-tools-mirror-base-images-public-official` Test runs: - Dry run of copy base images pipeline: build#2874704 - Unofficial run of imagebuilder pipeline, to ensure that the shared copy-base-images logic is not adversely affected: build#2874735 --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This PR is a follow-up to #1880. It updates the pipelines to use appsettings.json to configure service connections instead of passing them as command line arguments.
It includes the ImageBuilder update from #1894. I am submitting this as a separate PR since I don't want automated builds to unexpectedly overwrite my progress.
Test runs:
build#2864259 - 5b86d60build#2864324 - 00c9607