Skip to content

Commit

Permalink
wip: use goss tests for windows
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
  • Loading branch information
dduportal committed Sep 26, 2023
1 parent a63f97c commit b3da3b1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 55 deletions.
2 changes: 1 addition & 1 deletion build-jenkins-agent-windows.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ build {
provisioner "powershell" {
inline = [
"& goss.exe --version",
"& goss.exe --gossfile C:/goss-windows.yaml validate --retry-timeout 5s",
"& goss.exe --use-alpha=1 --gossfile C:/goss-windows.yaml validate --retry-timeout 5s",
"& Remove-Item -Force C:/goss-windows.yaml",
]
}
Expand Down
65 changes: 31 additions & 34 deletions goss/goss-windows.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
command:
default_jave:
default_java:
exec: java --version
exit-status: 0
stdout:
- "11.0.20.1+1"
java8:
exec: C:\tools\jdk-8\bin\java.exe -version
exit-status: 0
stderr:
- 1.8.0_382
java11:
exec: C:\tools\jdk-11\bin\java.exe --version
exit-status: 0
stdout:
- 11.0.20.1+1
java17:
exec: C:\tools\jdk-17\bin\java.exe --version
exit-status: 0
stdout:
- 17.0.8.1+1
# /opt/jdk-11/bin/java --version:
# exit-status: 0
# stdout:
# - 11.0.20.1+1
# stderr: []
# /opt/jdk-17/bin/java --version:
# exit-status: 0
# stdout:
# - 17.0.8.1+1
# stderr: []
# /opt/jdk-19/bin/java --version:
# exit-status: 0
# stdout:
# - 19.0.2+7
# stderr: []
# /opt/jdk-21/bin/java --version:
# exit-status: 0
# stdout:
# - 21-beta
# stderr: []
# trivy:
# exec: /usr/local/bin/trivy --version
# exit-status: 0
# stdout:
# - 0.45.1
# file:
# /home/jenkins:
# exists: true
# mode: "0750"
# owner: jenkins
# group: jenkins
# filetype: directory
# contains: []
java19:
exec: C:\tools\jdk-19\bin\java.exe --version
exit-status: 0
stdout:
- 19.0.2+7
java21:
exec: C:\tools\jdk-21\bin\java.exe --version
exit-status: 0
stdout:
- 21-beta
trivy:
exec: trivy.exe --version
exit-status: 0
stdout:
- 0.45.1
20 changes: 0 additions & 20 deletions provisioning/windows-provision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ $downloads = [ordered]@{
& Move-Item -Path "$baseDir\jdk-11*" -Destination "$baseDir\jdk-11"
};
'cleanupLocal' = 'true';
# folder included here since it's not in the PATH
'sanityCheck'= {
& "$baseDir\jdk-11\bin\java.exe" -version;
}
};
'jdk17' = @{
'url' = 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-{0}/OpenJDK17U-jdk_x64_windows_hotspot_{1}.zip' -f [System.Web.HTTPUtility]::UrlEncode($env:JDK17_VERSION),$env:JDK17_VERSION.Replace('+', '_');
Expand All @@ -105,10 +101,6 @@ $downloads = [ordered]@{
& Move-Item -Path "$baseDir\jdk-17*" -Destination "$baseDir\jdk-17"
};
'cleanupLocal' = 'true';
# folder included here since it's not in the PATH
'sanityCheck'= {
& "$baseDir\jdk-17\bin\java.exe" -version;
}
};
'jdk19' = @{
'url' = 'https://github.com/adoptium/temurin19-binaries/releases/download/jdk-{0}/OpenJDK19U-jdk_x64_windows_hotspot_{1}.zip' -f [System.Web.HTTPUtility]::UrlEncode($env:JDK19_VERSION),$env:JDK19_VERSION.Replace('+', '_');
Expand All @@ -118,10 +110,6 @@ $downloads = [ordered]@{
& Move-Item -Path "$baseDir\jdk-19*" -Destination "$baseDir\jdk-19"
};
'cleanupLocal' = 'true';
# folder included here since it's not in the PATH
'sanityCheck'= {
& "$baseDir\jdk-19\bin\java.exe" -version;
}
};
'jdk21' = @{
'url' = 'https://github.com/adoptium/temurin21-binaries/releases/download/jdk-{0}/OpenJDK21U-jdk_x64_windows_hotspot_ea_21-0-{1}.zip' -f [System.Web.HTTPUtility]::UrlEncode($env:JDK21_VERSION),$env:JDK21_VERSION.Split('[+-]')[1];
Expand All @@ -131,10 +119,6 @@ $downloads = [ordered]@{
& Move-Item -Path "$baseDir\jdk-21*" -Destination "$baseDir\jdk-21"
};
'cleanupLocal' = 'true';
# folder included here since it's not in the PATH
'sanityCheck'= {
& "$baseDir\jdk-21\bin\java.exe" -version;
}
};
'jdk8' = @{
'url' = 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk{0}/OpenJDK8U-jdk_x64_windows_hotspot_{1}.zip' -f $env:JDK8_VERSION,$env:JDK8_VERSION.Replace('-', '');
Expand All @@ -144,10 +128,6 @@ $downloads = [ordered]@{
& Move-Item -Path "$baseDir\jdk8*" -Destination "$baseDir\jdk-8"
};
'cleanupLocal' = 'true';
# folder included here since it's not in the PATH
'sanityCheck'= {
& "$baseDir\jdk-8\bin\java.exe" -version;
}
}
'maven' = @{
'url' = 'https://archive.apache.org/dist/maven/maven-3/{0}/binaries/apache-maven-{0}-bin.zip' -f $env:MAVEN_VERSION;
Expand Down

0 comments on commit b3da3b1

Please sign in to comment.