mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-03-17 13:21:44 +01:00
ci: create amd64 img disk image
This commit is contained in:
parent
61766d8bea
commit
a77dd4d5a6
16
.github/workflows/amd64-lean-image.yml
vendored
16
.github/workflows/amd64-lean-image.yml
vendored
@ -60,30 +60,30 @@ jobs:
|
||||
|
||||
- name: Run the build script
|
||||
run: |
|
||||
echo "Using the variables: --pack lean --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome"
|
||||
echo "Using the variables: --pack lean --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome --image_type raw"
|
||||
cd ci/amd64
|
||||
bash packer.build.amd64-debian.sh --pack lean --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome
|
||||
bash packer.build.amd64-debian.sh --pack lean --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome --image_type raw
|
||||
|
||||
- name: Compute checksum of the raw image
|
||||
run: |
|
||||
cd ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu
|
||||
sha256sum raspiblitz-amd64-debian-lean.qcow2 > raspiblitz-amd64-debian-lean.qcow2.sha256
|
||||
sha256sum raspiblitz-amd64-debian-lean.img > raspiblitz-amd64-debian-lean.img.sha256
|
||||
|
||||
- name: Compress image
|
||||
run: |
|
||||
cd ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu
|
||||
gzip -v9 raspiblitz-amd64-debian-lean.qcow2
|
||||
gzip -v9 raspiblitz-amd64-debian-lean.img
|
||||
|
||||
- name: Compute checksum of the compressed image
|
||||
run: |
|
||||
cd ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu
|
||||
sha256sum raspiblitz-amd64-debian-lean.qcow2.gz > raspiblitz-amd64-debian-lean.qcow2.gz.sha256
|
||||
sha256sum raspiblitz-amd64-debian-lean.img.gz > raspiblitz-amd64-debian-lean.img.gz.sha256
|
||||
|
||||
- name: Upload the image and checksums
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: raspiblitz-amd64-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}
|
||||
path: |
|
||||
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.sha256
|
||||
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.gz
|
||||
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.gz.sha256
|
||||
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.img.sha256
|
||||
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.img.gz
|
||||
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.img.gz.sha256
|
||||
|
27
Makefile
27
Makefile
@ -28,6 +28,33 @@ amd64-lean-desktop-uefi-image:
|
||||
# List the generated files
|
||||
ls -lah ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.*
|
||||
|
||||
amd64-lean-desktop-uefi-img:
|
||||
# Run the build script
|
||||
cd ci/amd64 && \
|
||||
sudo bash packer.build.amd64-debian.sh \
|
||||
--pack lean \
|
||||
--github_user $(GITHUB_ACTOR) \
|
||||
--branch $(GITHUB_HEAD_REF) \
|
||||
--preseed_file preseed.cfg \
|
||||
--boot uefi \
|
||||
--desktop gnome \
|
||||
--image_type raw
|
||||
|
||||
# Compute the checksum of the qemu image
|
||||
cd ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu && \
|
||||
sha256sum raspiblitz-amd64-debian-lean.img > raspiblitz-amd64-debian-lean.img.sha256
|
||||
|
||||
# Compress the image
|
||||
cd ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu && \
|
||||
gzip -v9 raspiblitz-amd64-debian-lean.img
|
||||
|
||||
# Compute the checksum of the compressed image
|
||||
cd ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu && \
|
||||
sha256sum raspiblitz-amd64-debian-lean.img.gz > raspiblitz-amd64-debian-lean.img.gz.sha256
|
||||
|
||||
# List the generated files
|
||||
ls -lah ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.img.*
|
||||
|
||||
amd64-lean-server-legacyboot-image:
|
||||
# Run the build script
|
||||
cd ci/amd64 && \
|
||||
|
@ -10,12 +10,15 @@ variable "boot" { default = "uefi" }
|
||||
variable "preseed_file" { default = "preseed.cfg" }
|
||||
variable "hostname" { default = "raspiblitz-amd64" }
|
||||
|
||||
variable "disk_size" { default = "27000" }
|
||||
variable "image_size" { default = "27000" }
|
||||
variable "image_type" { default = "qcow2" }
|
||||
|
||||
variable "memory" { default = "4096" }
|
||||
variable "cpus" { default = "4" }
|
||||
|
||||
locals {
|
||||
name_template = "${var.hostname}-debian-${var.pack}"
|
||||
image_extension = var.image_type == "raw" ? "img" : var.image_type
|
||||
bios_file = var.boot == "uefi" ? "OVMF.fd" : "bios-256k.bin"
|
||||
boot_command = var.boot == "uefi" ? [
|
||||
"<wait><wait><wait>c<wait><wait><wait>",
|
||||
@ -51,7 +54,7 @@ source "qemu" "debian" {
|
||||
boot_command = local.boot_command
|
||||
boot_wait = "5s"
|
||||
cpus = var.cpus
|
||||
disk_size = var.disk_size
|
||||
disk_size = var.image_size
|
||||
http_directory = "./http"
|
||||
iso_checksum = var.iso_checksum
|
||||
iso_url = "https://cdimage.debian.org/cdimage/release/current/amd64/iso-cd/${var.iso_name}"
|
||||
@ -62,8 +65,8 @@ source "qemu" "debian" {
|
||||
ssh_port = 22
|
||||
ssh_timeout = "10000s"
|
||||
ssh_username = "pi"
|
||||
format = "qcow2"
|
||||
vm_name = "${local.name_template}.qcow2"
|
||||
format = var.image_type
|
||||
vm_name = "${local.name_template}.${local.image_extension}"
|
||||
headless = false
|
||||
vnc_bind_address = "127.0.0.1"
|
||||
vnc_port_max = 5900
|
||||
|
@ -27,7 +27,7 @@ set_variables "$@"
|
||||
echo "# Build the image ..."
|
||||
cd debian
|
||||
packer init -upgrade .
|
||||
command="PACKER_LOG=1 packer build ${vars} -only=qemu packer.build.amd64-debian.hcl"
|
||||
command="PACKER_LOG=1 packer build ${vars} -only=qemu.debian packer.build.amd64-debian.hcl"
|
||||
echo "# Running: $command"
|
||||
if [ ${#vars} -eq 0 ];then exit 1;fi
|
||||
PACKER_LOG=1 packer build ${vars} -only=qemu.debian build.amd64-debian.pkr.hcl || exit 1
|
||||
|
@ -49,6 +49,11 @@ function set_variables() {
|
||||
params[image_size]="$2"
|
||||
shift 2
|
||||
;;
|
||||
# qcow2 | raw
|
||||
--image_type)
|
||||
params[image_type]="$2"
|
||||
shift 2
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
|
Loading…
x
Reference in New Issue
Block a user