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

Sync eng/common directory with azure-sdk-tools for PR 7896 #1550

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions eng/common/testproxy/onboarding/common-asset-functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -207,41 +207,6 @@ Function Invoke-ProxyCommand {
)
$updatedDirectory = $TargetDirectory.Replace("`\", "/")

# CommandString just a string indicating the proxy arguments. In the default case of running against the proxy tool, can just be used directly.
# However, in the case of docker, we need to append a bunch more arguments to the string.
if ($TestProxyExe -eq "docker" -or $TestProxyExe -eq "podman"){
$token = $env:GIT_TOKEN
$committer = $env:GIT_COMMIT_OWNER
$email = $env:GIT_COMMIT_EMAIL

if (-not $committer) {
$committer = & git config --global user.name
}

if (-not $email) {
$email = & git config --global user.email
}

if(-not $token -or -not $committer -or -not $email){
Write-Error ("When running this transition script in `"docker`" or `"podman`" mode, " `
+ "the environment variables GIT_TOKEN, GIT_COMMIT_OWNER, and GIT_COMMIT_EMAIL must be set to reflect the appropriate user. ")
exit 1
}

$targetImage = if ($env:TRANSITION_SCRIPT_DOCKER_TAG) { $env:TRANSITION_SCRIPT_DOCKER_TAG } else { "azsdkengsys.azurecr.io/engsys/test-proxy:latest" }

$CommandString = @(
"run --rm --name transition.test.proxy",
"-v `"${updatedDirectory}:/srv/testproxy`"",
"-e `"GIT_TOKEN=${token}`"",
"-e `"GIT_COMMIT_OWNER=${committer}`"",
"-e `"GIT_COMMIT_EMAIL=${email}`"",
$targetImage,
"test-proxy",
$CommandString
) -join " "
}

Write-Host "$TestProxyExe $CommandString"
[array] $output = & "$TestProxyExe" $CommandString.Split(" ") --storage-location="$updatedDirectory"
# echo the command output
Expand Down
4 changes: 2 additions & 2 deletions eng/common/testproxy/onboarding/generate-assets-json.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ Generated assets.json file contents
If flag InitialPush is set, recordings will be automatically pushed to the assets repo and the Tag property updated.

.PARAMETER TestProxyExe
The executable used during the "InitialPush" action. Defaults to the dotnet tool test-proxy, but also supports "docker" or "podman".
The executable used during the "InitialPush" action. Defaults to the dotnet tool test-proxy, but also supports custom executables as well.

If the user provides their own value that doesn't match options "test-proxy", "docker", or "podman", the script will use this input as the test-proxy exe
If the user provides their own value that doesn't match options "test-proxy" the script will use this input as the test-proxy exe
when invoking commands. EG "$TestProxyExe push -a sdk/keyvault/azure-keyvault-keys/assets.json."

.PARAMETER InitialPush
Expand Down