Skip to content

Commit

Permalink
Move README and TPN templates to src\VirtualMonoRepo (#15478)
Browse files Browse the repository at this point in the history
  • Loading branch information
MilenaHristova authored Feb 9, 2023
2 parents 0110f59 + d62d079 commit bda2c1c
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"microsoft.dotnet.darc": {
"version": "1.1.0-beta.23106.1",
"version": "1.1.0-beta.23107.1",
"commands": [
"darc"
]
Expand Down
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,13 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c453dfef2f41533de5cb03b2115aab9d0dfc74c6</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Darc" Version="1.1.0-beta.23106.1">
<Dependency Name="Microsoft.DotNet.Darc" Version="1.1.0-beta.23107.1">
<Uri>https://github.com/dotnet/arcade-services</Uri>
<Sha>8b6dc24326637735543511b2b5c5e6331adc293b</Sha>
<Sha>c6f3ec3b751020f757695bcd351b1cbb179e21bd</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.DarcLib" Version="1.1.0-beta.23106.1">
<Dependency Name="Microsoft.DotNet.DarcLib" Version="1.1.0-beta.23107.1">
<Uri>https://github.com/dotnet/arcade-services</Uri>
<Sha>8b6dc24326637735543511b2b5c5e6331adc293b</Sha>
<Sha>c6f3ec3b751020f757695bcd351b1cbb179e21bd</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.Console" Version="8.0.0-alpha.1.22557.12">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependency from https://github.com/dotnet/arcade-services -->
<MicrosoftDotNetDarcLibVersion>1.1.0-beta.23106.1</MicrosoftDotNetDarcLibVersion>
<MicrosoftDotNetDarcLibVersion>1.1.0-beta.23107.1</MicrosoftDotNetDarcLibVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependency from https://github.com/dotnet/winforms -->
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/steps/vmr-pull-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ steps:
--tmp $(Agent.TempDirectory)
--branch ${{ parameters.vmrBranch }}
--target-ref ${{ parameters.targetRef }}
--readme-template $(Agent.BuildDirectory)/installer/src/VirtualMonoRepo/README.template.md
--tpn-template $(Agent.BuildDirectory)/installer/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt
displayName: Synchronize dotnet/dotnet
workingDirectory: $(Agent.BuildDirectory)/installer
6 changes: 3 additions & 3 deletions eng/pipelines/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ parameters:
- name: vmrBranch
displayName: dotnet/dotnet branch to push to
type: string
default: ''
default: ' '

- name: disableVmrBuild
displayName: Skip source-building the VMR
type: boolean
default: false

variables:
- ${{ if ne(parameters.vmrBranch, '') }}:
- ${{ if ne(parameters.vmrBranch, ' ') }}:
- name: VmrBranch
value: ${{ parameters.vmrBranch }}
value: ${{ replace(parameters.vmrBranch, ' ', '') }}
- ${{ else }}:
- name: VmrBranch
value: ${{ replace(replace(variables['System.PullRequest.TargetBranch'], 'refs/heads/', ''), 'refs/pull/', '') }}
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/vmr-sync-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ parameters:
variables:
- ${{ if ne(parameters.vmrBranch, ' ') }}:
- name: VmrBranch
value: ${{ parameters.vmrBranch }}
value: ${{ replace(parameters.vmrBranch, ' ', '') }}
- ${{ else }}:
- name: VmrBranch
value: ${{ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), 'refs/pull/', '') }}
Expand Down
6 changes: 3 additions & 3 deletions eng/pipelines/vmr-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ parameters:
- name: vmrBranch
displayName: dotnet/dotnet branch to push to
type: string
default: ''
default: ' '

variables:
- ${{ if ne(parameters.vmrBranch, '') }}:
- ${{ if ne(parameters.vmrBranch, ' ') }}:
- name: VmrBranch
value: ${{ parameters.vmrBranch }}
value: ${{ replace(parameters.vmrBranch, ' ', '') }}
- ${{ else }}:
- name: VmrBranch
value: ${{ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), 'refs/pull/', '') }}
Expand Down
36 changes: 35 additions & 1 deletion eng/vmr-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
### Defaults to the revision of the parent installer repo
### --debug
### Optional. Turns on the most verbose logging for the VMR tooling
### --readme-template
### Optional. Template for VMRs README.md used for regenerating the file to list the newest versions of components.
### Defaults to src/VirtualMonoRepo/README.template.md
### --tpn-template
### Optional. Template for the header of VMRs THIRD-PARTY-NOTICES file.
### Defaults to src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt

source="${BASH_SOURCE[0]}"

Expand Down Expand Up @@ -89,6 +95,8 @@ vmr_dir=''
vmr_branch='main'
target_ref=''
verbosity=verbose
tpn_template=''
readme_template=''

while [[ $# -gt 0 ]]; do
opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")"
Expand All @@ -112,6 +120,14 @@ while [[ $# -gt 0 ]]; do
target_ref=$2
shift
;;
--readme-template)
readme_template=$2
shift
;;
--tpn-template)
tpn_template=$2
shift
;;
-h|--help)
print_help
exit 0
Expand All @@ -131,11 +147,29 @@ if [[ ! -d "$installer_dir" ]]; then
exit 1
fi

if [[ -z "$readme_template" ]]; then
readme_template="$installer_dir/src/VirtualMonoRepo/README.template.md"
fi

if [[ -z "$tpn_template" ]]; then
tpn_template="$installer_dir/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt"
fi

if [[ -z "$tmp_dir" ]]; then
fail "Missing --tmp-dir argument. Please specify the path to the temporary folder where the repositories will be cloned"
exit 1
fi

if [[ ! -f "$readme_template" ]]; then
fail "File '$readme_template' does not exist. Please specify a valid path to the README template"
exit 1
fi

if [[ ! -f "$tpn_template" ]]; then
fail "File '$tpn_template' does not exist. Please specify a valid path to the THIRD-PARTY-NOTICES template"
exit 1
fi

if [[ -z "$vmr_dir" ]]; then
vmr_dir="$tmp_dir/dotnet"
fi
Expand Down Expand Up @@ -180,7 +214,7 @@ fi
highlight "Starting the synchronization to '$target_ref'.."
set +e

if "$dotnet" darc vmr update --vmr "$vmr_dir" --tmp "$tmp_dir" --$verbosity --recursive --additional-remotes "installer:$installer_dir" "installer:$target_ref"; then
if "$dotnet" darc vmr update --vmr "$vmr_dir" --tmp "$tmp_dir" --$verbosity --recursive --readme-template "$readme_template" --tpn-template "$tpn_template" --additional-remotes "installer:$installer_dir" "installer:$target_ref"; then
highlight "Synchronization succeeded"
else
fail "Synchronization of dotnet/dotnet to '$target_ref' failed!"
Expand Down
File renamed without changes.

0 comments on commit bda2c1c

Please sign in to comment.