Skip to content

Commit

Permalink
wip: feat: add Windows Server 2022
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Duportal <[email protected]>
  • Loading branch information
dduportal committed May 8, 2022
1 parent 91e50cd commit fdf44f1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
12 changes: 11 additions & 1 deletion Jenkinsfile_k8s
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pipeline {
}
axis {
name 'agent_type'
values 'ubuntu-20.04', 'windows-2019'
values 'ubuntu-20.04', 'windows-2019', 'windows-2022'
}
axis {
name 'compute_type'
Expand Down Expand Up @@ -133,6 +133,16 @@ pipeline {
values 'docker'
}
}
exclude {
axis {
name 'PKR_VAR_agent'
values 'windows-2022'
}
axis {
name 'PKR_VAR_image_type'
values 'docker'
}
}
}
agent {
// Temporary forcing exception for windows/docker which is not finished yet
Expand Down
2 changes: 1 addition & 1 deletion build-jenkins-agent-ubuntu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build {
name = "ubuntu"
image_offer = "0001-com-ubuntu-server-focal"
image_publisher = "canonical"
image_sku = "${local.agent_os_version_safe}-lts-gen2"
image_sku = local.azure_sku[local.agent]
os_type = "Linux"
vm_size = local.azure_vm_size
}
Expand Down
2 changes: 1 addition & 1 deletion build-jenkins-agent-windows.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build {
communicator = "winrm"
image_offer = "WindowsServer"
image_publisher = "MicrosoftWindowsServer"
image_sku = "${var.agent_os_version}-datacenter-core-with-containers-smalldisk-g2"
image_sku = local.azure_sku[local.agent]
vm_size = local.azure_vm_size
os_type = "Windows"
os_disk_size_gb = local.windows_disk_size_gb
Expand Down
11 changes: 11 additions & 0 deletions datasources.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,14 @@ data "amazon-ami" "windows-2019" {
owners = ["amazon"]
region = var.aws_region
}

data "amazon-ami" "windows-2022" {
filters = {
name = "Windows_Server-2022-English-Core-ContainersLatest-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["amazon"]
region = var.aws_region
}
5 changes: 5 additions & 0 deletions locals.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ locals {
"amazon-ebs" = "Administrator" # In AWS EC2, WinRM super admin must be the "Administrator" account
"docker" = "packer"
}
azure_sku = {
"windows-2019" = "2019-datacenter-core-with-containers-smalldisk-g2"
"windows-2022" = "2022-Datacenter"
"ubuntu-20.04" = "20_04-lts-gen2"
}
azure_vm_size = "Standard_D4s_v3" # Huge size requires - avoid https:#docs.microsoft.com/en-us/azure/virtual-machines/linux/image-builder-troubleshoot#sysprep-timing and avoid full disk (DS2v2 only have 14 Gb SSD for system)
azure_resource_group = "${var.build_type}-packer-images"
azure_galleries = {
Expand Down

0 comments on commit fdf44f1

Please sign in to comment.