Skip to content

Commit

Permalink
chore(updatecli): add goss-windows as target (#940)
Browse files Browse the repository at this point in the history
* wip

* chore git message
  • Loading branch information
smerle33 authored Dec 18, 2023
1 parent 2124364 commit 6cb492c
Show file tree
Hide file tree
Showing 23 changed files with 147 additions and 62 deletions.
42 changes: 5 additions & 37 deletions goss/goss-windows.yaml
Original file line number Diff line number Diff line change
@@ -1,155 +1,123 @@
command:
Powershell:
exec: powershell (Get-Host).Version
exit-status: 0
awscli:
exec: aws --version
exit-status: 0
stdout:
- 2.15.0
- 2.15.2
azurecli:
exec: az version
exit-status: 0
stdout:
- 2.55.0
bundle:
exec: bundle -v
exit-status: 0
chocolatey:
exec: choco
exit-status: 1
container-structure-test:
exec: container-structure-test version
exit-status: 0
stdout:
- 1.16.0
default_java:
exec: java --version
exit-status: 0
stdout:
- 11.0.21+9
docker-ce:
exec: docker -v
exit-status: 0
docker_compose:
exec: docker-compose -v
exit-status: 0
stdout:
- 2.23.3
gh_cli:
exec: gh version
exit-status: 0
stdout:
- 2.40.0
- 2.40.1
git_lfs:
exec: git-lfs version
exit-status: 0
stdout:
- 3.4.0
- 3.4.1
goss:
exec: goss -version
exit-status: 0
stdout:
- 0.4.4
hadolint:
exec: hadolint --version
exit-status: 0
stdout:
- 2.12.0
jdk11:
exec: C:\tools\jdk-11\bin\java --version
exit-status: 0
stdout:
- 11.0.21+9
jdk17:
exec: C:\tools\jdk-17\bin\java --version
exit-status: 0
stdout:
- 17.0.8.1+1
jdk21:
exec: C:\tools\jdk-21\bin\java --version
exit-status: 0
stdout:
- 21.0.1+12
jdk8:
exec: C:\tools\jdk-8\bin\java -version
exit-status: 0
stderr:
- 1.8.0_392
jq:
exec: jq --version
exit-status: 0
stdout:
- jq-1.6
jx-release-version:
exec: jx-release-version -version
exit-status: 0
stdout:
- 2.7.0
kubectl:
exec: kubectl version --client
exit-status: 0
stdout:
- 1.23.13
launchable:
exec: launchable --version
exit-status: 0
stdout:
- 1.66.0
make:
exec: make -version
exit-status: 0
netlify-deploy:
exec: netlify-deploy --help
exit-status: 0
nodejs:
exec: node --version
exit-status: 0
stdout:
- 18.18.2
packer:
exec: packer --version
exit-status: 0
stdout:
- 1.9.4
- 1.10.0
pwsh:
exec: pwsh -command "(Get-Host).Version"
exit-status: 0
stdout:
- /7.*4.*0/
python3:
exec: python --version
exit-status: 0
stdout:
- 3.12.1
ruby:
exec: ruby -v
exit-status: 0
stdout:
- 2.6.10
terraform:
exec: terraform -v
exit-status: 0
stdout:
- 1.6.5
- 1.6.6
trivy:
exec: trivy --version
exit-status: 0
stdout:
- 0.47.0
updatecli:
exec: updatecli version
exit-status: 0
stderr:
- 0.69.0
vagrant:
exec: vagrant --version
exit-status: 0
stdout:
- 2.4.0
yq:
exec: yq --version
exit-status: 0
stdout:
- 4.25.3
file:
Expand Down
12 changes: 0 additions & 12 deletions provisioning/windows-provision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,3 @@ Select-Object -Property DeviceID, DriveType, VolumeName,

Write-Host "== Patch(s) installed"
Get-HotFix | Format-Table -Property HotFixID, Description, InstalledOn

Write-Host "== Sanity Check of installed tools"
Write-Host "- Path environment"
Write-Host (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
foreach($k in $downloads.Keys) {
$download = $downloads[$k]
if($download.ContainsKey('sanityCheck')) {
Write-Host "- Sanity check for $k"
Invoke-Command $download['sanityCheck']
}
}
Write-Host "== End of Sanity Check"
4 changes: 3 additions & 1 deletion updatecli/updatecli.d/awscli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ targets:
name: Update the `aws` CLI version in the goss test
kind: yaml
spec:
file: "goss/goss-linux.yaml"
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.awscli.stdout[0]
scmid: default

Expand Down
4 changes: 3 additions & 1 deletion updatecli/updatecli.d/azure-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ targets:
name: Update the `azure-cli` version in the goss test
kind: yaml
spec:
file: "goss/goss-linux.yaml"
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.azurecli.stdout[0]
scmid: default

Expand Down
4 changes: 2 additions & 2 deletions updatecli/updatecli.d/chocolatey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ targets:
sourceid: lastReleaseVersion
kind: yaml
spec:
file: "provisioning/tools-versions.yml"
key: "chocolatey_version"
file: provisioning/tools-versions.yml
key: $.chocolatey_version
scmid: default

actions:
Expand Down
4 changes: 3 additions & 1 deletion updatecli/updatecli.d/container-structure-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ targets:
name: Update the `container-structure-test` version in the goss test
kind: yaml
spec:
file: "goss/goss-linux.yaml"
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.container-structure-test.stdout[0]
transformers:
- addprefix: "v"
Expand Down
5 changes: 4 additions & 1 deletion updatecli/updatecli.d/docker-ce.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ targets:
name: Update the Docker CE version in the Linux goss test harness
kind: yaml
spec:
file: goss/goss-linux.yaml
files:
- goss/goss-linux.yaml
# TODO check if version is needed on windows
# - goss/goss-windows.yaml
key: $.command.docker-ce.stdout[0]
scmid: default

Expand Down
4 changes: 3 additions & 1 deletion updatecli/updatecli.d/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ targets:
name: Update the `DockerCompose` version in the goss test
kind: yaml
spec:
file: "goss/goss-linux.yaml"
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.docker_compose.stdout[0]
scmid: default

Expand Down
9 changes: 9 additions & 0 deletions updatecli/updatecli.d/git-lfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ targets:
file: "provisioning/tools-versions.yml"
key: "git_lfs_version"
scmid: default
updateVersionInGoss:
name: Update the Git-LFS version in the Goss test harness
kind: yaml
spec:
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.git_lfs.stdout[0]
scmid: default

actions:
default:
Expand Down
4 changes: 3 additions & 1 deletion updatecli/updatecli.d/github-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ targets:
name: Update the `GitHub CLI (gh)` version in the goss test
kind: yaml
spec:
file: "goss/goss-linux.yaml"
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.gh_cli.stdout[0]
scmid: default

Expand Down
11 changes: 10 additions & 1 deletion updatecli/updatecli.d/goss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,21 @@ sources:

targets:
updateToolVersion:
name: Update the Goss tool version
name: Update the `Goss` tool version
kind: yaml
spec:
file: provisioning/tools-versions.yml
key: $.goss_version
scmid: default
updateVersionInGoss:
name: Update the `Goss` version in the goss test
kind: yaml
spec:
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.goss.stdout[0]
scmid: default

actions:
default:
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/hadolint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ targets:
spec:
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.hadolint.stdout[0]
scmid: default

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ targets:
spec:
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.jq.stdout[0]
scmid: default

Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/jx-release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ targets:
spec:
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.jx-release-version.stdout[0]
scmid: default

Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/launchable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ targets:
spec:
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.launchable.stdout[0]
scmid: default

Expand Down
4 changes: 3 additions & 1 deletion updatecli/updatecli.d/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ targets:
sourceid: lastReleaseVersion
kind: yaml
spec:
file: goss/goss-linux.yaml
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.nodejs.stdout[0]
scmid: default

Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/packer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ targets:
spec:
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.packer.stdout[0]
scmid: default

Expand Down
16 changes: 15 additions & 1 deletion updatecli/updatecli.d/pwsh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,27 @@ conditions:

targets:
updateVersion:
name: "Update the pwsh version in the provisioning/tools-versions.yml file"
name: "Update the `Pwsh` version in the provisioning/tools-versions.yml file"
sourceid: lastReleaseVersion
kind: yaml
spec:
file: "provisioning/tools-versions.yml"
key: "windows_pwsh_version"
scmid: default
updatePwshVersionInGoss:
name: Update the `Pwsh` version in the goss test
kind: yaml
spec:
files:
- "goss/goss-windows.yaml"
key: $.command.pwsh.stdout[0]
transformers:
- replacer:
from: "."
to: ".*"
- addprefix: "/"
- addsuffix: "/"
scmid: default

actions:
default:
Expand Down
8 changes: 8 additions & 0 deletions updatecli/updatecli.d/python3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ targets:
file: "provisioning/tools-versions.yml"
key: "$.python3_version"
scmid: default
updatePackerVersionInGoss:
name: Update the `python3` version in the goss test
kind: yaml
spec:
files:
- "goss/goss-windows.yaml" #fixed only on windows
key: $.command.python3.stdout[0]
scmid: default

actions:
default:
Expand Down
4 changes: 3 additions & 1 deletion updatecli/updatecli.d/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ targets:
name: "Update the `TERRAFORM` version in the goss test"
kind: yaml
spec:
file: goss/goss-linux.yaml
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
key: $.command.terraform.stdout[0]
scmid: default

Expand Down
Loading

0 comments on commit 6cb492c

Please sign in to comment.