Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(updatecli/goss): change yaml engine to comply with goss templating on goss-windows and improve goss test #1170

Merged
merged 20 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions build-jenkins-agent-windows.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,20 @@ build {
inline = [
"$ErrorActionPreference = 'Stop'",
"goss --version",
"goss --use-alpha=1 --gossfile C:/goss-windows.yaml --loglevel DEBUG validate --retry-timeout 300s",
"goss --use-alpha=1 --gossfile C:/goss-common.yaml --loglevel DEBUG validate --retry-timeout 300s",
"goss --use-alpha=1 --gossfile C:/goss-windows.yaml --loglevel DEBUG validate --retry-timeout 60s",
]
}

provisioner "powershell" {
environment_vars = local.provisioning_env_vars
inline = [
"goss --use-alpha=1 --gossfile C:/goss-common.yaml --loglevel DEBUG validate --retry-timeout 60s",
]
}

provisioner "powershell" {
environment_vars = local.provisioning_env_vars
inline = [
"Remove-Item -Force C:/goss-windows.yaml",
"Remove-Item -Force C:/goss-common.yaml",
"Remove-Item -Force C:/visualstudio.vsconfig",
Expand Down
5 changes: 2 additions & 3 deletions goss/goss-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ command:
stdout:
- 2.4.1
visualstudio:
exec: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe -nologo -version
exec: ("C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe" "/nologo" "/version")
exit-status: 0
stdout:
- /16\.\d+\.\d+\.\d+/
skip: |
{{ not (eq .Env.AGENT_OS_VERSION "2019") }}
skip: {{ not (eq .Env.AGENT_OS_VERSION "2019") }}
file:
C:\Program Files\Chromium\Application\:
contains: []
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/jdk11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ targets:
name: Update the JDK11 version in the goss test
kind: yaml
spec:
engine: "yamlpath"
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/jdk17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ targets:
name: Update the JDK17 version in the goss test
kind: yaml
spec:
engine: "yamlpath"
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/jdk21.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ targets:
name: Update the JDK21 version in the goss test
kind: yaml
spec:
engine: "yamlpath"
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/jdk8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ targets:
captureindex: 1
- addprefix: '1.8.0_'
spec:
engine: "yamlpath"
files:
- goss/goss-linux.yaml
- goss/goss-windows.yaml
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/nodejs-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ targets:
sourceid: lastReleaseVersion
kind: yaml
spec:
engine: "yamlpath"
files:
- goss/goss-windows.yaml
key: $.command.nodejs.stdout[0]
Expand Down
3 changes: 2 additions & 1 deletion updatecli/updatecli.d/pwsh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ targets:
kind: yaml
spec:
file: "provisioning/tools-versions.yml"
key: "windows_pwsh_version"
key: $.windows_pwsh_version
scmid: default
updatePwshVersionInGoss:
name: Update the `Pwsh` version in the goss test
kind: yaml
spec:
engine: "yamlpath"
files:
- "goss/goss-windows.yaml"
key: $.command.pwsh.stdout[0]
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/python3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ targets:
name: Update the `python3` version in the goss test
kind: yaml
spec:
engine: "yamlpath"
files:
- "goss/goss-windows.yaml" #fixed only on windows
key: $.command.python3.stdout[0]
Expand Down
3 changes: 2 additions & 1 deletion updatecli/updatecli.d/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sources:
name: "Get the latest Ruby version"
spec:
image: "ruby"
tagFilter: >-
tagfilter: >-
\d\.\d\.\d$
versionfilter:
kind: regex
Expand Down Expand Up @@ -58,6 +58,7 @@ targets:
sourceid: rubyDockerImageLatestVersion
kind: yaml
spec:
engine: "yamlpath"
files:
- goss/goss-windows.yaml
key: $.command.ruby.stdout[0]
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ targets:
name: "Update the `vagrant` version in the goss test"
kind: yaml
spec:
engine: "yamlpath"
files:
- goss/goss-windows.yaml # windows only as the linux arm64 vagrant version is not pinned
key: $.command.vagrant.stdout[0]
Expand Down