Skip to content

Commit

Permalink
windows-server/msibuild: Add gcloud CLI and jsign.jar
Browse files Browse the repository at this point in the history
To allow us to use jsign with GoogleCloud KMS.

While here update instance specs to current
generation.

Signed-off-by: Frank Lichtenheld <[email protected]>
  • Loading branch information
flichtenheld committed Aug 8, 2024
1 parent b4b94fb commit 1b58584
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
2 changes: 2 additions & 0 deletions jenkins/windows-server/build/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ administrators_authorized_keys
build-and-package-env.ps1
customerCA.crt
signingCert.p7b
signingCert.pem
clientLibraryConfig.json
7 changes: 5 additions & 2 deletions jenkins/windows-server/msibuild.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
build {
source "amazon-ebs.windows-server-2019" {
name = "msibuild-windows-server-2019-2.5"
ami_name = "msibuild-windows-server-2019-2.5-4"
ami_name = "msibuild-windows-server-2019-2.5-5"
}
source "amazon-ebs.windows-server-2022" {
name = "msibuild-windows-server-2022-2.6"
ami_name = "msibuild-windows-server-2022-2.6-5"
ami_name = "msibuild-windows-server-2022-2.6-6"
}

provisioner "file" {
Expand Down Expand Up @@ -61,4 +61,7 @@ build {
provisioner "powershell" {
inline = ["C:/Windows/Temp/scripts/aws-cloudhsm.ps1 -configfiles C:\\config -workdir C:\\buildbot\\msbuild"]
}
provisioner "powershell" {
inline = ["C:/Windows/Temp/scripts/jsign.ps1 -configfiles C:\\config -workdir C:\\buildbot\\msbuild"]
}
}
8 changes: 4 additions & 4 deletions jenkins/windows-server/shared.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ variable "run_tags" {
source "amazon-ebs" "windows-server-2019" {
communicator = "winrm"
force_deregister = true
instance_type = "c5a.xlarge"
instance_type = "c6a.xlarge"
iam_instance_profile = var.windows_server_instance_profile
region = var.windows_server_ec2_region
subnet_id = var.windows_server_ec2_subnet

launch_block_device_mappings {
device_name = "/dev/sda1"
volume_size = 80
volume_type = "gp2"
volume_type = "gp3"
delete_on_termination = true
}

Expand Down Expand Up @@ -88,15 +88,15 @@ source "amazon-ebs" "windows-server-2019" {
source "amazon-ebs" "windows-server-2022" {
communicator = "winrm"
force_deregister = true
instance_type = "c5a.xlarge"
instance_type = "c6a.xlarge"
iam_instance_profile = var.windows_server_instance_profile
region = var.windows_server_ec2_region
subnet_id = var.windows_server_ec2_subnet

launch_block_device_mappings {
device_name = "/dev/sda1"
volume_size = 80
volume_type = "gp2"
volume_type = "gp3"
delete_on_termination = true
}

Expand Down
19 changes: 19 additions & 0 deletions scripts/jsign.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
param ([string] $workdir,
[string] $configfiles)

. C:\Windows\Temp\scripts\ps_support.ps1

Write-Host "Setting up gcloud and jsign"

& choco.exe install -y openjdk17
CheckLastExitCode

Invoke-WebRequest -Uri "https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe" -Outfile "C:\Windows\Temp\GoogleCloudSDKInstaller.exe"

& "C:\Windows\Temp\GoogleCloudSDKInstaller.exe" /S /allusers
CheckLastExitCode

Invoke-WebRequest -Uri "https://github.com/ebourg/jsign/releases/download/6.0/jsign-6.0.jar" -Outfile "${workdir}/jsign.jar"

Copy-Item "${configfiles}\signingCert.pem" "${workdir}" -Force
Copy-Item "${configfiles}\clientLibraryConfig.json" "${workdir}" -Force

0 comments on commit 1b58584

Please sign in to comment.