Sync eng/common directory with azure-sdk-tools for PR 7892 (#7350)

* Move git check for changes to script

* Minor fixes for 1es migration

---------

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
Azure SDK Bot 2024-03-15 17:24:11 -04:00 коммит произвёл GitHub
Родитель b4cc7fe535
Коммит 4048cf1a40
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 25 добавлений и 21 удалений

Просмотреть файл

@ -6,6 +6,6 @@ steps:
condition: |
and(
succeededOrFailed(),
contains(variables['OSVmImage'], 'ubuntu'),
or(contains(variables['OSVmImage'], 'ubuntu'),contains(variables['OSVmImage'], 'linux')),
eq(variables['Container'], '')
)

Просмотреть файл

@ -10,25 +10,14 @@ parameters:
SkipCheckingForChanges: false
steps:
- pwsh: |
echo "git add -A"
git add -A
echo "git diff --name-status --cached --exit-code"
git diff --name-status --cached --exit-code
if ($LastExitCode -ne 0) {
echo "##vso[task.setvariable variable=HasChanges]$true"
echo "Changes detected so setting HasChanges=true"
}
else {
echo "##vso[task.setvariable variable=HasChanges]$false"
echo "No changes so skipping code push"
}
- task: PowerShell@2
displayName: Check for changes
condition: and(succeeded(), eq(${{ parameters.SkipCheckingForChanges }}, false))
workingDirectory: ${{ parameters.WorkingDirectory }}
ignoreLASTEXITCODE: true
inputs:
pwsh: true
workingDirectory: ${{ parameters.WorkingDirectory }}
filePath: ${{ parameters.ScriptDirectory }}/check-for-git-changes.ps1
ignoreLASTEXITCODE: true
- pwsh: |
# Remove the repo owner from the front of the repo name if it exists there

Просмотреть файл

@ -0,0 +1,14 @@
echo "git add -A"
git add -A
echo "git diff --name-status --cached --exit-code"
git diff --name-status --cached --exit-code
if ($LastExitCode -ne 0) {
echo "##vso[task.setvariable variable=HasChanges]$true"
echo "Changes detected so setting HasChanges=true"
}
else {
echo "##vso[task.setvariable variable=HasChanges]$false"
echo "No changes so skipping code push"
}

Просмотреть файл

@ -3,16 +3,17 @@ parameters:
steps:
- pwsh: |
Copy-Item -Path "${{ parameters.rootFolder }}/test-proxy.log" -Destination "${{ parameters.rootFolder }}/proxy.log"
New-Item -ItemType Directory -Force "${{ parameters.rootFolder }}/proxy-logs"
Copy-Item -Path "${{ parameters.rootFolder }}/test-proxy.log" -Destination "${{ parameters.rootFolder }}/proxy-logs/proxy.log"
displayName: Copy Log File
condition: succeededOrFailed()
- template: ../pipelines/templates/steps/publish-artifact.yml
parameters:
ArtifactName: "$(System.StageName)-$(System.JobName)-$(System.JobAttempt)-proxy-logs"
ArtifactPath: "${{ parameters.rootFolder }}/proxy.log"
ArtifactPath: "${{ parameters.rootFolder }}/proxy-logs"
- pwsh: |
Remove-Item -Force ${{ parameters.rootFolder }}/proxy.log
Remove-Item -Force ${{ parameters.rootFolder }}/proxy-logs/proxy.log
displayName: Cleanup Copied Log File
condition: succeededOrFailed()