From 8b43210a26b098721c2bbcb0eb0a8d463d97b29a Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 3 Jun 2023 22:35:11 -0400 Subject: [PATCH] Add Ubuntu 22.04 image --- .drone.yml | 23 +++++++- ubuntu/ubuntu-22.04-amd64.json | 97 ++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 ubuntu/ubuntu-22.04-amd64.json diff --git a/.drone.yml b/.drone.yml index 6d7648a..25a247d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ kind: pipeline type: exec -name: packer-ubuntu +name: packer-ubuntu20.04 platform: os: linux @@ -21,6 +21,27 @@ steps: --- kind: pipeline type: exec +name: packer-ubuntu22.04 + +platform: + os: linux + arch: amd64 + +steps: + - name: ubuntu + commands: + - packer build ubuntu/ubuntu-22.04-amd64.json + - wget -O mc https://dl.min.io/client/mc/release/linux-amd64/mc && chmod +x mc + - ./mc mirror --overwrite builds/ STORAGE/$MC_BUCKET/ubuntu + - rm -f mc + environment: + MC_HOST_STORAGE: + from_secret: s3_url + MC_BUCKET: + from_secret: s3_bucket +--- +kind: pipeline +type: exec name: packer-debian platform: diff --git a/ubuntu/ubuntu-22.04-amd64.json b/ubuntu/ubuntu-22.04-amd64.json new file mode 100644 index 0000000..8b6687c --- /dev/null +++ b/ubuntu/ubuntu-22.04-amd64.json @@ -0,0 +1,97 @@ +{ + "builders": [ + { + "boot_command": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "c", + "set gfxpayload=keep", + "linux /casper/vmlinuz ", + "autoinstall quiet fsck.mode=skip ", + "net.ifnames=0 biosdevname=0 systemd.unified_cgroup_hierarchy=0 ", + "ds=\"nocloud-net;s=http://{{.HTTPIP}}:{{.HTTPPort}}/\" ", + "---", + "initrd /casper/initrd", + "boot" + ], + "boot_wait": "1s", + "cpus": "{{ user `cpus` }}", + "disk_size": "{{user `disk_size`}}", + "headless": "{{ user `headless` }}", + "http_directory": "{{user `http_directory`}}", + "iso_checksum": "{{user `iso_checksum`}}", + "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}", + "memory": "{{ user `memory` }}", + "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-qemu", + "shutdown_command": "echo 'ubuntu' | sudo -S shutdown -P now", + "ssh_password": "ubuntu", + "ssh_port": 22, + "ssh_timeout": "10000s", + "ssh_username": "ubuntu", + "type": "qemu", + "vm_name": "{{ user `template` }}", + "vnc_bind_address": "{{ user `vnc_bind_address` }}", + "qemuargs": [ + [ "-m", "{{ user `memory` }}" ], + [ "-display", "{{ user `qemu_display` }}" ] + ] + } + ], + "post-processors": [ + { + "type": "compress", + "output": "{{ user `build_directory` }}/{{user `box_basename`}}.img.gz" + } + ], + "provisioners": [ + { + "environment_vars": [ + "HOME_DIR=/home/ubuntu", + "http_proxy={{user `http_proxy`}}", + "https_proxy={{user `https_proxy`}}", + "no_proxy={{user `no_proxy`}}" + ], + "execute_command": "echo 'ubuntu' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'", + "expect_disconnect": true, + "scripts": [ + "{{template_dir}}/scripts/update.sh", + "{{template_dir}}/scripts/networking.sh", + "{{template_dir}}/scripts/cleanup.sh", + "{{template_dir}}/../common/minimize.sh" + ], + "type": "shell" + } + ], + "variables": { + "box_basename": "ubuntu-22.04", + "build_directory": "builds", + "build_timestamp": "{{isotime \"20060102150405\"}}", + "cpus": "2", + "disk_size": "65536", + "guest_additions_url": "", + "headless": "", + "http_directory": "{{template_dir}}/http", + "http_proxy": "{{env `http_proxy`}}", + "https_proxy": "{{env `https_proxy`}}", + "iso_checksum": "5e38b55d57d94ff029719342357325ed3bda38fa80054f9330dc789cd2d43931", + "iso_name": "ubuntu-22.04.2-live-server-amd64.iso", + "memory": "2048", + "mirror": "http://releases.ubuntu.com", + "mirror_directory": "22.04.2", + "name": "ubuntu-22.04-amd64", + "no_proxy": "{{env `no_proxy`}}", + "preseed_path": "preseed.cfg", + "qemu_display": "none", + "template": "ubuntu-22.04-amd64.img", + "version": "TIMESTAMP", + "vnc_bind_address": "127.0.0.1" + } +}