Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris committed Sep 10, 2024
1 parent d34ce24 commit e0f476f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup `packer`
uses: hashicorp/setup-packer@main
uses: hashicorp/setup-packer@v1
id: setup
# - name: Setup arm packer prerequisites
# run: |
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install fdisk gdisk qemu-user-static libarchive-tools tar parted qemu-utils squashfs-tools -y
sudo apt-get install tree fdisk gdisk qemu-user-static libarchive-tools psmisc tar autoconf make qemu-utils zip
shell: bash

# Install packer arm plugin
Expand All @@ -44,11 +44,15 @@ jobs:
- name: init example image
run: |
cp plugin/packer-builder-arm .
packer init plugin/boards/raspberry-pi-4/ubuntu_server_20.04_arm64.pkr.hcl
packer build plugin/boards/raspberry-pi-4/ubuntu_server_20.04_arm64.pkr.hcl
sudo packer build packer_test.json
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ubuntu-20.04.img

- name: List dir
run: |
pwd
ls -la
shell: bash
# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: ubuntu-20.04.img
50 changes: 50 additions & 0 deletions packer_test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"variables": {
"apt_packages": "software-properties-common apt-transport-https ca-certificates openssl ufw curl docker-compose"
},
"builders": [
{
"type": "arm",
"file_urls": [
"https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2022-09-26/2022-09-22-raspios-bullseye-arm64-lite.img.xz"
],
"file_checksum_url": "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2022-09-26/2022-09-22-raspios-bullseye-arm64-lite.img.xz.sha256",
"file_unarchive_cmd": ["xz", "-d", "$ARCHIVE_PATH"],
"file_checksum_type": "sha256",
"file_target_extension": "xz",
"image_build_method": "resize",
"image_path": "grampsweb-2022-09-22-raspios-bullseye-arm64-lite.img",
"image_size": "2G",
"image_type": "dos",
"image_partitions": [
{
"name": "boot",
"type": "c",
"start_sector": "8192",
"filesystem": "vfat",
"size": "256M",
"mountpoint": "/boot"
},
{
"name": "root",
"type": "83",
"start_sector": "532480",
"filesystem": "ext4",
"size": "0",
"mountpoint": "/"
}
],
"image_chroot_env": [
"PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
],
"qemu_binary_source_path": "/usr/bin/qemu-arm-static",
"qemu_binary_destination_path": "/usr/bin/qemu-arm-static"
}
],
"provisioners": [
{
"type": "shell",
"inline": ["touch /boot/ssh"]
}
]
}

0 comments on commit e0f476f

Please sign in to comment.