Skip to content
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

Use fork repo for daily updates in Java #25677

Merged
merged 14 commits into from
Dec 2, 2021
28 changes: 22 additions & 6 deletions eng/pipelines/docindex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
DocRepoLocation: $(Pipeline.Workspace)/docs
DocRepoOwner: Azure
DocRepoName: azure-docs-sdk-java
DailyDocsRepoOwner: azure-sdk
steps:
# Sync docs repo onboarding files/folders
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
Expand Down Expand Up @@ -49,14 +50,29 @@ jobs:
- template: /eng/common/pipelines/templates/steps/set-daily-docs-branch-name.yml
parameters:
DailyBranchVariableName: DailyDocsBranchName
# Create a branch to track docs fork repo onboarding files/folders
- pwsh: |
$ErrorActionPreference = "Continue"
git checkout "origin/$(DailyDocsBranchName)" 2>&1 | Out-Null
$LASTEXITCODE = 0 # This ignores any error from git checkout
git status
displayName: Checkout daily branch if it exists
# git remote on fork repo
weshaggard marked this conversation as resolved.
Show resolved Hide resolved
$GitUrl = "https://$(azuresdk-github-pat)@github.com/$(DailyDocsRepoOwner)/$(DocRepoName).git"
$remoteName = "$(DailyDocsRepoOwner)"
Write-Host "git remote add $remoteName $GitUrl"
git remote add $remoteName $GitUrl
if ($LASTEXITCODE -ne 0)
{
Write-Error "Unable to add remote LASTEXITCODE=$($LASTEXITCODE), see command output above."
exit $LASTEXITCODE
}

# git fetch on fork repo
Write-Host "git fetch $remoteName $(DailyDocsBranchName)"
git fetch $remoteName "$(DailyDocsBranchName)"

# create a branch tracking fork repo daily branch
Write-Host "git checkout -b $(DailyDocsBranchName) -t $remoteName/$(DailyDocsBranchName)"
git checkout -b $(DailyDocsBranchName) -t "$remoteName/$(DailyDocsBranchName)"
displayName: Checkout fork repo daily branch
workingDirectory: $(DocRepoLocation)

# Docs daily updates is supposed to download packages from public feed repository, so we have to specify additional repositories in a POM or the profile.
# Here is maven documentation: https://maven.apache.org/guides/mini/guide-multiple-repositories.html
- powershell: |
Expand All @@ -76,7 +92,7 @@ jobs:
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
arguments: -DocRepoLocation $(DocRepoLocation)
arguments: -DocRepoLocation "$(DocRepoLocation)"
displayName: Update Docs Onboarding for Daily branch
- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
Expand Down
7 changes: 2 additions & 5 deletions eng/pipelines/templates/stages/archetype-java-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ parameters:
- name: ArtifactName
type: string
default: 'not-specified'
- name: TargetDocRepoOwner
type: string
default: ''
- name: TargetDocRepoName
type: string
default: ''
Expand Down Expand Up @@ -223,7 +220,7 @@ stages:
PackageInfoLocations:
- $(Pipeline.Workspace)/${{parameters.ArtifactName}}/PackageInfo/${{artifact.name}}.json
WorkingDirectory: $(System.DefaultWorkingDirectory)
TargetDocRepoOwner: ${{parameters.TargetDocRepoOwner}}
TargetDocRepoOwner: 'Azure'
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
Language: 'java'
SparseCheckoutPaths:
Expand Down Expand Up @@ -388,7 +385,7 @@ stages:
- ${{if ne(artifact.skipPublishDocMs, 'true')}}:
- $(Pipeline.Workspace)/${{parameters.ArtifactName}}/PackageInfo/${{artifact.name}}.json
WorkingDirectory: $(System.DefaultWorkingDirectory)
TargetDocRepoOwner: ${{parameters.TargetDocRepoOwner}}
TargetDocRepoOwner: "azure-sdk"
sima-zhu marked this conversation as resolved.
Show resolved Hide resolved
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
Language: 'java'
DailyDocsBuild: true
Expand Down
4 changes: 0 additions & 4 deletions eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ parameters:
- name: ServiceDirectory
type: string
default: not-specified
- name: TargetDocRepoOwner
type: string
default: Azure
- name: TargetDocRepoName
type: string
default: azure-docs-sdk-java
Expand Down Expand Up @@ -96,6 +93,5 @@ stages:
${{ if eq(parameters.ServiceDirectory, 'template') }}:
TestPipeline: true
ArtifactName: packages
TargetDocRepoOwner: ${{ parameters.TargetDocRepoOwner }}
TargetDocRepoName: ${{ parameters.TargetDocRepoName }}

4 changes: 0 additions & 4 deletions eng/pipelines/templates/stages/cosmos-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ parameters:
- name: SDKType
type: string
default: not-specified
- name: TargetDocRepoOwner
type: string
default: Azure
- name: TargetDocRepoName
type: string
default: azure-docs-sdk-java
Expand Down Expand Up @@ -127,5 +124,4 @@ stages:
SDKType: ${{parameters.SDKType}}
Artifacts: ${{parameters.Artifacts}}
ArtifactName: packages
TargetDocRepoOwner: ${{parameters.TargetDocRepoOwner}}
TargetDocRepoName: ${{parameters.TargetDocRepoName}}