mirror of
https://github.com/microsoft/mcp.git
synced 2026-11-04 12:01:31 +00:00
Sync eng/common directory with azure-sdk-tools for PR 17316 (#3996)
* Update pipelines. * Updates for new approach in companion PR --------- Co-authored-by: Travis Prescott <trpresco@microsoft.com>
This commit is contained in:
1 parent
5ecde31916
commit
2d31822ce1
2 files changed
+17
-2
No files matched your search
@@ -42,7 +42,10 @@ jobs:
|
||||
- name: BinDirectory
|
||||
value: $(Pipeline.Workspace)/bin
|
||||
- name: ApiReviewSourceCommit
|
||||
value: ''
|
||||
${{ if eq(parameters.kind, 'base') }}:
|
||||
value: $(ApiReviewBaseCommit)
|
||||
${{ if eq(parameters.kind, 'target') }}:
|
||||
value: $(ApiReviewTargetCommit)
|
||||
- name: ArtifactOutputDirectory
|
||||
value: $(Build.ArtifactStagingDirectory)/${{ parameters.kind }}
|
||||
steps:
|
||||
@@ -55,6 +58,10 @@ jobs:
|
||||
echo "ref must be a fully-qualified branch or tag ref." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! "$SOURCE_COMMIT" =~ ^[0-9a-fA-F]{40}$ ]]; then
|
||||
echo "A pinned 40-character source commit SHA is required." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! "$REPOSITORY_FULL_NAME" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]]; then
|
||||
echo "repositoryFullName must be in owner/repository form." >&2
|
||||
exit 1
|
||||
@@ -72,16 +79,21 @@ jobs:
|
||||
mkdir -p "$SOURCE_DIRECTORY"
|
||||
git -C "$SOURCE_DIRECTORY" init
|
||||
git -C "$SOURCE_DIRECTORY" remote add origin "https://github.com/$REPOSITORY_FULL_NAME.git"
|
||||
git -C "$SOURCE_DIRECTORY" fetch --depth=1 origin "$REF"
|
||||
git -C "$SOURCE_DIRECTORY" fetch --depth=1 origin "$SOURCE_COMMIT"
|
||||
git -C "$SOURCE_DIRECTORY" checkout --detach FETCH_HEAD
|
||||
git -C "$SOURCE_DIRECTORY" clean -ffd
|
||||
|
||||
source_commit=$(git -C "$SOURCE_DIRECTORY" rev-parse HEAD)
|
||||
if [[ "${source_commit,,}" != "${SOURCE_COMMIT,,}" ]]; then
|
||||
echo "Checked-out source commit does not match the requested SHA." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "ref=$REF sourceCommit=$source_commit"
|
||||
echo "##vso[task.setvariable variable=ApiReviewSourceCommit]$source_commit"
|
||||
displayName: Clone ${{ parameters.kind }} source ref
|
||||
env:
|
||||
REF: ${{ parameters.ref }}
|
||||
SOURCE_COMMIT: $(ApiReviewSourceCommit)
|
||||
REPOSITORY_FULL_NAME: ${{ parameters.repositoryFullName }}
|
||||
SOURCE_DIRECTORY: $(Build.SourcesDirectory)
|
||||
PACKAGE_NAME: ${{ parameters.packageName }}
|
||||
|
||||
@@ -37,6 +37,7 @@ steps:
|
||||
language = $env:LANGUAGE
|
||||
kind = $env:KIND
|
||||
ref = $env:REF
|
||||
sourceCommit = $env:SOURCE_COMMIT
|
||||
result = 'Failed'
|
||||
artifactName = $env:ARTIFACT_NAME
|
||||
buildId = $env:BUILD_ID
|
||||
@@ -53,8 +54,10 @@ steps:
|
||||
env:
|
||||
${{ if eq(parameters.kind, 'base') }}:
|
||||
CALLBACK_PROOF: $(BaseCallbackProof)
|
||||
SOURCE_COMMIT: $(ApiReviewBaseCommit)
|
||||
${{ if eq(parameters.kind, 'target') }}:
|
||||
CALLBACK_PROOF: $(TargetCallbackProof)
|
||||
SOURCE_COMMIT: $(ApiReviewTargetCommit)
|
||||
CALLBACK_RESOURCE_URL: $(CompletionCallbackResourceUrl)
|
||||
API_REVIEW_HUB_ENDPOINT: $(ApiReviewHubEndpoint)
|
||||
OPERATION_ID: $(ApiReviewOperationId)
|
||||
|
||||
Reference in new issue
Block a user