forked from elastic/elastic-stack-installers
-
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.
* first draft * 6 * 6 * Preventing agent upgrade via MSI * Update src/installer/BeatPackageCompiler/BeatPackageCompiler.cs Co-authored-by: Craig MacKenzie <[email protected]> * Update README.md * Update README.md * Fixing uninstall flow and install cleanup flow * rolling back if agent install command fails * redirecting stdout to MSI log * Failing the uninstall flow in case agent uninstall command fails * Don't attempt calling agent install if the file doesn't exist * adding BK logic (elastic#219) * Update build.ps1 * Clean up path length Instead of re-cloning to a checkout with a shorter path, we rename the existing BK checkout. * Fix 798ff24 * Typo * Build from MANIFEST_URL and don't sign This commit implements the refactoring to allow a short term integration with the unified release. It's meant to be triggered by getting passed a $MANIFEST_URL and $DRA_WORKFLOW env var. * Update README.md Co-authored-by: Craig MacKenzie <[email protected]> * Update README.md Co-authored-by: Craig MacKenzie <[email protected]> * Update README.md Co-authored-by: Craig MacKenzie <[email protected]> * Update README.md Co-authored-by: Craig MacKenzie <[email protected]> * Redirecting stderr and removing PATH manipulation for Agent MSI * Remove cron schedule As discussed in https://elasticco.atlassian.net/browse/REL-1004?focusedCommentId=107598 * Trigger 7.17 beats DRA using schedule As the release manager can't trigger the workflow introduced in 566b9e4 , we maintain the old way of building snapshot/staging beats artifacts by keeping the trigger pipeline only for that branch. Note: this means that this PR **MUST NOT** be backported to the elastic-stack-installers 7.17 branch. Details: https://elasticco.atlassian.net/browse/REL-1004?focusedCommentId=107973 * Making sure Agent MSI runs as an administrator * Add MSI tests for Agent Pipeline (elastic#220) Add Install, Upgrade, and Uninstall MSI tests using Pester w/ Powershell Core * Enabling agent tests * Disable "Default" test case as it doesn't exist anymore. Don't fail build on test failure for now. * Default mode clean-up * Update build.ps1 --------- Co-authored-by: Craig MacKenzie <[email protected]> Co-authored-by: Dimitrios Liappis <[email protected]> Co-authored-by: William Easton <[email protected]> Co-authored-by: William Easton <[email protected]>
- Loading branch information
Showing
22 changed files
with
1,434 additions
and
144 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
$ErrorActionPreference = "Stop" | ||
Set-Strictmode -version 3 | ||
|
||
write-host (ConvertTo-Json $PSVersiontable -Compress) | ||
write-host "Running as: $([Environment]::UserName)" | ||
|
||
write-host "`$env:AGENT = $($Env:AGENT)" | ||
|
||
if ($psversiontable.psversion -lt "7.4.0") { | ||
# Download Powershell Core, and rerun this script using Powershell Core | ||
|
||
write-host "Downloading Powershell Core" | ||
invoke-webrequest -uri https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x64.zip -outfile pwsh.zip | ||
|
||
write-host "Expanding Powershell Core" | ||
Expand-Archive pwsh.zip -destinationpath (Join-Path $PSScriptRoot "pwsh") | ||
|
||
Write-host "Invoking from Powershell Core" | ||
& (Join-Path $PSScriptRoot "pwsh/pwsh.exe") -file (Join-Path $PSScriptRoot "test.ps1") | ||
|
||
if ($LASTEXITCODE -eq 0) { | ||
write-host "Child pwsh process exited successfully" | ||
exit 0 | ||
} else { | ||
write-host "Child pwsh process returned $LASTEXITCODE, a non zero exit code" | ||
throw "Tests failed." | ||
} | ||
} | ||
|
||
$AgentMSI = Get-ChildItem bin/out -Include "elastic-agent*.msi" -Recurse | ||
|
||
if ($AgentMSI -eq $null) { | ||
write-error "No agent MSI found to test" | ||
} | ||
|
||
|
||
$OldAgentMSI = (Join-Path $PSScriptRoot "elastic-agent-8.11.4-windows-x86_64.msi") | ||
if (-not (test-path $OldAgentMSI)) { | ||
Write-Host "Downloading older MSI for upgrade tests" | ||
invoke-webrequest -uri https://storage.googleapis.com/agent-msi-testing/elastic-agent-8.11.4-windows-x86_64.msi -outfile $OldAgentMSI | ||
} | ||
|
||
& (Join-Path $PSScriptRoot "../../src/agent-qa/Invoke-Pester.ps1") -PathToLatestMSI $AgentMSI.Fullname -PathToEarlyMSI $OldAgentMSI | ||
|
||
write-host "Returned from Pester Test" |
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 |
---|---|---|
|
@@ -63,4 +63,6 @@ src/*.cmd | |
# Executable Artifacts | ||
src/*.exe | ||
src/*.pdb | ||
src/*.dll | ||
src/*.dll | ||
pwsh | ||
pwsh.zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup useLegacyV2RuntimeActivationPolicy="true"> | ||
<supportedRuntime version="v4.0.30319"/> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> | ||
<supportedRuntime version="v2.0.50727"/> | ||
<supportedRuntime version="v2.0.50215"/> | ||
<supportedRuntime version="v1.1.4322"/> | ||
</startup> | ||
</configuration> |
Oops, something went wrong.