Skip to content

Commit

Permalink
Incorporate feedback on OneLocBuild doc (#7522)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfortescue authored Jun 15, 2021
1 parent dcfb093 commit 52476e9
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Documentation/OneLocBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Onboarding to OneLocBuild is a simple process:
parameters:
CreatePr: false
```
Note: If you are running your PR builds and official builds off of the same definition and are on dnceng,
you will want to conditionalize this step with the following:
```yaml
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
```
To prevent OneLocBuild from running in the public project where it will fail.
3. Run the pipeline you want to use OneLocBuild on your test branch.
4. Open a ticket with the localization team using
[this template](https://ceapex.visualstudio.com/CEINTL/_workitems/create/Loc%20Request?templateId=60b0dcf9-9892-4910-934e-d5becddd1bc1&ownerId=c2e38d3d-0e9e-429f-955d-6e39fc6f0457).
Expand All @@ -28,17 +34,31 @@ Onboarding to OneLocBuild is a simple process:
`LCL-JUNO-PROD-YOURREPO`.
6. Change your YAML (subbing `'LCL-JUNO-PROD-YOURREPO'` for the package ID given to you) to:
```yaml
- {{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
- template: /eng/common/templates/job/onelocbuild.yml
parameters:
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-YOURREPO'
```
Make sure to remove the `CreatePr: false` line from step 2. Additionally, if you added the YAML condition from step
2, make sure that your new YAML condition now looks like:
```yaml
- ${{ if and(and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')), eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
```

7. If using a mirrored repository (your code is mirrored to a trusted repository which your official build uses),
add the following parameter to your YAML (subbing e.g. `sdk` for the value):
```yaml
MirrorRepo: {{name of your GitHub repository}}
MirrorRepo: name of your GitHub repository, e.g. 'sdk'
```
This naming might be confusing for repositories using code mirroring through Maestro, as typically the
"mirror repository" refers to the trusted Azure DevOps repository our GitHub repositories mirror to.
In this case, however, it refers to the repository that _mirrors to_ the Azure DevOps repository
that the official build is based on.

As a further note, the template by default assumes that your mirror repository is located in the dotnet GitHub
organization. If that is not the case, you will need to specify `GitHubOrg` as well.

8. Merge the changes to your main branch and then open a
[repo modification ticket](https://ceapex.visualstudio.com/CEINTL/_workitems/create/Loc%20Request?templateId=415a0569-35ed-45c3-9321-8b1affff1f52&ownerId=c2e38d3d-0e9e-429f-955d-6e39fc6f0457)
with the loc team to let them know to retarget the branch.
Expand Down

0 comments on commit 52476e9

Please sign in to comment.