forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] Fix packetbeat system tests on windows (elastic#42172)
* Fix packetbeat system tests on windows * Add retry if needed in pre command hook * Add hook path * Undo retry changes * Remove retry in hook * Undo version change * Fix test * Do not skip npcap installation for system tests * Revert "Do not skip npcap installation for system tests" This reverts commit 90a8265. * Enable npcap installation on CI * use dot sourcing for ps * source in pre-command * test win10 image * fix image name * Revert "fix image name" This reverts commit 587a00e. * Revert "test win10 image" This reverts commit 95b7dea. * test win10 image * Revert "test win10 image" This reverts commit 7ae9b46. * Move out of hook * update gcp auth script * call script instead of dot sourcing
- Loading branch information
Showing
5 changed files
with
44 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Write-Host "~~~ Authenticating GCP" | ||
# Secrets must be redacted | ||
# https://buildkite.com/docs/pipelines/managing-log-output#redacted-environment-variables | ||
|
||
$privateCIGCSServiceAccount = "kv/ci-shared/platform-ingest/gcp-platform-ingest-ci-service-account" | ||
$tempFileName = "google-cloud-credentials.json" | ||
$secretFileLocation = Join-Path $env:TEMP $tempFileName | ||
|
||
$serviceAccountJsonSecret = Retry-Command -ScriptBlock { | ||
vault kv get -field=data -format=json $privateCIGCSServiceAccount | ConvertFrom-Json | ||
if ( -not $? ) { throw "Error during vault kv get" } | ||
} | ||
|
||
New-Item -ItemType File -Path $secretFileLocation >$null | ||
$serviceAccountJsonPlaintextSecret = $serviceAccountJsonSecret.plaintext | ConvertTo-Json | ||
Set-Content -Path $secretFileLocation -Value $serviceAccountJsonPlaintextSecret | ||
if ( -not $?) { throw "Error retrieving the required field from the secret" } | ||
|
||
gcloud auth activate-service-account --key-file $secretFileLocation | ||
Remove-Item -Path $secretFileLocation -Force |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters