From aef73e4b566d36c5f9b9fd5fa12501587cdd375e Mon Sep 17 00:00:00 2001 From: twangboy Date: Fri, 1 Nov 2024 14:57:44 -0600 Subject: [PATCH 01/15] Update windows bootstrap for new repo --- bootstrap-salt.ps1 | 298 +++++++++++++++------------------------------ 1 file changed, 101 insertions(+), 197 deletions(-) diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index eccbb35..9ab42d5 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -74,15 +74,6 @@ param( #Name or IP of the master server. Installer defaults to "salt". [String]$Master = "not-specified", - [Parameter(Mandatory=$false, ValueFromPipeline=$True)] - [Alias("r")] - # URL to the windows packages. Will look for a file named repo.json at the - # root of the URL. This file is used to determine the name and location of - # the installer in the repo. If repo.json is not found, it will look for the - # file under the minor directory. - # Default is "https://repo.saltproject.io/salt/py3/windows" - [String]$RepoUrl = "https://repo.saltproject.io/salt/py3/windows", - [Parameter(Mandatory=$false, ValueFromPipeline=$True)] [Alias("c")] # Vagrant only @@ -303,14 +294,26 @@ if (!(Get-IsAdministrator)) { #=============================================================================== # Change RepoUrl for older versions #=============================================================================== -$defaultUrl = "https://repo.saltproject.io/salt/py3/windows" -$oldRepoUrl = "https://repo.saltproject.io/windows" $majorVersion = Get-MajorVersion -Version $Version -if ( [Uri]($RepoUrl).AbsoluteUri -eq $defaultUrl ) { - # No customURL passed, let's check for a pre 3006 version - if ($majorVersion -lt "3006") { - # This is an older version, use the old URL - $RepoUrl = $oldRepoUrl +if ($majorVersion -lt "3006") { + # This is an older version, use the old URL + Write-Host "Versions older than 3006 are not available" -ForegroundColor Red + exit 1 +} + +#=============================================================================== +# Declare variables +#=============================================================================== +$ConfDir = "$RootDir\conf" +$PkiDir = "$ConfDir\pki\minion" +$RootDir = "$env:ProgramData\Salt Project\Salt" +$ApiUrl = "https://packages.broadcom.com/artifactory/api/storage/saltproject-generic/windows" + +# Check for existing installation where RootDir is stored in the registry +$SaltRegKey = "HKLM:\SOFTWARE\Salt Project\Salt" +if (Test-Path -Path $SaltRegKey) { + if ($null -ne (Get-ItemProperty $SaltRegKey).root_dir) { + $RootDir = (Get-ItemProperty $SaltRegKey).root_dir } } @@ -324,7 +327,9 @@ Write-Verbose "version: $Version" Write-Verbose "runservice: $RunService" Write-Verbose "master: $Master" Write-Verbose "minion: $Minion" -Write-Verbose "repourl: $RepoUrl" +Write-Verbose "apiurl: $ApiUrl" +Write-Verbose "ConfDir: $ConfDir" +Write-Verbose "RootDir: $RootDir" if ($RunService.ToLower() -eq "true") { Write-Verbose "Windows service will be set to run" @@ -339,34 +344,11 @@ if ($RunService.ToLower() -eq "true") { } #=============================================================================== -# Ensure Directories are present, copy Vagrant Configs if found +# Copy Vagrant Files to their proper location. #=============================================================================== $ConfiguredAnything = $False -# Detect older version of Salt to determing default RootDir -if ($majorVersion -lt 3004) { - $RootDir = "$env:SystemDrive`:\salt" -} else { - $RootDir = "$env:ProgramData\Salt Project\Salt" -} - -# Check for existing installation where RootDir is stored in the registry -$SaltRegKey = "HKLM:\SOFTWARE\Salt Project\Salt" -if (Test-Path -Path $SaltRegKey) { - if ($null -ne (Get-ItemProperty $SaltRegKey).root_dir) { - $RootDir = (Get-ItemProperty $SaltRegKey).root_dir - } -} - -$ConfDir = "$RootDir\conf" -$PkiDir = "$ConfDir\pki\minion" -Write-Verbose "ConfDir: $ConfDir" - -#=============================================================================== -# Copy Vagrant Files to their proper location. -#=============================================================================== - # Vagrant files will be placed in C:\tmp # Check if minion keys have been uploaded, copy to correct location if (Test-Path C:\tmp\minion.pem) { @@ -412,147 +394,65 @@ if ([IntPtr]::Size -eq 4) { $arch = "AMD64" } +#=============================================================================== +# Getting version information from the repo +#=============================================================================== +Write-Verbose "Getting version information from Artifactory" +$response = Invoke-WebRequest $ApiUrl +# Convert the output to a powershell object +$psobj = $response.ToString() | ConvertFrom-Json + +# Filter the object for folders +$filtered = $psobj.children | Where-Object -Property folder -EQ $true + +# Get each uri and add it to the list of versions +$versions = [System.Collections.ArrayList]@() +$filtered | Select-Object -Property uri | ForEach-Object { + $versions.Add($_.uri.Trim("/")) | Out-Null +} + +# last one in the list is the latest +$latest = $versions | Select-Object -Last 1 + +Write-Verbose "Available versions:" +$versions | ForEach-Object { + Write-Verbose $_ +} +Write-Verbose "Latest version: $latest" + +if ( $Version -EQ "latest") { + $Version = $latest +} + +#=============================================================================== +# Validate passed version +#=============================================================================== +if ( $versions -notcontains $Version ) { + Write-Host "Version $Version is not available" -ForegroundColor Red + Write-Host "Available versions are:" -ForegroundColor Yellow + $versions | ForEach-Object { Write-Host $_ -ForegroundColor Yellow } + exit 1 +} + #=============================================================================== # Get file name to download #=============================================================================== -$saltFileName = "" -$saltVersion = "" -$saltSha512= "" -$saltFileUrl = "" -# Look for a repo.json file -try { - Write-Verbose "Looking for $RepoUrl/repo.json" - $response = Invoke-WebRequest "$RepoUrl/repo.json" ` - -DisableKeepAlive ` - -UseBasicParsing ` - -Method Head - if ( $response.StatusCode -eq "200" ) { - Write-Verbose "Found $RepoUrl/repo.json" - # This URL contains a repo.json file, let's use it - $use_repo_json = $true - } else { - Write-Verbose "Did not find $RepoUrl/repo.json" - # No repo.json file found at the default location - $use_repo_json = $false - } -} catch { - Write-Verbose "There was an error looking up $RepoUrl/repo.json" - Write-Verbose "ERROR: $_" - $use_repo_json = $false -} -if ( $use_repo_json ) { - # We will use the json file to get the name of the installer - $enc = [System.Text.Encoding]::UTF8 - try { - Write-Verbose "Downloading $RepoUrl/repo.json" - $response = Invoke-WebRequest -Uri "$RepoUrl/repo.json" -UseBasicParsing - if ($response.Content.GetType().Name -eq "Byte[]") { - $psobj = $enc.GetString($response.Content) | ConvertFrom-Json - } else { - $psobj = $response.Content | ConvertFrom-Json - } - $hash = Convert-PSObjectToHashtable $psobj - } catch { - Write-Verbose "repo.json not found at: $RepoUrl" - Write-Host "ERROR: $_" - $hash = @{} - } +$saltFileName = "Salt-Minion-$Version-Py3-$arch-Setup.exe" +$response = Invoke-WebRequest "$ApiUrl/$Version/$saltFileName" +$psobj = $response.ToString() | ConvertFrom-Json +$saltFileUrl = $psobj.downloadUri +$saltSha256 = $psobj.checksums.sha256 - $searchVersion = $Version.ToLower() - if ( $hash.Contains($searchVersion)) { - Write-Verbose "Found $searchVersion in $RepoUrl/repo.json" - foreach ($item in $hash.($searchVersion).Keys) { - if ( $item.ToLower().EndsWith(".exe") ) { - if ( $item.ToLower().Contains($arch.ToLower()) ) { - $saltFileName = $hash.($searchVersion).($item).name - $saltVersion = $hash.($searchVersion).($item).version - $saltSha512 = $hash.($searchVersion).($item).SHA512 - } - } - } - } else { - try { - Write-Verbose "Searching for $searchVersion in $RepoUrl/minor/repo.json" - $response = Invoke-WebRequest -Uri "$RepoUrl/minor/repo.json" -UseBasicParsing - if ($response.Content.GetType().Name -eq "Byte[]") { - $psobj = $enc.GetString($response.Content) | ConvertFrom-Json - } else { - $psobj = $response.Content | ConvertFrom-Json - } - $hash = Convert-PSObjectToHashtable $psobj - } catch { - Write-Verbose "repo.json not found at: $RepoUrl/minor/repo.json" - Write-Verbose "ERROR: $_" - $hash = @{} - } - if ( $hash.Contains($searchVersion)) { - Write-Verbose "Found $searchVersion in $RepoUrl/minor/repo.json" - foreach ($item in $hash.($searchVersion).Keys) { - if ( $item.ToLower().EndsWith(".exe") ) { - if ( $item.ToLower().Contains($arch.ToLower()) ) { - $saltFileName = $hash.($searchVersion).($item).name - $saltVersion = $hash.($searchVersion).($item).version - $saltSha512 = $hash.($searchVersion).($item).SHA512 - } - } - } - } else { - Write-Verbose "Version not found in $RepoUrl/minor/repo.json" - } - } -} - -if ( $saltFileName -and $saltVersion -and $saltSha512 ) { +if ( $saltFileName -and $saltVersion -and $saltSha256) { Write-Verbose "Found Name, Version, and Sha" } else { # We will guess the name of the installer - Write-Verbose "Failed to get Name, Version, and Sha from repo.json" + Write-Verbose "Failed to get Name, Version, and Sha from Artifactory API" Write-Verbose "We'll try to find the file in standard paths" $saltFileName = "Salt-Minion-$Version-Py3-$arch-Setup.exe" $saltVersion = $Version } -Write-Verbose "Creating list of urls using the following:" -Write-Verbose "RepoUrl: $RepoUrl" -Write-Verbose "Version: $saltVersion" -Write-Verbose "File Name: $saltFileName" -$urls = $(@($RepoUrl, $saltVersion, $saltFileName) -join "/"), - $(@($RepoUrl, "minor", $saltVersion, $saltFileName) -join "/"), - $(@($RepoUrl, $saltFileName) -join "/"), - $(@($oldRepoUrl, $saltFileName) -join "/") - -$saltFileUrl = $null - -foreach ($url in $urls) { - try { - Write-Verbose "Looking for installer at: $url" - $response = Invoke-WebRequest "$url" ` - -DisableKeepAlive ` - -UseBasicParsing ` - -Method Head - if ( $response.StatusCode -eq "200" ) { - Write-Verbose "Found installer" - # This URL contains a repo.json file, let's use it - $saltFileUrl = $url - break - } else { - Write-Verbose "Installer not found: $url" - } - } catch { - Write-Verbose "ERROR: $url" - } -} - -if ( !$saltFileUrl ) { - Write-Host "Could not find an installer:" - Write-Verbose "Here are the urls searched:" - foreach ($url in $urls) { - Write-Verbose $url - } - exit 1 -} - - #=============================================================================== # Download minion setup file #=============================================================================== @@ -561,6 +461,7 @@ Write-Host " Bootstrapping Salt Minion" -ForegroundColor Green Write-Host " - version: $Version" Write-Host " - file name: $saltFileName" Write-Host " - file url: $saltFileUrl" +Write-Host " - file hash: $saltSha256" Write-Host " - master: $Master" Write-Host " - minion id: $Minion" Write-Host " - start service: $RunService" @@ -580,15 +481,16 @@ if ( Test-Path -Path $localFile ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red + exit 1 } -if ( $saltSha512 ) { - $localSha512 = (Get-FileHash -Path $localFile -Algorithm SHA512).Hash +if ( $saltSha256 ) { + $localSha256 = (Get-FileHash -Path $localFile -Algorithm SHA256).Hash Write-Host "Comparing Hash: " -NoNewline Write-Verbose "" - Write-Verbose "Local Hash: $localSha512" - Write-Verbose "Remote Hash: $saltSha512" - if ( $localSha512 -eq $saltSha512 ) { + Write-Verbose "Local Hash: $localSha256" + Write-Verbose "Remote Hash: $saltSha256" + if ( $localSha256 -eq $saltSha256 ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red @@ -626,7 +528,7 @@ $process | Wait-Process -Timeout 300 -ErrorAction SilentlyContinue $process.Refresh() if ( !$process.HasExited ) { - Write-Host "Timedout" -ForegroundColor Yellow + Write-Host "Installer Timeout" -ForegroundColor Yellow Write-Host "Killing hung installer: " -NoNewline $process | Stop-Process $process.Refresh() @@ -636,8 +538,6 @@ if ( !$process.HasExited ) { Write-Host "Failed" -ForegroundColor Red exit 1 } - - Write-Host "Checking installed service: " -NoNewline } # Wait for salt-minion service to be registered to verify successful @@ -658,7 +558,7 @@ while ( ! $service ) { # probably went wrong and user intervention is required - report # failure. Write-Host "Failed" -ForegroundColor Red - Write-Host "Timed out waiting for the salt-minion service to be installed" + Write-Host "Timeout waiting for the salt-minion service to be installed" exit 1 } } @@ -676,27 +576,31 @@ if( $RunService ) { # We'll try for 2 minutes, sometimes the minion takes that long to start as # it compiles python code for the first time $max_tries = 60 - while ( $service.Status -ne "Running" ) { - if ( $service.Status -eq "Stopped" ) { - Start-Service -Name "salt-minion" -ErrorAction SilentlyContinue - } - Start-Sleep -Seconds 2 - Write-Verbose "Checking the service status" - $service.Refresh() - if ( $service.Status -eq "Running" ) { - Write-Host "Success" -ForegroundColor Green - } else { - if ( $tries -le $max_tries ) { - $tries += 1 + if ( $service.Status -ne "Running" ) { + while ( $service.Status -ne "Running" ) { + if ( $service.Status -eq "Stopped" ) { + Start-Service -Name "salt-minion" -ErrorAction SilentlyContinue + } + Start-Sleep -Seconds 2 + Write-Verbose "Checking the service status" + $service.Refresh() + if ( $service.Status -eq "Running" ) { + Write-Host "Success" -ForegroundColor Green } else { - # If the salt-minion service is still not running, something - # probably went wrong and user intervention is required - report - # failure. - Write-Host "Failed" -ForegroundColor Red - Write-Host "Timed out waiting for the salt-minion service to start" - exit 1 + if ( $tries -le $max_tries ) { + $tries += 1 + } else { + # If the salt-minion service is still not running, something + # probably went wrong and user intervention is required - report + # failure. + Write-Host "Failed" -ForegroundColor Red + Write-Host "Timed out waiting for the salt-minion service to start" + exit 1 + } } } + } else { + Write-Host "Success" -ForegroundColor Green } } else { # Set the service to manual start From de5f8d4292425d5f6cf163b803210fa7654f9e5f Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 4 Nov 2024 13:18:55 -0700 Subject: [PATCH 02/15] Update tests on Windows --- .github/workflows/ci.yml | 17 ---------- .github/workflows/templates/generate.py | 2 -- .github/workflows/test-windows.yml | 1 - kitchen.windows.yml | 42 ------------------------- tests/integration/test_installation.py | 19 ++++++----- tests/requirements.txt | 1 + 6 files changed, 10 insertions(+), 72 deletions(-) delete mode 100644 kitchen.windows.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc4b306..e55ea4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,22 +144,6 @@ jobs: instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' - - windows-2019: - name: Windows 2019 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-windows.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: windows-2019 - display-name: Windows 2019 - timeout: 20 - runs-on: windows-2019 - instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' - - windows-2022: name: Windows 2022 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -480,7 +464,6 @@ jobs: - generate-actions-workflow - macos-12 - macos-13 - - windows-2019 - windows-2022 - almalinux-8 - almalinux-9 diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 0fb6181..f285da8 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -32,7 +32,6 @@ LINUX_DISTROS = [ "ubuntu-2404", ] WINDOWS = [ - "windows-2019", "windows-2022", ] @@ -265,7 +264,6 @@ DISTRO_DISPLAY_NAMES = { "ubuntu-2404": "Ubuntu 24.04", "macos-12": "macOS 12", "macos-13": "macOS 13", - "windows-2019": "Windows 2019", "windows-2022": "Windows 2022", } diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 4bc98f4..719e34f 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -41,7 +41,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.10 uses: actions/setup-python@v5 with: diff --git a/kitchen.windows.yml b/kitchen.windows.yml deleted file mode 100644 index a2b88e2..0000000 --- a/kitchen.windows.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -driver: - name: proxy - host: localhost - reset_command: "exit 0" - port: 5985 - username: kitchen - password: Password1 - -provisioner: - salt_bootstrap_url: D:/a/salt-bootstrap/salt-bootstrap/bootstrap-salt.ps1 - salt_bootstrap_options: -Version %s -Verbose - init_environment: '' - -platforms: - - name: windows-2022 - - name: windows-2019 - -suites: - - name: stable-3006 - provisioner: - salt_version: 3006 - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - - name: stable-3006-8 - provisioner: - salt_version: 3006.8 - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - - name: stable-3007 - provisioner: - salt_version: 3007 - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - - name: stable-3007-1 - provisioner: - salt_version: 3007.1 - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - - name: latest - provisioner: - salt_version: latest - salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe - -verifier: - command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/tests/integration/test_installation.py b/tests/integration/test_installation.py index 8d0b414..f8427b6 100644 --- a/tests/integration/test_installation.py +++ b/tests/integration/test_installation.py @@ -1,12 +1,11 @@ import json import logging +import os import platform import subprocess import pytest -## from Demos.win32cred_demo import target - log = logging.getLogger(__name__) @@ -26,19 +25,17 @@ def run_salt_call(cmd): """ cmd.append("--out=json") result = subprocess.run(cmd, capture_output=True, text=True) - if result.stdout: - json_data = json.loads(result.stdout) - return json_data["local"] - return None + json_data = json.loads(result.stdout) + return json_data["local"] -def test_ping(): +def test_ping(path): cmd = ["salt-call", "--local", "test.ping"] result = run_salt_call(cmd) assert result == True -def test_target_python_version(target_python_version): +def test_target_python_version(path, target_python_version): cmd = ["salt-call", "--local", "grains.item", "pythonversion", "--timeout=120"] result = run_salt_call(cmd) # Returns: {'pythonversion': [3, 10, 11, 'final', 0]} @@ -46,8 +43,10 @@ def test_target_python_version(target_python_version): assert py_maj_ver == target_python_version -def test_target_salt_version(target_salt_version): +def test_target_salt_version(path, target_salt_version): + if not target_salt_version: + pytest.skip(f"No target version specified") cmd = ["salt-call", "--local", "grains.item", "saltversion", "--timeout=120"] result = run_salt_call(cmd) # Returns: {'saltversion': '3006.9+217.g53cfa53040'} - assert result["saltversion"] == target_salt_version + assert result["saltversion"] == target_salt_version \ No newline at end of file diff --git a/tests/requirements.txt b/tests/requirements.txt index e079f8a..16d3b77 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1 +1,2 @@ pytest +requests \ No newline at end of file From 2fa863a9e6b6930c6cc33fa66c4f3773a9481348 Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 4 Nov 2024 13:20:32 -0700 Subject: [PATCH 03/15] Add -UseBasicParsing switch --- bootstrap-salt.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index 9ab42d5..a20b670 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -398,7 +398,7 @@ if ([IntPtr]::Size -eq 4) { # Getting version information from the repo #=============================================================================== Write-Verbose "Getting version information from Artifactory" -$response = Invoke-WebRequest $ApiUrl +$response = Invoke-WebRequest $ApiUrl -UseBasicParsing # Convert the output to a powershell object $psobj = $response.ToString() | ConvertFrom-Json @@ -438,7 +438,7 @@ if ( $versions -notcontains $Version ) { # Get file name to download #=============================================================================== $saltFileName = "Salt-Minion-$Version-Py3-$arch-Setup.exe" -$response = Invoke-WebRequest "$ApiUrl/$Version/$saltFileName" +$response = Invoke-WebRequest "$ApiUrl/$Version/$saltFileName" -UseBasicParsing $psobj = $response.ToString() | ConvertFrom-Json $saltFileUrl = $psobj.downloadUri $saltSha256 = $psobj.checksums.sha256 From f09afd7ceec873dc85d3560afc97eb0b157e5603 Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 4 Nov 2024 13:25:15 -0700 Subject: [PATCH 04/15] Generate workflow --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e55ea4e..91019ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,6 +144,7 @@ jobs: instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' + windows-2022: name: Windows 2022 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' From d013827c0608fd89a8ee6c88ed63688331de846d Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 4 Nov 2024 13:34:22 -0700 Subject: [PATCH 05/15] Refresh environment variables --- .github/workflows/test-windows.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 719e34f..fc906dd 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -63,6 +63,13 @@ jobs: Write-Output "Environment Variables" Get-ChildItem Env: + - name: Refresh Environment + run: | + foreach ($level in "Machine", "User") { + $vars = [Environment]::GetEnvironmentVariables($level).GetEnumerator() + $vars | ForEach-Object { $_ } | Set-Content -Path { "Env:$( $_.Name )" } + } + - name: Test Bootstrap run: | pytest --cache-clear -v -s -ra --log-cli-level=debug tests/integration/ From f36c2c06a324d8100207cd3c6d81c2e9b2a3d391 Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 4 Nov 2024 14:19:03 -0700 Subject: [PATCH 06/15] Trim what we're testing on --- .github/workflows/ci.yml | 318 ------------------------ .github/workflows/templates/generate.py | 219 +--------------- .github/workflows/test-windows.yml | 7 +- kitchen.macos.yml | 42 ---- kitchen.yml | 138 ---------- 5 files changed, 8 insertions(+), 716 deletions(-) delete mode 100644 kitchen.macos.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91019ec..39f042d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,37 +114,6 @@ jobs: - macos-12: - name: macOS 12 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-macos.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: macos-12 - display-name: macOS 12 - timeout: 20 - runs-on: macos-12 - instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' - - - macos-13: - name: macOS 13 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-macos.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: macos-13 - display-name: macOS 13 - timeout: 20 - runs-on: macos-13 - instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' - - - windows-2022: name: Windows 2022 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -161,244 +130,6 @@ jobs: - almalinux-8: - name: AlmaLinux 8 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: almalinux-8 - display-name: AlmaLinux 8 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' - - - almalinux-9: - name: AlmaLinux 9 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: almalinux-9 - display-name: AlmaLinux 9 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' - - - amazon-2: - name: Amazon 2 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: amazon-2 - display-name: Amazon 2 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' - - - arch: - name: Arch - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: arch - display-name: Arch - timeout: 20 - instances: '["git-master", "latest", "default"]' - - - centos-stream9: - name: CentOS Stream 9 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: centos-stream9 - display-name: CentOS Stream 9 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' - - - debian-11: - name: Debian 11 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: debian-11 - display-name: Debian 11 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' - - - debian-12: - name: Debian 12 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: debian-12 - display-name: Debian 12 - timeout: 20 - instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' - - - fedora-39: - name: Fedora 39 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: fedora-39 - display-name: Fedora 39 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' - - - fedora-40: - name: Fedora 40 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: fedora-40 - display-name: Fedora 40 - timeout: 20 - instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' - - - gentoo: - name: Gentoo - if: github.event_name == 'push' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: gentoo - display-name: Gentoo - timeout: 90 - instances: '["git-master"]' - - - gentoo-systemd: - name: Gentoo (systemd) - if: github.event_name == 'push' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: gentoo-systemd - display-name: Gentoo (systemd) - timeout: 90 - instances: '["git-master"]' - - - opensuse-15: - name: Opensuse 15 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: opensuse-15 - display-name: Opensuse 15 - timeout: 20 - instances: '["latest", "default"]' - - - oraclelinux-8: - name: Oracle Linux 8 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: oraclelinux-8 - display-name: Oracle Linux 8 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' - - - oraclelinux-9: - name: Oracle Linux 9 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: oraclelinux-9 - display-name: Oracle Linux 9 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' - - - photon-4: - name: Photon OS 4 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: photon-4 - display-name: Photon OS 4 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' - - - photon-5: - name: Photon OS 5 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: photon-5 - display-name: Photon OS 5 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' - - - rockylinux-8: - name: Rocky Linux 8 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: rockylinux-8 - display-name: Rocky Linux 8 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' - - rockylinux-9: name: Rocky Linux 9 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -413,34 +144,6 @@ jobs: instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' - ubuntu-2004: - name: Ubuntu 20.04 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: ubuntu-2004 - display-name: Ubuntu 20.04 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' - - - ubuntu-2204: - name: Ubuntu 22.04 - if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' - uses: ./.github/workflows/test-linux.yml - needs: - - lint - - generate-actions-workflow - with: - distro-slug: ubuntu-2204 - display-name: Ubuntu 22.04 - timeout: 20 - instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' - - ubuntu-2404: name: Ubuntu 24.04 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -463,29 +166,8 @@ jobs: needs: - lint - generate-actions-workflow - - macos-12 - - macos-13 - windows-2022 - - almalinux-8 - - almalinux-9 - - amazon-2 - - arch - - centos-stream9 - - debian-11 - - debian-12 - - fedora-39 - - fedora-40 - - gentoo - - gentoo-systemd - - opensuse-15 - - oraclelinux-8 - - oraclelinux-9 - - photon-4 - - photon-5 - - rockylinux-8 - rockylinux-9 - - ubuntu-2004 - - ubuntu-2204 - ubuntu-2404 if: always() steps: diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index f285da8..3d842dd 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -6,171 +6,46 @@ import pathlib os.chdir(os.path.abspath(os.path.dirname(__file__))) -## "amazon-2023", -## "opensuse-tumbleweed", LINUX_DISTROS = [ - "almalinux-8", - "almalinux-9", - "amazon-2", - "arch", - "centos-stream9", - "debian-11", - "debian-12", - "fedora-39", - "fedora-40", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "oraclelinux-8", - "oraclelinux-9", - "photon-4", - "photon-5", - "rockylinux-8", "rockylinux-9", - "ubuntu-2004", - "ubuntu-2204", "ubuntu-2404", ] WINDOWS = [ "windows-2022", ] -OSX = [ - "macos-12", - "macos-13", -] - - -## "amazon-2023", -## "opensuse-tumbleweed", STABLE_DISTROS = [ - "almalinux-8", - "almalinux-9", - "amazon-2", - "arch", - "centos-stream9", - "debian-11", - "debian-12", - "fedora-39", - "fedora-40", - "opensuse-15", - "oraclelinux-8", - "oraclelinux-9", - "photon-4", - "photon-5", - "rockylinux-8", "rockylinux-9", - "ubuntu-2004", - "ubuntu-2204", "ubuntu-2404", ] -## "amazon-2023", ONEDIR_DISTROS = [ - "almalinux-8", - "almalinux-9", - "amazon-2", - "centos-stream9", - "debian-11", - "debian-12", - "fedora-39", - "fedora-40", - "oraclelinux-8", - "oraclelinux-9", - "photon-4", - "photon-5", - "rockylinux-8", "rockylinux-9", - "ubuntu-2004", - "ubuntu-2204", "ubuntu-2404", ] ONEDIR_RC_DISTROS = [ - "almalinux-9", - "amazon-2", - "centos-stream9", - "debian-12", - "oraclelinux-9", - "photon-4", - "photon-5", "rockylinux-9", "ubuntu-2404", ] -## "opensuse-tumbleweed", BLACKLIST_3006 = [ - "arch", - "debian-12", - "fedora-40", - "gentoo", - "gentoo-systemd", - "opensuse-15", "ubuntu-2404", ] -## "opensuse-tumbleweed", -BLACKLIST_3007 = [ - "arch", - "fedora-39", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "photon-4", - "photon-5", -] +BLACKLIST_3007 = [] -## "amazon-2023", -## "opensuse-tumbleweed", BLACKLIST_GIT_3006 = [ - "almalinux-9", - "amazon-2", - "arch", - "centos-stream9", - "debian-11", - "debian-12", - "fedora-40", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "oraclelinux-9", - "photon-4", - "photon-5", "rockylinux-9", - "ubuntu-2004", - "ubuntu-2204", "ubuntu-2404", ] -## "amazon-2023", -## "opensuse-tumbleweed", BLACKLIST_GIT_3007 = [ - "almalinux-9", - "amazon-2", - "arch", - "centos-stream9", - "debian-11", - "debian-12", - "fedora-39", - "fedora-40", - "gentoo", - "gentoo-systemd", - "opensuse-15", - "oraclelinux-9", - "photon-4", - "photon-5", "rockylinux-9", - "ubuntu-2004", - "ubuntu-2204", "ubuntu-2404", ] -BLACKLIST_GIT_MASTER = [ - "amazon-2", - "fedora-39", - "photon-4", - "photon-5", -] +BLACKLIST_GIT_MASTER = [] SALT_VERSIONS = [ "3006", @@ -225,57 +100,19 @@ GIT_VERSION_BLACKLIST = [ # SetuptoolsDeprecationWarning: setup.py install is deprecated. # Use build and pip and other standards-based tools. # -GIT_DISTRO_BLACKLIST = [ - "almalinux-8", - "fedora-39", - "opensuse-15", - "oraclelinux-8", - "rockylinux-8", -] +GIT_DISTRO_BLACKLIST = [] -LATEST_PKG_BLACKLIST = [ - "gentoo", - "gentoo-systemd", -] +LATEST_PKG_BLACKLIST = [] -## "amazon-2023": "Amazon 2023", -## "opensuse-tumbleweed": "Opensuse Tumbleweed", DISTRO_DISPLAY_NAMES = { - "almalinux-8": "AlmaLinux 8", - "almalinux-9": "AlmaLinux 9", - "amazon-2": "Amazon 2", - "arch": "Arch", - "centos-stream9": "CentOS Stream 9", - "debian-11": "Debian 11", - "debian-12": "Debian 12", - "fedora-39": "Fedora 39", - "fedora-40": "Fedora 40", - "gentoo": "Gentoo", - "gentoo-systemd": "Gentoo (systemd)", - "opensuse-15": "Opensuse 15", - "oraclelinux-8": "Oracle Linux 8", - "oraclelinux-9": "Oracle Linux 9", - "photon-4": "Photon OS 4", - "photon-5": "Photon OS 5", - "rockylinux-8": "Rocky Linux 8", "rockylinux-9": "Rocky Linux 9", - "ubuntu-2004": "Ubuntu 20.04", - "ubuntu-2204": "Ubuntu 22.04", "ubuntu-2404": "Ubuntu 24.04", - "macos-12": "macOS 12", - "macos-13": "macOS 13", "windows-2022": "Windows 2022", } TIMEOUT_DEFAULT = 20 -TIMEOUT_OVERRIDES = { - "gentoo": 90, - "gentoo-systemd": 90, -} -VERSION_ONLY_OVERRIDES = [ - "gentoo", - "gentoo-systemd", -] +TIMEOUT_OVERRIDES = {} +VERSION_ONLY_OVERRIDES = [] TEMPLATE = """ {distro}: @@ -296,50 +133,6 @@ def generate_test_jobs(): test_jobs = "" needs = ["lint", "generate-actions-workflow"] - test_jobs += "\n" - for distro in OSX: - test_jobs += "\n" - runs_on = distro - runs_on = f"\n runs-on: {runs_on}" - ifcheck = "\n if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'" - uses = "./.github/workflows/test-macos.yml" - instances = [] - timeout_minutes = ( - TIMEOUT_OVERRIDES[distro] - if distro in TIMEOUT_OVERRIDES - else TIMEOUT_DEFAULT - ) - - for salt_version in SALT_VERSIONS: - if salt_version == "latest": - instances.append(salt_version) - continue - - for bootstrap_type in ["stable"]: - if bootstrap_type == "stable": - if salt_version in MAC_STABLE_VERSION_BLACKLIST: - continue - - test_target = f"{bootstrap_type}-{salt_version}" - instances.append(test_target) - - for bootstrap_type in ["default"]: - if distro not in STABLE_DISTROS: - continue - instances.append(bootstrap_type) - - if instances: - needs.append(distro) - test_jobs += TEMPLATE.format( - distro=distro, - runs_on=runs_on, - uses=uses, - ifcheck=ifcheck, - instances=json.dumps(instances), - display_name=DISTRO_DISPLAY_NAMES[distro], - timeout_minutes=timeout_minutes, - ) - test_jobs += "\n" for distro in WINDOWS: test_jobs += "\n" diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index fc906dd..ecc332c 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -63,12 +63,9 @@ jobs: Write-Output "Environment Variables" Get-ChildItem Env: - - name: Refresh Environment + - name: Add Salt to Path run: | - foreach ($level in "Machine", "User") { - $vars = [Environment]::GetEnvironmentVariables($level).GetEnumerator() - $vars | ForEach-Object { $_ } | Set-Content -Path { "Env:$( $_.Name )" } - } + $env:Path = "$env:Path;C:\Program Files\Salt Project\Salt" - name: Test Bootstrap run: | diff --git a/kitchen.macos.yml b/kitchen.macos.yml deleted file mode 100644 index 616a489..0000000 --- a/kitchen.macos.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -driver: - name: exec - -provisioner: - sudo: true - salt_bootstrap_options: -MP stable %s - init_environment: | - echo 'auto_accept: true' > /tmp/auto-accept-keys.conf - sudo mkdir -p /etc/salt/master.d - sudo mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf - brew install coreutils - sh -c 't=$(gshuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' - -platforms: - - name: macos-12 - - name: macos-13 - -suites: - - name: stable-3006 - provisioner: - salt_version: 3006 - salt_call_command: /opt/salt/salt-call - - name: stable-3006-8 - provisioner: - salt_version: 3006.8 - salt_call_command: /opt/salt/salt-call - - name: stable-3007 - provisioner: - salt_version: 3007 - salt_call_command: /opt/salt/salt-call - - name: stable-3007-1 - provisioner: - salt_version: 3007.1 - salt_call_command: /opt/salt/salt-call - - name: latest - provisioner: - salt_version: latest - salt_call_command: /opt/salt/salt-call - -verifier: - command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/ diff --git a/kitchen.yml b/kitchen.yml index 62cc738..a089275 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -29,136 +29,13 @@ provisioner: sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' -## - name: amazon-2023 -## driver: -## image: amazonlinux:2023 -## provision_command: -## - yum -y install --allowerasing procps-ng curl -## - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - -## - name: opensuse-tumbleweed -## driver: -## image: opensuse/tumbleweed:latest -## provision_command: -## - *opensuse_provision_command_01 -## - *opensuse_provision_command_02 -## - *opensuse_provision_command_03 -## - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - platforms: - - name: almalinux-9 - driver: - provision_command: - - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: almalinux-8 - - name: amazon-2 - driver: - image: amazonlinux:2 - platform: rhel - provision_command: - - yum -y install procps-ng - - name: arch - driver: - image: archlinux/archlinux - provision_command: - - pacman -Syu --noconfirm --needed systemd grep awk procps which - - systemctl enable sshd - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: centos-stream9 - driver: - platform: centosstream - image: quay.io/centos/centos:stream9 - provision_command: - - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: debian-11 - driver: - image: debian:bullseye - run_command: /lib/systemd/systemd - - name: debian-12 - driver: - image: debian:bookworm - run_command: /lib/systemd/systemd - provision_command: - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: fedora-39 - driver: - provision_command: &fedora_provision_command - - dnf -y install procps-ng crypto-policies-scripts - - update-crypto-policies --set LEGACY - - name: fedora-40 - driver: - provision_command: *fedora_provision_command - - name: gentoo - driver: - image: gentoo/stage3:latest - run_command: /sbin/init - provision_command: - - rc-update add sshd default - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: gentoo-systemd - driver: - image: gentoo/stage3:systemd - run_command: /lib/systemd/systemd - provision_command: - - systemctl enable sshd.service - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: opensuse-15 - driver: - image: opensuse/leap:15.4 - provision_command: - - &opensuse_provision_command_01 zypper --non-interactive install --auto-agree-with-licenses dbus-1 - - &opensuse_provision_command_02 zypper --non-interactive install --auto-agree-with-licenses sudo openssh which curl systemd - - &opensuse_provision_command_03 systemctl enable sshd.service - name: rockylinux-9 - driver: - platform: centosstream - run_command: /usr/lib/systemd/systemd - provision_command: - - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: oraclelinux-9 - driver: - run_command: /usr/lib/systemd/systemd - provision_command: - - dnf -y install crypto-policies-scripts procps-ng - - update-crypto-policies --set DEFAULT:SHA1 - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: rockylinux-8 - - name: oraclelinux-8 - name: ubuntu-24.04 driver: run_command: /lib/systemd/systemd provision_command: - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: ubuntu-22.04 - driver: - run_command: /lib/systemd/systemd - provision_command: - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - - name: ubuntu-20.04 - driver: - run_command: /lib/systemd/systemd - - name: photon-4 - driver: - image: photon:4.0 - provision_command: - - tdnf -y install rpm procps-ng coreutils gawk systemd - - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config - - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config - - systemctl enable sshd.service - - name: photon-5 - driver: - image: photon:5.0 - provision_command: - - tdnf -y install rpm procps-ng coreutils gawk systemd - - echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config - - sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config - - systemctl enable sshd.service suites: - name: git-3006 @@ -168,9 +45,6 @@ suites: excludes: - opensuse-15 - opensuse-tumbleweed - - debian-11 - - debian-12 - - arch - gentoo - gentoo-systemd - name: git-3006x @@ -180,9 +54,6 @@ suites: excludes: - opensuse-15 - opensuse-tumbleweed - - debian-11 - - debian-12 - - arch - gentoo - gentoo-systemd - name: git-3007 @@ -192,8 +63,6 @@ suites: excludes: - opensuse-15 - opensuse-tumbleweed - - debian-11 - - arch - gentoo - gentoo-systemd - name: git-3007x @@ -203,8 +72,6 @@ suites: excludes: - opensuse-15 - opensuse-tumbleweed - - debian-11 - - arch - gentoo - gentoo-systemd - name: stable-3006 @@ -214,7 +81,6 @@ suites: excludes: - opensuse-15 - opensuse-tumbleweed - - arch - name: stable-3006-8 provisioner: salt_version: 3006.8 @@ -222,7 +88,6 @@ suites: excludes: - opensuse-15 - opensuse-tumbleweed - - arch - name: stable-3007 provisioner: salt_version: 3007 @@ -230,7 +95,6 @@ suites: excludes: - opensuse-15 - opensuse-tumbleweed - - arch - name: stable-3007-1 provisioner: salt_version: 3007.1 @@ -238,7 +102,6 @@ suites: excludes: - opensuse-15 - opensuse-tumbleweed - - arch - name: git-master provisioner: salt_version: master @@ -279,7 +142,6 @@ suites: salt_version: 3008.0rc1 salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s excludes: - - arch - gentoo - opensuse-15 - opensuse-tumbleweed From 7c350c4f48ef613d8655bd4ec556828059e507c7 Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 4 Nov 2024 14:29:27 -0700 Subject: [PATCH 07/15] Don't start windows service in tests --- .github/workflows/test-windows.yml | 31 +++++++++++++++--------------- bootstrap-salt.ps1 | 19 +++++++----------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index ecc332c..aa7f315 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -48,24 +48,23 @@ jobs: - name: Install Pytest run: | - pip install -U pytest + pip install -r tests\requirements.txt + + - name: Get Version + run: | + # We need to get the version here and make it an environment variable + # It is used to install via bootstrap and in the test + # The version is in the instance name + $instance = "${{ matrix.instance }}" + $version = $instance -split "-",2 + if ( $version.Count -gt 1 ) { + $version = $version[1].Replace("-", ".") + } + Write-Output "SaltVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Bootstrap Salt run: | - . ./bootstrap-salt.ps1 -RunService $false - - - name: Set Environment Variables - run: | - $env:Path = "$env:Path;C:\Program Files\Salt Project\Salt" - $env:Instance = ${{ matrix.instance }} - Write-Output "Path:" - Write-Output $env:Path - Write-Output "Environment Variables" - Get-ChildItem Env: - - - name: Add Salt to Path - run: | - $env:Path = "$env:Path;C:\Program Files\Salt Project\Salt" + . .\bootstrap-salt.ps1 -RunService $false -Version $env:SaltVersion - name: Test Bootstrap run: | @@ -82,4 +81,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: exitstatus-${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }} - path: exitstatus/ + path: exitstatus/ \ No newline at end of file diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index a20b670..1859abc 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -18,7 +18,7 @@ Specifies a particular version of the installer. .EXAMPLE - ./bootstrap-salt.ps1 -RunService false + ./bootstrap-salt.ps1 -RunService $false Specifies the salt-minion service to stop and be set to manual. Useful for testing locally from the command line with the --local switch @@ -28,7 +28,7 @@ installer values of host name for the minion id and "salt" for the master. .EXAMPLE - ./bootstrap-salt.ps1 -Minion minion-box -Master master-box -Version 3006.7 -RunService false + ./bootstrap-salt.ps1 -Minion minion-box -Master master-box -Version 3006.7 -RunService $false Specifies all the optional parameters in no particular order. .NOTES @@ -56,12 +56,11 @@ param( [String]$Version = "latest", [Parameter(Mandatory=$false, ValueFromPipeline=$True)] - [ValidateSet("true","false")] [Alias("s")] - # Boolean flag to start or stop the minion service. True will start the - # minion service. False will stop the minion service and set it to "manual". + # Boolean flag to start or stop the minion service. $true will start the + # minion service. $false will stop the minion service and set it to "manual". # The installer starts it by default. - [String]$RunService = "true", + [Bool]$RunService = $true, [Parameter(Mandatory=$false, ValueFromPipeline=$True)] [Alias("m")] @@ -331,16 +330,12 @@ Write-Verbose "apiurl: $ApiUrl" Write-Verbose "ConfDir: $ConfDir" Write-Verbose "RootDir: $RootDir" -if ($RunService.ToLower() -eq "true") { +if ($RunService) { Write-Verbose "Windows service will be set to run" [bool]$RunService = $True -} elseif ($RunService.ToLower() -eq "false") { +} else { Write-Verbose "Windows service will be stopped and set to manual" [bool]$RunService = $False -} else { - # Param passed in wasn't clear so defaulting to true. - Write-Verbose "Windows service defaulting to run automatically" - [bool]$RunService = $True } #=============================================================================== From f1a5e97125c3b557f404806730cacfc3055db3d0 Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 4 Nov 2024 14:39:59 -0700 Subject: [PATCH 08/15] Get version from instance name --- .github/workflows/test-windows.yml | 12 +++ .gitignore | 6 -- Gemfile | 11 -- Vagrantfile | 119 ---------------------- kitchen.yml | 158 ----------------------------- tests/conftest.py | 13 +-- tests/integration/__init__.py | 1 - 7 files changed, 13 insertions(+), 307 deletions(-) delete mode 100644 Gemfile delete mode 100644 Vagrantfile delete mode 100644 kitchen.yml delete mode 100644 tests/integration/__init__.py diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index aa7f315..7a11264 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -62,6 +62,18 @@ jobs: } Write-Output "SaltVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Get Version + run: | + # We need to get the version here and make it an environment variable + # It is used to install via bootstrap and in the test + # The version is in the instance name + $instance = "${{ matrix.instance }}" + $version = $instance -split "-",2 + if ( $version.Count -gt 1 ) { + $version = $version[1].Replace("-", ".") + } + Write-Output "SaltVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Bootstrap Salt run: | . .\bootstrap-salt.ps1 -RunService $false -Version $env:SaltVersion diff --git a/.gitignore b/.gitignore index f1af41c..f21787d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,9 +8,3 @@ venv # Pycharm .idea - -# test-kitchen -.kitchen.local.yml -kitchen.local.yml -.kitchen/ -.bundle/ diff --git a/Gemfile b/Gemfile deleted file mode 100644 index a70a9da..0000000 --- a/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -gem 'test-kitchen', '>= 3.2.2' -gem 'kitchen-salt', '>= 0.7.2' -gem 'kitchen-docker', :git => 'https://github.com/test-kitchen/kitchen-docker.git', :branch => 'main' - -group :vagrant do - gem 'kitchen-vagrant' -end diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 4a8a57f..0000000 --- a/Vagrantfile +++ /dev/null @@ -1,119 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! -VAGRANTFILE_API_VERSION = "2" - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - # All Vagrant configuration is done here. The most common configuration - # options are documented and commented below. For a complete reference, - # please see the online documentation at vagrantup.com. - - # Every Vagrant virtual environment requires a box to build off of. - config.vm.box = "ubuntu/focal64" - - # The url from where the 'config.vm.box' box will be fetched if it - # doesn't already exist on the user's system. - # config.vm.box_url = "http://domain.com/path/to/above.box" - - # Create a forwarded port mapping which allows access to a specific port - # within the machine from a port on the host machine. In the example below, - # accessing "localhost:8080" will access port 80 on the guest machine. - # config.vm.network :forwarded_port, guest: 80, host: 8080 - - # Create a private network, which allows host-only access to the machine - # using a specific IP. - # config.vm.network :private_network, ip: "192.168.33.10" - - # Create a public network, which generally matched to bridged network. - # Bridged networks make the machine appear as another physical device on - # your network. - # config.vm.network :public_network - - # If true, then any SSH connections made will enable agent forwarding. - # Default value: false - # config.ssh.forward_agent = true - - # Share an additional folder to the guest VM. The first argument is - # the path on the host to the actual folder. The second argument is - # the path on the guest to mount the folder. And the optional third - # argument is a set of non-required options. - config.vm.synced_folder ".", "/salt_bootstrap" - - config.vm.provision "shell", path: "bootstrap-salt.sh" - # Provider-specific configuration so you can fine-tune various - # backing providers for Vagrant. These expose provider-specific options. - # Example for VirtualBox: - # - # config.vm.provider :virtualbox do |vb| - # # Don't boot with headless mode - # vb.gui = true - # - # # Use VBoxManage to customize the VM. For example to change memory: - # vb.customize ["modifyvm", :id, "--memory", "1024"] - # end - # - # View the documentation for the provider you're using for more - # information on available options. - - # Enable provisioning with Puppet stand alone. Puppet manifests - # are contained in a directory path relative to this Vagrantfile. - # You will need to create the manifests directory and a manifest in - # the file precise64.pp in the manifests_path directory. - # - # An example Puppet manifest to provision the message of the day: - # - # # group { "puppet": - # # ensure => "present", - # # } - # # - # # File { owner => 0, group => 0, mode => 0644 } - # # - # # file { '/etc/motd': - # # content => "Welcome to your Vagrant-built virtual machine! - # # Managed by Puppet.\n" - # # } - # - # config.vm.provision :puppet do |puppet| - # puppet.manifests_path = "manifests" - # puppet.manifest_file = "site.pp" - # end - - # Enable provisioning with chef solo, specifying a cookbooks path, roles - # path, and data_bags path (all relative to this Vagrantfile), and adding - # some recipes and/or roles. - # - # config.vm.provision :chef_solo do |chef| - # chef.cookbooks_path = "../my-recipes/cookbooks" - # chef.roles_path = "../my-recipes/roles" - # chef.data_bags_path = "../my-recipes/data_bags" - # chef.add_recipe "mysql" - # chef.add_role "web" - # - # # You may also specify custom JSON attributes: - # chef.json = { :mysql_password => "foo" } - # end - - # Enable provisioning with chef server, specifying the chef server URL, - # and the path to the validation key (relative to this Vagrantfile). - # - # The Opscode Platform uses HTTPS. Substitute your organization for - # ORGNAME in the URL and validation key. - # - # If you have your own Chef Server, use the appropriate URL, which may be - # HTTP instead of HTTPS depending on your configuration. Also change the - # validation key to validation.pem. - # - # config.vm.provision :chef_client do |chef| - # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME" - # chef.validation_key_path = "ORGNAME-validator.pem" - # end - # - # If you're using the Opscode platform, your validator client is - # ORGNAME-validator, replacing ORGNAME with your organization name. - # - # If you have your own Chef Server, the default validation client name is - # chef-validator, unless you changed the configuration. - # - # chef.validation_client_name = "ORGNAME-validator" -end diff --git a/kitchen.yml b/kitchen.yml deleted file mode 100644 index a089275..0000000 --- a/kitchen.yml +++ /dev/null @@ -1,158 +0,0 @@ ---- -driver: - name: docker - use_sudo: false - hostname: salt - privileged: true - username: root - cap_add: - - sys_admin - disable_upstart: false - use_internal_docker_network: false - run_command: /usr/lib/systemd/systemd - -provisioner: - name: salt_solo - salt_install: bootstrap - salt_bootstrap_url: bootstrap-salt.sh - salt_bootstrap_options: -MPfq git %s - install_after_init_environment: true - log_level: info - sudo: false - require_chef: false - formula: tests - run_salt_call: false - init_environment: | - echo 'auto_accept: true' > /tmp/auto-accept-keys.conf - mkdir -p /etc/salt/master.d - mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf - sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t' - - -platforms: - - name: rockylinux-9 - - name: ubuntu-24.04 - driver: - run_command: /lib/systemd/systemd - provision_command: - - echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config - -suites: - - name: git-3006 - provisioner: - salt_version: v3006 - salt_bootstrap_options: -x python3 -MPfq git %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - gentoo - - gentoo-systemd - - name: git-3006x - provisioner: - salt_version: 3006.x - salt_bootstrap_options: -x python3 -MPfq git %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - gentoo - - gentoo-systemd - - name: git-3007 - provisioner: - salt_version: v3007 - salt_bootstrap_options: -x python3 -MPfq git %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - gentoo - - gentoo-systemd - - name: git-3007x - provisioner: - salt_version: 3007.x - salt_bootstrap_options: -x python3 -MPfq git %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - gentoo - - gentoo-systemd - - name: stable-3006 - provisioner: - salt_version: 3006 - salt_bootstrap_options: -x python3 -MP stable %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - name: stable-3006-8 - provisioner: - salt_version: 3006.8 - salt_bootstrap_options: -x python3 -MP stable %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - name: stable-3007 - provisioner: - salt_version: 3007 - salt_bootstrap_options: -x python3 -MP stable %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - name: stable-3007-1 - provisioner: - salt_version: 3007.1 - salt_bootstrap_options: -x python3 -MP stable %s - excludes: - - opensuse-15 - - opensuse-tumbleweed - - name: git-master - provisioner: - salt_version: master - salt_bootstrap_options: -x python3 -MPfq -D git %s - - - name: latest - provisioner: - salt_version: latest - salt_bootstrap_options: -MP stable %s - - - name: default - provisioner: - salt_version: latest - salt_bootstrap_options: -MP - - - name: onedir-nightly - provisioner: - salt_version: nightly - salt_bootstrap_options: -MP onedir %s - - - name: onedir-latest - provisioner: - salt_version: latest - salt_bootstrap_options: -MP onedir %s - - - name: onedir-3006 - provisioner: - salt_version: 3006 - salt_bootstrap_options: -MP onedir %s - - - name: onedir-3007 - provisioner: - salt_version: 3007 - salt_bootstrap_options: -MP onedir %s - - - name: onedir-rc-3008-0rc1 - provisioner: - salt_version: 3008.0rc1 - salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s - excludes: - - gentoo - - opensuse-15 - - opensuse-tumbleweed - - ubuntu-2004 - - ubuntu-2204 - - - name: quickstart - provisioner: - salt_bootstrap_options: -Q - -verifier: - name: shell - remote_exec: false - command: pytest --cache-clear -v -s -ra --log-cli-level=info tests/integration/ diff --git a/tests/conftest.py b/tests/conftest.py index 74ded3b..b0ca0af 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,18 +13,7 @@ def target_python_version(): @pytest.fixture(scope="session") def target_salt_version(): - bootstrap_types = ("git", "stable", "onedir", "onedir_rc") - - # filter out any bootstrap types and then join - target_salt = ".".join( - [ - item - for item in os.environ.get("KITCHEN_SUITE", "").split("-") - if item not in bootstrap_types - ] - ) - - # target_salt = os.environ["KITCHEN_SUITE"].split("-", 1)[-1].replace("-", ".") + target_salt = os.environ.get("SaltVersion", "") if target_salt.startswith("v"): target_salt = target_salt[1:] diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py deleted file mode 100644 index 40a96af..0000000 --- a/tests/integration/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- From 8686ca3a39afcec33cf9a2dc861309d990a39fd9 Mon Sep 17 00:00:00 2001 From: twangboy Date: Tue, 5 Nov 2024 09:11:03 -0700 Subject: [PATCH 09/15] Parse versions from artifactory --- bootstrap-salt.ps1 | 35 ++++++++++++++++++++++------------- tests/conftest.py | 25 ++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index 1859abc..1223fba 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -401,32 +401,41 @@ $psobj = $response.ToString() | ConvertFrom-Json $filtered = $psobj.children | Where-Object -Property folder -EQ $true # Get each uri and add it to the list of versions -$versions = [System.Collections.ArrayList]@() +$available_versions = [System.Collections.ArrayList]@() $filtered | Select-Object -Property uri | ForEach-Object { - $versions.Add($_.uri.Trim("/")) | Out-Null + $available_versions.Add($_.uri.Trim("/")) | Out-Null } -# last one in the list is the latest -$latest = $versions | Select-Object -Last 1 +# Create a versions table, similar to repo.json +# This will have the latest version available, the latest version available for +# each major version, and every version available. This makes the version +# lookup logic easier. You can view the contents of the versions table by +# passing the -Verbose command +$latest = $available_versions | Select-Object -Last 1 +$versions_table = [ordered]@{"latest"=$latest} + +$available_versions | ForEach-Object { + $versions_table[$(Get-MajorVersion $_)] = $_ + $versions_table[$_.ToLower()] = $_.ToLower() +} Write-Verbose "Available versions:" -$versions | ForEach-Object { - Write-Verbose $_ -} -Write-Verbose "Latest version: $latest" - -if ( $Version -EQ "latest") { - $Version = $latest +$available_versions | ForEach-Object { + Write-Verbose "- $_" } +Write-Verbose "Versions Table:" +$versions_table | Sort-Object Name | Out-String | Write-Verbose #=============================================================================== # Validate passed version #=============================================================================== -if ( $versions -notcontains $Version ) { +if ( $versions_table -notcontains $Version.ToLower() ) { Write-Host "Version $Version is not available" -ForegroundColor Red Write-Host "Available versions are:" -ForegroundColor Yellow - $versions | ForEach-Object { Write-Host $_ -ForegroundColor Yellow } + $available_versions | ForEach-Object { Write-Host "- $_" -ForegroundColor Yellow } exit 1 +} else { + $Version = $versions_table[$Version.ToLower()] } #=============================================================================== diff --git a/tests/conftest.py b/tests/conftest.py index b0ca0af..154b257 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,9 +1,12 @@ -import logging +import json import os import pytest +import requests -log = logging.getLogger(__name__) +API_URL = ( + "https://packages.broadcom.com/artifactory/api/storage/saltproject-generic/windows" +) @pytest.fixture(scope="session") @@ -13,10 +16,26 @@ def target_python_version(): @pytest.fixture(scope="session") def target_salt_version(): + target_salt = os.environ.get("SaltVersion", "") + html_response = requests.get(API_URL) + content = json.loads(html_response.text) + folders = content["children"] + versions = {} + for folder in folders: + if folder["folder"]: + version = folder["uri"].strip("/") + versions[version] = version + # We're trying to get the latest major version and latest overall + maj_version = version.split(".")[0] + versions[maj_version] = version + versions["latest"] = version + if target_salt.startswith("v"): target_salt = target_salt[1:] + if target_salt not in versions: + pytest.skip(f"Invalid testing version: {target_salt}") if target_salt in ("default", "latest", "master", "nightly"): pytest.skip("Don't have a specific salt version to test against") - return target_salt + return versions[target_salt] From d018ef7ebb0c7a3c16c47b747fbfdef855045bf6 Mon Sep 17 00:00:00 2001 From: twangboy Date: Tue, 5 Nov 2024 09:37:56 -0700 Subject: [PATCH 10/15] Lookup version correctly --- bootstrap-salt.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index 1223fba..3faaabd 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -429,13 +429,13 @@ $versions_table | Sort-Object Name | Out-String | Write-Verbose #=============================================================================== # Validate passed version #=============================================================================== -if ( $versions_table -notcontains $Version.ToLower() ) { +if ( $versions_table.Contains($Version.ToLower()) ) { + $Version = $versions_table[$Version.ToLower()] +} else { Write-Host "Version $Version is not available" -ForegroundColor Red Write-Host "Available versions are:" -ForegroundColor Yellow $available_versions | ForEach-Object { Write-Host "- $_" -ForegroundColor Yellow } exit 1 -} else { - $Version = $versions_table[$Version.ToLower()] } #=============================================================================== From 1156b28cb2d64a0123ba99b488c6d406c387425e Mon Sep 17 00:00:00 2001 From: twangboy Date: Wed, 6 Nov 2024 14:58:41 -0700 Subject: [PATCH 11/15] Add back RepoUrl for air-gap scenarios --- bootstrap-salt.ps1 | 135 ++++++++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 57 deletions(-) diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index 3faaabd..781bda5 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -73,6 +73,15 @@ param( #Name or IP of the master server. Installer defaults to "salt". [String]$Master = "not-specified", + [Parameter(Mandatory=$false, ValueFromPipeline=$True)] + [Alias("r")] + # URL to the windows packages. Will look for a file named repo.json at the + # root of the URL. This file is used to determine the name and location of + # the installer in the repo. If repo.json is not found, it will look for the + # file under the minor directory. + # Default is "https://packages.broadcom.com/artifactory/saltproject-generic/windows/" + [String]$RepoUrl = "https://packages.broadcom.com/artifactory/saltproject-generic/windows/", + [Parameter(Mandatory=$false, ValueFromPipeline=$True)] [Alias("c")] # Vagrant only @@ -291,7 +300,7 @@ if (!(Get-IsAdministrator)) { } #=============================================================================== -# Change RepoUrl for older versions +# Check for older versions #=============================================================================== $majorVersion = Get-MajorVersion -Version $Version if ($majorVersion -lt "3006") { @@ -306,6 +315,7 @@ if ($majorVersion -lt "3006") { $ConfDir = "$RootDir\conf" $PkiDir = "$ConfDir\pki\minion" $RootDir = "$env:ProgramData\Salt Project\Salt" +$DfltUrl = "https://packages.broadcom.com/artifactory/saltproject-generic/windows/" $ApiUrl = "https://packages.broadcom.com/artifactory/api/storage/saltproject-generic/windows" # Check for existing installation where RootDir is stored in the registry @@ -326,6 +336,7 @@ Write-Verbose "version: $Version" Write-Verbose "runservice: $RunService" Write-Verbose "master: $Master" Write-Verbose "minion: $Minion" +Write-Verbose "repourl: $RepoUrl" Write-Verbose "apiurl: $ApiUrl" Write-Verbose "ConfDir: $ConfDir" Write-Verbose "RootDir: $RootDir" @@ -392,69 +403,79 @@ if ([IntPtr]::Size -eq 4) { #=============================================================================== # Getting version information from the repo #=============================================================================== -Write-Verbose "Getting version information from Artifactory" -$response = Invoke-WebRequest $ApiUrl -UseBasicParsing -# Convert the output to a powershell object -$psobj = $response.ToString() | ConvertFrom-Json +if ( $RepoUrl -eq $DfltUrl ) { + Write-Verbose "Getting version information from Artifactory" + $response = Invoke-WebRequest $ApiUrl -UseBasicParsing + # Convert the output to a powershell object + $psobj = $response.ToString() | ConvertFrom-Json -# Filter the object for folders -$filtered = $psobj.children | Where-Object -Property folder -EQ $true + # Filter the object for folders + $filtered = $psobj.children | Where-Object -Property folder -EQ $true -# Get each uri and add it to the list of versions -$available_versions = [System.Collections.ArrayList]@() -$filtered | Select-Object -Property uri | ForEach-Object { - $available_versions.Add($_.uri.Trim("/")) | Out-Null -} + # Get each uri and add it to the list of versions + $available_versions = [System.Collections.ArrayList]@() + $filtered | Select-Object -Property uri | ForEach-Object { + $available_versions.Add($_.uri.Trim("/")) | Out-Null + } -# Create a versions table, similar to repo.json -# This will have the latest version available, the latest version available for -# each major version, and every version available. This makes the version -# lookup logic easier. You can view the contents of the versions table by -# passing the -Verbose command -$latest = $available_versions | Select-Object -Last 1 -$versions_table = [ordered]@{"latest"=$latest} + # Create a versions table, similar to repo.json + # This will have the latest version available, the latest version available for + # each major version, and every version available. This makes the version + # lookup logic easier. You can view the contents of the versions table by + # passing the -Verbose command + $latest = $available_versions | Select-Object -Last 1 + $versions_table = [ordered]@{"latest"=$latest} -$available_versions | ForEach-Object { - $versions_table[$(Get-MajorVersion $_)] = $_ - $versions_table[$_.ToLower()] = $_.ToLower() -} + $available_versions | ForEach-Object { + $versions_table[$(Get-MajorVersion $_)] = $_ + $versions_table[$_.ToLower()] = $_.ToLower() + } -Write-Verbose "Available versions:" -$available_versions | ForEach-Object { - Write-Verbose "- $_" -} -Write-Verbose "Versions Table:" -$versions_table | Sort-Object Name | Out-String | Write-Verbose + Write-Verbose "Available versions:" + $available_versions | ForEach-Object { + Write-Verbose "- $_" + } + Write-Verbose "Versions Table:" + $versions_table | Sort-Object Name | Out-String | Write-Verbose -#=============================================================================== -# Validate passed version -#=============================================================================== -if ( $versions_table.Contains($Version.ToLower()) ) { - $Version = $versions_table[$Version.ToLower()] -} else { - Write-Host "Version $Version is not available" -ForegroundColor Red - Write-Host "Available versions are:" -ForegroundColor Yellow - $available_versions | ForEach-Object { Write-Host "- $_" -ForegroundColor Yellow } - exit 1 -} + #=============================================================================== + # Validate passed version + #=============================================================================== + if ( $versions_table.Contains($Version.ToLower()) ) { + $Version = $versions_table[$Version.ToLower()] + } else { + Write-Host "Version $Version is not available" -ForegroundColor Red + Write-Host "Available versions are:" -ForegroundColor Yellow + $available_versions | ForEach-Object { Write-Host "- $_" -ForegroundColor Yellow } + exit 1 + } -#=============================================================================== -# Get file name to download -#=============================================================================== -$saltFileName = "Salt-Minion-$Version-Py3-$arch-Setup.exe" -$response = Invoke-WebRequest "$ApiUrl/$Version/$saltFileName" -UseBasicParsing -$psobj = $response.ToString() | ConvertFrom-Json -$saltFileUrl = $psobj.downloadUri -$saltSha256 = $psobj.checksums.sha256 - -if ( $saltFileName -and $saltVersion -and $saltSha256) { - Write-Verbose "Found Name, Version, and Sha" -} else { - # We will guess the name of the installer - Write-Verbose "Failed to get Name, Version, and Sha from Artifactory API" - Write-Verbose "We'll try to find the file in standard paths" + #=============================================================================== + # Get file url and sha256 + #=============================================================================== $saltFileName = "Salt-Minion-$Version-Py3-$arch-Setup.exe" + $response = Invoke-WebRequest "$ApiUrl/$Version/$saltFileName" -UseBasicParsing + $psobj = $response.ToString() | ConvertFrom-Json + $saltFileUrl = $psobj.downloadUri + $saltSha256 = $psobj.checksums.sha256 + + if ( $saltFileName -and $saltVersion -and $saltSha256) { + Write-Verbose "Found Name, Version, and Sha" + } else { + # We will guess the name of the installer + Write-Verbose "Failed to get Name, Version, and Sha from Artifactory API" + Write-Verbose "We'll try to find the file in standard paths" + $saltFileName = "Salt-Minion-$Version-Py3-$arch-Setup.exe" + $saltVersion = $Version + } +} else { + # If we're using a custom RepoUrl, we're going to assum that the binary is + # in the reoot of the RepoUrl/Version. We will not check the sha on custom + # repos + $saltFileName = "Salt-Minion-$Version-Py3-$arch-Setup.exe" + $saltFileUrl = "$RepoUrl/$Version/$saltFileName" $saltVersion = $Version + $saltSha256 = "" } #=============================================================================== @@ -478,8 +499,8 @@ Write-Verbose "" Write-Verbose "Salt File URL: $saltFileUrl" Write-Verbose "Local File: $localFile" -$webclient = New-Object System.Net.WebClient -$webclient.DownloadFile($saltFileUrl, $localFile) +if ( Test-Path -Path $localFile ) {Remove-Item -Path $localFile -Force} +Invoke-WebRequest -Uri $saltFileUrl -OutFile $localFile if ( Test-Path -Path $localFile ) { Write-Host "Success" -ForegroundColor Green From 94b61ec940e35cb2680a90abef53b76789d6ac01 Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 7 Nov 2024 10:45:20 -0700 Subject: [PATCH 12/15] Add back other OS's for testing --- .github/workflows/ci.yml | 273 ++++++++++++++++++++++++ .github/workflows/templates/generate.py | 172 ++++++++++++++- tests/requirements.txt | 2 +- 3 files changed, 443 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39f042d..eebfa51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,6 +114,37 @@ jobs: + macos-12: + name: macOS 12 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-macos.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: macos-12 + display-name: macOS 12 + timeout: 20 + runs-on: macos-12 + instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' + + + macos-13: + name: macOS 13 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-macos.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: macos-13 + display-name: macOS 13 + timeout: 20 + runs-on: macos-13 + instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' + + + windows-2022: name: Windows 2022 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -130,6 +161,202 @@ jobs: + almalinux-8: + name: AlmaLinux 8 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: almalinux-8 + display-name: AlmaLinux 8 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + + + almalinux-9: + name: AlmaLinux 9 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: almalinux-9 + display-name: AlmaLinux 9 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + amazon-2: + name: Amazon 2 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: amazon-2 + display-name: Amazon 2 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + + + centos-stream9: + name: CentOS Stream 9 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: centos-stream9 + display-name: CentOS Stream 9 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + debian-11: + name: Debian 11 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: debian-11 + display-name: Debian 11 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + debian-12: + name: Debian 12 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: debian-12 + display-name: Debian 12 + timeout: 20 + instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + fedora-39: + name: Fedora 39 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: fedora-39 + display-name: Fedora 39 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + + + fedora-40: + name: Fedora 40 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: fedora-40 + display-name: Fedora 40 + timeout: 20 + instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + opensuse-15: + name: Opensuse 15 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: opensuse-15 + display-name: Opensuse 15 + timeout: 20 + instances: '["latest", "default"]' + + + oraclelinux-8: + name: Oracle Linux 8 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: oraclelinux-8 + display-name: Oracle Linux 8 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + + + oraclelinux-9: + name: Oracle Linux 9 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: oraclelinux-9 + display-name: Oracle Linux 9 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + photon-4: + name: Photon OS 4 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: photon-4 + display-name: Photon OS 4 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + + + photon-5: + name: Photon OS 5 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: photon-5 + display-name: Photon OS 5 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + + + rockylinux-8: + name: Rocky Linux 8 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: rockylinux-8 + display-name: Rocky Linux 8 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + + rockylinux-9: name: Rocky Linux 9 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -144,6 +371,34 @@ jobs: instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + ubuntu-2004: + name: Ubuntu 20.04 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: ubuntu-2004 + display-name: Ubuntu 20.04 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + ubuntu-2204: + name: Ubuntu 22.04 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: ubuntu-2204 + display-name: Ubuntu 22.04 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + ubuntu-2404: name: Ubuntu 24.04 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -166,8 +421,26 @@ jobs: needs: - lint - generate-actions-workflow + - macos-12 + - macos-13 - windows-2022 + - almalinux-8 + - almalinux-9 + - amazon-2 + - centos-stream9 + - debian-11 + - debian-12 + - fedora-39 + - fedora-40 + - opensuse-15 + - oraclelinux-8 + - oraclelinux-9 + - photon-4 + - photon-5 + - rockylinux-8 - rockylinux-9 + - ubuntu-2004 + - ubuntu-2204 - ubuntu-2404 if: always() steps: diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 3d842dd..537d1da 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -7,45 +7,143 @@ import pathlib os.chdir(os.path.abspath(os.path.dirname(__file__))) LINUX_DISTROS = [ + "almalinux-8", + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-39", + "fedora-40", + "opensuse-15", + "oraclelinux-8", + "oraclelinux-9", + "photon-4", + "photon-5", + "rockylinux-8", "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] + WINDOWS = [ "windows-2022", ] +OSX = [ + "macos-12", + "macos-13", +] + STABLE_DISTROS = [ + "almalinux-8", + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-39", + "fedora-40", + "opensuse-15", + "oraclelinux-8", + "oraclelinux-9", + "photon-4", + "photon-5", + "rockylinux-8", "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] ONEDIR_DISTROS = [ + "almalinux-8", + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-39", + "fedora-40", + "oraclelinux-8", + "oraclelinux-9", + "photon-4", + "photon-5", + "rockylinux-8", "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] ONEDIR_RC_DISTROS = [ + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-12", + "oraclelinux-9", + "photon-4", + "photon-5", "rockylinux-9", "ubuntu-2404", ] BLACKLIST_3006 = [ + "debian-12", + "fedora-40", + "opensuse-15", "ubuntu-2404", ] -BLACKLIST_3007 = [] +BLACKLIST_3007 = [ + "fedora-39", + "opensuse-15", + "photon-4", + "photon-5", +] BLACKLIST_GIT_3006 = [ + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-40", + "opensuse-15", + "oraclelinux-9", + "photon-4", + "photon-5", "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] BLACKLIST_GIT_3007 = [ + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-39", + "fedora-40", + "opensuse-15", + "oraclelinux-9", + "photon-4", + "photon-5", "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] -BLACKLIST_GIT_MASTER = [] +BLACKLIST_GIT_MASTER = [ + "amazon-2", + "fedora-39", + "photon-4", + "photon-5", +] SALT_VERSIONS = [ "3006", @@ -100,13 +198,37 @@ GIT_VERSION_BLACKLIST = [ # SetuptoolsDeprecationWarning: setup.py install is deprecated. # Use build and pip and other standards-based tools. # -GIT_DISTRO_BLACKLIST = [] +GIT_DISTRO_BLACKLIST = [ + "almalinux-8", + "fedora-39", + "opensuse-15", + "oraclelinux-8", + "rockylinux-8", +] LATEST_PKG_BLACKLIST = [] DISTRO_DISPLAY_NAMES = { + "almalinux-8": "AlmaLinux 8", + "almalinux-9": "AlmaLinux 9", + "amazon-2": "Amazon 2", + "centos-stream9": "CentOS Stream 9", + "debian-11": "Debian 11", + "debian-12": "Debian 12", + "fedora-39": "Fedora 39", + "fedora-40": "Fedora 40", + "opensuse-15": "Opensuse 15", + "oraclelinux-8": "Oracle Linux 8", + "oraclelinux-9": "Oracle Linux 9", + "photon-4": "Photon OS 4", + "photon-5": "Photon OS 5", + "rockylinux-8": "Rocky Linux 8", "rockylinux-9": "Rocky Linux 9", + "ubuntu-2004": "Ubuntu 20.04", + "ubuntu-2204": "Ubuntu 22.04", "ubuntu-2404": "Ubuntu 24.04", + "macos-12": "macOS 12", + "macos-13": "macOS 13", "windows-2022": "Windows 2022", } @@ -133,6 +255,50 @@ def generate_test_jobs(): test_jobs = "" needs = ["lint", "generate-actions-workflow"] + test_jobs += "\n" + for distro in OSX: + test_jobs += "\n" + runs_on = distro + runs_on = f"\n runs-on: {runs_on}" + ifcheck = "\n if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'" + uses = "./.github/workflows/test-macos.yml" + instances = [] + timeout_minutes = ( + TIMEOUT_OVERRIDES[distro] + if distro in TIMEOUT_OVERRIDES + else TIMEOUT_DEFAULT + ) + + for salt_version in SALT_VERSIONS: + if salt_version == "latest": + instances.append(salt_version) + continue + + for bootstrap_type in ["stable"]: + if bootstrap_type == "stable": + if salt_version in MAC_STABLE_VERSION_BLACKLIST: + continue + + test_target = f"{bootstrap_type}-{salt_version}" + instances.append(test_target) + + for bootstrap_type in ["default"]: + if distro not in STABLE_DISTROS: + continue + instances.append(bootstrap_type) + + if instances: + needs.append(distro) + test_jobs += TEMPLATE.format( + distro=distro, + runs_on=runs_on, + uses=uses, + ifcheck=ifcheck, + instances=json.dumps(instances), + display_name=DISTRO_DISPLAY_NAMES[distro], + timeout_minutes=timeout_minutes, + ) + test_jobs += "\n" for distro in WINDOWS: test_jobs += "\n" diff --git a/tests/requirements.txt b/tests/requirements.txt index 16d3b77..547de5c 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,2 +1,2 @@ pytest -requests \ No newline at end of file +requests From 6414095b6096d42f473e4a42398584f6d707b3d1 Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 7 Nov 2024 10:47:05 -0700 Subject: [PATCH 13/15] Remove duplicate job step from rebase --- .github/workflows/test-windows.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 7a11264..aa7f315 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -62,18 +62,6 @@ jobs: } Write-Output "SaltVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: Get Version - run: | - # We need to get the version here and make it an environment variable - # It is used to install via bootstrap and in the test - # The version is in the instance name - $instance = "${{ matrix.instance }}" - $version = $instance -split "-",2 - if ( $version.Count -gt 1 ) { - $version = $version[1].Replace("-", ".") - } - Write-Output "SaltVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: Bootstrap Salt run: | . .\bootstrap-salt.ps1 -RunService $false -Version $env:SaltVersion From f56ce5c866bbac75d24fab462815a964d00923a9 Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 7 Nov 2024 10:47:48 -0700 Subject: [PATCH 14/15] Add missing newline --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index aa7f315..e4d4dde 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -81,4 +81,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: exitstatus-${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }} - path: exitstatus/ \ No newline at end of file + path: exitstatus/ From 3316de34f12ff2fe7a1e4f83cb6557aed9be1e68 Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 7 Nov 2024 10:51:47 -0700 Subject: [PATCH 15/15] Update docs for RepoUrl --- bootstrap-salt.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index 781bda5..fc862ab 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -75,10 +75,9 @@ param( [Parameter(Mandatory=$false, ValueFromPipeline=$True)] [Alias("r")] - # URL to the windows packages. Will look for a file named repo.json at the - # root of the URL. This file is used to determine the name and location of - # the installer in the repo. If repo.json is not found, it will look for the - # file under the minor directory. + # URL to the windows packages. Will look for the installer at the root of + # the URL/Version. Place a folder for each version of Salt in this directory + # and place the installer binary for each version in its folder. # Default is "https://packages.broadcom.com/artifactory/saltproject-generic/windows/" [String]$RepoUrl = "https://packages.broadcom.com/artifactory/saltproject-generic/windows/",