diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index f269fec82..76a1733bd 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -10,98 +10,43 @@ concurrency: cancel-in-progress: true jobs: -# markdown-lint: -# uses: chef/github-workflows/.github/workflows/markdown-lint.yml@main -# -# markdown-link-checker: -# uses: chef/github-workflows/.github/workflows/markdown-link-checker.yml@main - - yaml-lint: - uses: chef/github-workflows/.github/workflows/yaml-lint.yml@main - - json-lint: - uses: chef/github-workflows/.github/workflows/json-lint.yml@main - - xml-lint: - uses: chef/github-workflows/.github/workflows/xml-lint.yml@main - - shellcheck-lint: - uses: chef/github-workflows/.github/workflows/shellcheck-lint.yml@main - - powershell-lint: - uses: chef/github-workflows/.github/workflows/powershell-lint.yml@main - - packer-iso-check: - uses: chef/github-workflows/.github/workflows/packer-iso-url-checker.yml@main - with: - EXCLUDE_REGEX: 'amazonlinux-2.*|rhel.*|sles.*|solaris.*|macos-.*' - -# packer-lint: -# uses: chef/github-workflows/.github/workflows/packer-lint.yml@main -# secrets: inherit - - pkr-bld-amazonlinux-arm64: - uses: ./.github/workflows/pkr-bld-amazonlinux-arm64.yml - secrets: inherit - - pkr-bld-amazonlinux-x64: - uses: ./.github/workflows/pkr-bld-amazonlinux-x64.yml + ci-lint: + uses: ./.github/workflows/ci-lint.yml secrets: inherit - pkr-bld-hyperv-x64: - uses: ./.github/workflows/pkr-bld-hyperv-x64.yml + pkr-bld-amazonlinux: + uses: ./.github/workflows/pkr-bld-amazonlinux.yml secrets: inherit - pkr-bld-parallels-arm64: - uses: ./.github/workflows/pkr-bld-parallels-arm64.yml + pkr-bld-hyperv: + uses: ./.github/workflows/pkr-bld-hyperv.yml secrets: inherit - pkr-bld-parallels-x64: - uses: ./.github/workflows/pkr-bld-parallels-x64.yml + pkr-bld-parallels: + uses: ./.github/workflows/pkr-bld-parallels.yml secrets: inherit - pkr-bld-qemu-arm64: - uses: ./.github/workflows/pkr-bld-qemu-arm64.yml + pkr-bld-qemu: + uses: ./.github/workflows/pkr-bld-qemu.yml secrets: inherit - pkr-bld-qemu-x64: - uses: ./.github/workflows/pkr-bld-qemu-x64.yml + pkr-bld-utm: + uses: ./.github/workflows/pkr-bld-utm.yml secrets: inherit - pkr-bld-utm-arm64: - uses: ./.github/workflows/pkr-bld-utm-arm64.yml + pkr-bld-virtualbox: + uses: ./.github/workflows/pkr-bld-virtualbox.yml secrets: inherit - pkr-bld-utm-x64: - uses: ./.github/workflows/pkr-bld-utm-x64.yml - secrets: inherit - - pkr-bld-virtualbox-arm64: - uses: ./.github/workflows/pkr-bld-virtualbox-arm64.yml - secrets: inherit - - pkr-bld-virtualbox-x64: - uses: ./.github/workflows/pkr-bld-virtualbox-x64.yml - secrets: inherit - - pkr-bld-vmware-arm64: - uses: ./.github/workflows/pkr-bld-vmware-arm64.yml - secrets: inherit - - pkr-bld-vmware-x64: - uses: ./.github/workflows/pkr-bld-vmware-x64.yml + pkr-bld-vmware: + uses: ./.github/workflows/pkr-bld-vmware.yml secrets: inherit check_jobs_pass: if: always() needs: -# - markdown-lint - - yaml-lint - - json-lint - - xml-lint - - powershell-lint - - shellcheck-lint -# - packer-lint + - ci-lint + runs-on: Ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed @@ -110,7 +55,3 @@ jobs: allowed-failures: allowed-skips: ${{ toJSON(needs) }} jobs: ${{ toJSON(needs) }} - -# pkr-bld-parallels-test: -# uses: ./.github/workflows/test-pkr-bld-parallels.yml -# secrets: inherit diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index ebc84ac24..c3207aaf3 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -1,11 +1,16 @@ --- on: + workflow_call: schedule: - cron: '0 0 * * 0' permissions: contents: read +concurrency: + group: ci-lint-${{ github.ref }} + cancel-in-progress: true + jobs: markdown-lint: uses: chef/github-workflows/.github/workflows/markdown-lint.yml@main @@ -28,19 +33,18 @@ jobs: powershell-lint: uses: chef/github-workflows/.github/workflows/powershell-lint.yml@main - packer-iso-check: - uses: chef/github-workflows/.github/workflows/packer-iso-url-checker.yml@main - - packer-lint: - uses: chef/github-workflows/.github/workflows/packer-lint.yml@main - secrets: inherit - - # Codespell configuration is within .codespellrc codespell: name: Check for spelling errors runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@main - name: Codespell uses: codespell-project/actions-codespell@v2 + + packer-lint: + uses: ./.github/workflows/packer-lint.yml + secrets: inherit + + packer-iso-check: + uses: ./.github/workflows/packer-iso-url-checker.yml diff --git a/.github/workflows/packer-iso-url-checker.yml b/.github/workflows/packer-iso-url-checker.yml new file mode 100644 index 000000000..9b260ae4f --- /dev/null +++ b/.github/workflows/packer-iso-url-checker.yml @@ -0,0 +1,40 @@ +--- +on: + workflow_call: + +jobs: + enumerate_pkrvars: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@main + - name: Enumerate iso + env: + EXCLUDE: 'rhel.*|sles.*|solaris.*' + shell: bash + run: | + mapfile -t < <(find os_pkrvars -name "*.pkrvars.hcl" | grep -Ev '(${{ env.EXCLUDE }})') + echo "matrix=$(jq -cRn '[inputs]' < <( (( ${#MAPFILE[@]} )) && printf '%s\n' "${MAPFILE[@]}"))" >> "$GITHUB_OUTPUT" + id: enumerate_pkrvars + outputs: + matrix: ${{ steps.enumerate_pkrvars.outputs.matrix }} + + iso-availability: + needs: enumerate_pkrvars + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + template: ${{ fromJson(needs.enumerate_pkrvars.outputs.matrix) }} + steps: + - name: Checkout Repository + uses: actions/checkout@main + - name: iso-availability + run: | + iso_url=$(grep -E '^\s*iso_url\s*=' '${{ matrix.template }}' | head -1 | sed 's/[^=]*=\s*"\(.*\)"/\1/') + if [ -z "$iso_url" ]; then + echo "No iso_url found in ${{ matrix.template }}, skipping" + exit 0 + fi + echo "Checking: $iso_url" + curl -fsSI "$iso_url" diff --git a/.github/workflows/packer-lint.yml b/.github/workflows/packer-lint.yml new file mode 100644 index 000000000..69e5eaf3b --- /dev/null +++ b/.github/workflows/packer-lint.yml @@ -0,0 +1,53 @@ +--- +on: + workflow_call: + +jobs: + packer-fmt: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@main + - name: Setup Packer + uses: hashicorp/setup-packer@main + with: + version: latest + - name: Packer FMT + run: if packer fmt -check -recursive .; then exit 0; else echo "Some packer files need to be formatted, run 'packer fmt -recursive .' to fix"; exit 1; fi + + enumerate_pkrvars: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@main + - name: Enumerate pkrvars validation + env: + EXCLUDE: 'windows.*' + shell: bash + run: | + mapfile -t < <(find os_pkrvars -name "*.pkrvars.hcl" | grep -Ev '(${{ env.EXCLUDE }})') + echo "matrix=$(jq -cRn '[inputs]' < <( (( ${#MAPFILE[@]} )) && printf '%s\n' "${MAPFILE[@]}"))" >> "$GITHUB_OUTPUT" + id: enumerate_pkrvars + outputs: + matrix: ${{ steps.enumerate_pkrvars.outputs.matrix }} + + packer-validate: + needs: enumerate_pkrvars + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + pkrvars: ${{ fromJson(needs.enumerate_pkrvars.outputs.matrix) }} + steps: + - name: Checkout Repository + uses: actions/checkout@main + - name: Setup Packer + uses: hashicorp/setup-packer@main + with: + version: latest + - name: Packer Init + env: + PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + run: packer init -upgrade packer_templates + - name: Packer Validate + run: packer validate --evaluate-datasources -var-file="${{ matrix.pkrvars }}" packer_templates diff --git a/.github/workflows/pkr-bld-amazonlinux.yml b/.github/workflows/pkr-bld-amazonlinux.yml new file mode 100644 index 000000000..82200d611 --- /dev/null +++ b/.github/workflows/pkr-bld-amazonlinux.yml @@ -0,0 +1,115 @@ +--- +on: + workflow_call: + +permissions: + contents: read + +env: + PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + # PACKER_LOG: "1" + +jobs: + x86_64: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: + - amazonlinux-2023 + steps: + - name: Install Vagrant and VirtualBox + run: | + wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg + wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor | sudo tee /usr/share/keyrings/oracle-virtualbox-2016.gpg + echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list + echo "deb [signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list + sudo apt-get update + sudo apt-get install -y software-properties-common vagrant virtualbox-7.1 qemu-utils genisoimage + VBoxManage --version + vagrant --version + - name: Install Chef + uses: actionshub/chef-install@3.0.0 + - name: Setup Packer + uses: hashicorp/setup-packer@main + with: + version: latest + - name: Checkout + uses: actions/checkout@main + - name: Install Bento + run: | + eval "$(chef shell-init bash)" + gem build bento.gemspec + gem install bento-*.gem + - name: Bento build + run: | + rm -rf builds + sudo mkdir -p /mnt/builds/iso + sudo mkdir -p /mnt/builds/build_complete + sudo chmod -R 777 /mnt/builds + sudo ln -s /mnt/builds ./ + eval "$(chef shell-init bash)" + ./${{ matrix.os }}-x86_64-virtualbox-build.sh + ls -alh builds/build_complete + cat builds/build_complete/${{ matrix.os }}*-x86_64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(VBoxManage list vms | grep '${{ matrix.os }}' | awk -F'"' '{print $2}')" + echo "VM Name: $VM" + VBoxManage controlvm "$VM" poweroff 2>/dev/null || true + sleep 2 + VBoxManage unregistervm "$VM" --delete 2>/dev/null || true + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-virtualbox-x86_64" + path: | + builds/testing_passed/x86_64/*.box + builds/testing_passed/x86_64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression + + aarch64: + runs-on: [self-hosted, ARM64, virtualbox] + strategy: + fail-fast: false + matrix: + os: + - amazonlinux-2023 + steps: + - name: Checkout + uses: actions/checkout@main + - name: Bento build + run: | + eval "$(chef shell-init bash)" + ./${{ matrix.os }}-aarch64-virtualbox-build.sh + ls -alh builds/build_complete + cat builds/build_complete/${{ matrix.os }}*-aarch64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(VBoxManage list vms | grep '${{ matrix.os }}' | awk -F'"' '{print $2}')" + echo "VM Name: $VM" + VBoxManage controlvm "$VM" poweroff 2>/dev/null || true + sleep 2 + VBoxManage unregistervm "$VM" --delete 2>/dev/null || true + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-virtualbox-aarch64" + path: | + builds/testing_passed/aarch64/*.box + builds/testing_passed/aarch64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression diff --git a/.github/workflows/pkr-bld-hyperv-x64.yml b/.github/workflows/pkr-bld-hyperv-x64.yml index 82c57b602..5c4aedd17 100644 --- a/.github/workflows/pkr-bld-hyperv-x64.yml +++ b/.github/workflows/pkr-bld-hyperv-x64.yml @@ -23,12 +23,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - fedora-43 - - freebsd-13 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-8 - oraclelinux-9 @@ -38,8 +36,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - hyperv-iso diff --git a/.github/workflows/pkr-bld-hyperv.yml b/.github/workflows/pkr-bld-hyperv.yml new file mode 100644 index 000000000..26cdc2e2c --- /dev/null +++ b/.github/workflows/pkr-bld-hyperv.yml @@ -0,0 +1,85 @@ +--- +on: + workflow_call: + +permissions: + contents: read + +env: + PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + # PACKER_LOG: "1" + +jobs: + generate-matrix: + # Hyper-V is x86_64 only + runs-on: ubuntu-latest + outputs: + x64_oses: ${{ steps.set-matrix.outputs.x64_oses }} + steps: + - name: Checkout + uses: actions/checkout@main + - name: Set matrix + id: set-matrix + run: | + X64=$(ruby -r yaml -r json -e "puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') }.to_json") + echo "x64_oses=${X64}" >> "$GITHUB_OUTPUT" + + x86_64: + needs: generate-matrix + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.x64_oses) }} + provider: + - hyperv-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: Install Chef + uses: actionshub/chef-install@3.0.0 + - name: Setup Packer + uses: hashicorp/setup-packer@main + with: + version: latest + - name: Install Bento + run: | + chef shell-init powershell + gem build bento.gemspec + gem install bento-*.gem + - name: Create VM Switch for Hyper-V + shell: pwsh + run: | + Get-PsDrive -PsProvider FileSystem + pwd + $adapter = (Get-NetAdapter | Where-Object { $_.Status -eq "Up" })[0].Name + New-VMSwitch -Name "bento" -NetAdapterName $adapter -AllowManagementOS $true + - name: Packer Init + run: packer init -upgrade packer_templates + - name: Packer build + run: packer build -timestamp-ui -only="${{ matrix.provider }}.vm" -var 'sources_enabled=["hyperv-iso.vm"]' -var-file="os_pkrvars/$("${{ matrix.os }}".Split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates + - name: Remove VM in case of canceled job + if: cancelled() + shell: pwsh + run: | + $vm = Get-VM | Where-Object { $_.Name -like "*${{ matrix.os }}*" } | Select-Object -First 1 + if ($vm) { + Write-Host "Stopping and removing VM: $($vm.Name)" + Stop-VM -Name $vm.Name -Force -TurnOff -ErrorAction SilentlyContinue + Start-Sleep -Seconds 2 + Remove-VM -Name $vm.Name -Force -ErrorAction SilentlyContinue + } + - name: Bento Test + run: | + chef shell-init powershell + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-hyperv-x86_64" + path: | + builds/testing_passed/x86_64/*.box + builds/testing_passed/x86_64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression diff --git a/.github/workflows/pkr-bld-parallels-arm64.yml b/.github/workflows/pkr-bld-parallels-arm64.yml index c167bd369..0cc7e0ea0 100644 --- a/.github/workflows/pkr-bld-parallels-arm64.yml +++ b/.github/workflows/pkr-bld-parallels-arm64.yml @@ -22,12 +22,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - fedora-43 - - freebsd-13 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-9 - oraclelinux-10 @@ -35,8 +33,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - parallels-iso diff --git a/.github/workflows/pkr-bld-parallels-x64.yml b/.github/workflows/pkr-bld-parallels-x64.yml index 695b25839..a91905293 100644 --- a/.github/workflows/pkr-bld-parallels-x64.yml +++ b/.github/workflows/pkr-bld-parallels-x64.yml @@ -23,12 +23,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - fedora-43 - - freebsd-13 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-8 - oraclelinux-9 @@ -38,8 +36,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - parallels-iso diff --git a/.github/workflows/pkr-bld-parallels.yml b/.github/workflows/pkr-bld-parallels.yml new file mode 100644 index 000000000..3357c335a --- /dev/null +++ b/.github/workflows/pkr-bld-parallels.yml @@ -0,0 +1,110 @@ +--- +on: + workflow_call: + +permissions: + contents: read + +env: + PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + # PACKER_LOG: "1" + +jobs: + generate-matrix: + runs-on: ubuntu-latest + outputs: + x64_oses: ${{ steps.set-matrix.outputs.x64_oses }} + arm64_oses: ${{ steps.set-matrix.outputs.arm64_oses }} + steps: + - name: Checkout + uses: actions/checkout@main + - name: Set matrix + id: set-matrix + run: | + # arm64 exclusions: no aarch64 pkrvars exist for these OS versions + X64=$(ruby -r yaml -r json -e "puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') }.to_json") + ARM64=$(ruby -r yaml -r json -e "excl=%w[almalinux-8 oraclelinux-8 rockylinux-8]; puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') || excl.include?(o) }.to_json") + echo "x64_oses=${X64}" >> "$GITHUB_OUTPUT" + echo "arm64_oses=${ARM64}" >> "$GITHUB_OUTPUT" + + x86_64: + needs: generate-matrix + runs-on: [self-hosted, X64, parallels] + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.x64_oses) }} + provider: + - parallels-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: Bento build + run: | + eval "$(chef shell-init bash)" + bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" + ls -alh builds/build_complete/ + cat builds/build_complete/${{ matrix.os }}*-x86_64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(prlctl list -a | grep '${{ matrix.os }}' | awk '{print $1}')" + echo "VM UUID: $VM" + prlctl stop "$VM" --kill 2>/dev/null || true + sleep 2 + prlctl delete "$VM" 2>/dev/null || true + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-parallels-x86_64" + path: | + builds/testing_passed/x86_64/*.box + builds/testing_passed/x86_64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression + + aarch64: + needs: generate-matrix + runs-on: [self-hosted, ARM64, parallels] + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.arm64_oses) }} + provider: + - parallels-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: Bento build + run: | + eval "$(chef shell-init bash)" + bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl" + ls -alh builds/build_complete/ + cat builds/build_complete/${{ matrix.os }}*-aarch64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(prlctl list -a | grep '${{ matrix.os }}' | awk '{print $1}')" + echo "VM UUID: $VM" + prlctl stop "$VM" --kill 2>/dev/null || true + sleep 2 + prlctl delete "$VM" 2>/dev/null || true + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-parallels-aarch64" + path: | + builds/testing_passed/aarch64/*.box + builds/testing_passed/aarch64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression diff --git a/.github/workflows/pkr-bld-qemu-arm64.yml b/.github/workflows/pkr-bld-qemu-arm64.yml index 36735a82e..5106a361e 100644 --- a/.github/workflows/pkr-bld-qemu-arm64.yml +++ b/.github/workflows/pkr-bld-qemu-arm64.yml @@ -22,12 +22,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - fedora-43 - - freebsd-13 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-9 - oraclelinux-10 @@ -35,8 +33,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - qemu diff --git a/.github/workflows/pkr-bld-qemu-x64.yml b/.github/workflows/pkr-bld-qemu-x64.yml index 42cb8d5c8..3ca8479b0 100644 --- a/.github/workflows/pkr-bld-qemu-x64.yml +++ b/.github/workflows/pkr-bld-qemu-x64.yml @@ -23,12 +23,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - fedora-43 - - freebsd-13 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-8 - oraclelinux-9 @@ -38,8 +36,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - qemu diff --git a/.github/workflows/pkr-bld-qemu.yml b/.github/workflows/pkr-bld-qemu.yml new file mode 100644 index 000000000..14f2f286f --- /dev/null +++ b/.github/workflows/pkr-bld-qemu.yml @@ -0,0 +1,143 @@ +--- +on: + workflow_call: + +permissions: + contents: read + +env: + PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + # PACKER_LOG: "1" + +jobs: + generate-matrix: + runs-on: ubuntu-latest + outputs: + x64_oses: ${{ steps.set-matrix.outputs.x64_oses }} + arm64_oses: ${{ steps.set-matrix.outputs.arm64_oses }} + steps: + - name: Checkout + uses: actions/checkout@main + - name: Set matrix + id: set-matrix + run: | + # arm64 exclusions: no aarch64 pkrvars exist for these OS versions + X64=$(ruby -r yaml -r json -e "puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') }.to_json") + ARM64=$(ruby -r yaml -r json -e "excl=%w[almalinux-8 oraclelinux-8 rockylinux-8]; puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') || excl.include?(o) }.to_json") + echo "x64_oses=${X64}" >> "$GITHUB_OUTPUT" + echo "arm64_oses=${ARM64}" >> "$GITHUB_OUTPUT" + + x86_64: + needs: generate-matrix + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.x64_oses) }} + provider: + - qemu + steps: + - name: Checkout + uses: actions/checkout@main + - name: Install Vagrant QEMU + run: | + wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list + sudo apt-get update + sudo apt-get install -y software-properties-common vagrant qemu-kvm libvirt-daemon-system virtinst libvirt-clients bridge-utils qemu-utils libvirt-dev + vagrant plugin install vagrant-libvirt vagrant-qemu + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + sudo usermod -aG kvm $USER + sudo usermod -aG libvirt $USER + sudo chmod o+rw /var/run/libvirt/libvirt-sock + sudo systemctl start libvirtd + sudo systemctl status libvirtd + - name: Install Chef + uses: actionshub/chef-install@3.0.0 + - name: Setup Packer + uses: hashicorp/setup-packer@main + with: + version: latest + - name: Install Bento + run: | + eval "$(chef shell-init bash)" + gem build bento.gemspec + gem install bento-*.gem + - name: Bento build + run: | + rm -rf builds + sudo mkdir -p /mnt/builds/iso + sudo mkdir -p /mnt/builds/build_complete + sudo chmod -R 777 /mnt/builds + sudo ln -s /mnt/builds ./ + eval "$(chef shell-init bash)" + bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" + ls -alh builds/build_complete/ + cat builds/build_complete/${{ matrix.os }}*-x86_64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(virsh list --all | grep '${{ matrix.os }}' | awk '{print $2}')" + echo "VM Name: $VM" + virsh destroy "$VM" 2>/dev/null || true + sleep 2 + virsh undefine "$VM" --remove-all-storage 2>/dev/null || true + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test libvirt + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-qemu-x86_64" + path: | + builds/testing_passed/x86_64/*.box + builds/testing_passed/x86_64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression + + aarch64: + needs: generate-matrix + runs-on: [self-hosted, ARM64, qemu] + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.arm64_oses) }} + provider: + - qemu + steps: + - name: Checkout + uses: actions/checkout@main + - name: Bento build + run: | + eval "$(chef shell-init bash)" + bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl" + ls -alh builds/build_complete/ + cat builds/build_complete/${{ matrix.os }}*-aarch64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(virsh list --all | grep '${{ matrix.os }}' | awk '{print $2}')" + echo "VM Name: $VM" + virsh destroy "$VM" 2>/dev/null || true + sleep 2 + virsh undefine "$VM" --remove-all-storage 2>/dev/null || true + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test libvirt + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-qemu-aarch64" + path: | + builds/testing_passed/aarch64/*.box + builds/testing_passed/aarch64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression diff --git a/.github/workflows/pkr-bld-utm-arm64.yml b/.github/workflows/pkr-bld-utm-arm64.yml index 38267e17a..71aa7b1f8 100644 --- a/.github/workflows/pkr-bld-utm-arm64.yml +++ b/.github/workflows/pkr-bld-utm-arm64.yml @@ -22,11 +22,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - - freebsd-13 + - fedora-43 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-9 - oraclelinux-10 @@ -34,8 +33,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - utm-iso diff --git a/.github/workflows/pkr-bld-utm-x64.yml b/.github/workflows/pkr-bld-utm-x64.yml index 5ba0043ef..5077d17f7 100644 --- a/.github/workflows/pkr-bld-utm-x64.yml +++ b/.github/workflows/pkr-bld-utm-x64.yml @@ -23,11 +23,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - - freebsd-13 + - fedora-43 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-8 - oraclelinux-9 @@ -37,8 +36,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - utm-iso diff --git a/.github/workflows/pkr-bld-utm.yml b/.github/workflows/pkr-bld-utm.yml new file mode 100644 index 000000000..4e3fbd4a6 --- /dev/null +++ b/.github/workflows/pkr-bld-utm.yml @@ -0,0 +1,110 @@ +--- +on: + workflow_call: + +permissions: + contents: read + +env: + PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # PACKER_LOG: 1 + +jobs: + generate-matrix: + runs-on: ubuntu-latest + outputs: + x64_oses: ${{ steps.set-matrix.outputs.x64_oses }} + arm64_oses: ${{ steps.set-matrix.outputs.arm64_oses }} + steps: + - name: Checkout + uses: actions/checkout@main + - name: Set matrix + id: set-matrix + run: | + # arm64 exclusions: no aarch64 pkrvars exist for these OS versions + X64=$(ruby -r yaml -r json -e "puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') }.to_json") + ARM64=$(ruby -r yaml -r json -e "excl=%w[almalinux-8 oraclelinux-8 rockylinux-8]; puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') || excl.include?(o) }.to_json") + echo "x64_oses=${X64}" >> "$GITHUB_OUTPUT" + echo "arm64_oses=${ARM64}" >> "$GITHUB_OUTPUT" + + x86_64: + needs: generate-matrix + runs-on: [self-hosted, X64, utm] + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.x64_oses) }} + provider: + - utm-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: Bento build + run: | + eval "$(chef shell-init bash)" + bento build -o ${{ matrix.provider }}.vm --vars 'ssh_timeout=60m' os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" + ls -alh builds/build_complete/ + cat builds/build_complete/${{ matrix.os }}*-x86_64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(utmctl list | grep '${{ matrix.os }}' | awk '{print $1}')" + echo "VM UUID: $VM" + utmctl stop "$VM" 2>/dev/null || true + sleep 2 + utmctl delete "$VM" 2>/dev/null || true + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-utm-x86_64" + path: | + builds/testing_passed/x86_64/*.box + builds/testing_passed/x86_64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression + + aarch64: + needs: generate-matrix + runs-on: [self-hosted, ARM64, utm] + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.arm64_oses) }} + provider: + - utm-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: Bento build + run: | + eval "$(chef shell-init bash)" + bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl" + ls -alh builds/build_complete/ + cat builds/build_complete/${{ matrix.os }}*-aarch64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(utmctl list | grep '${{ matrix.os }}' | awk '{print $1}')" + echo "VM UUID: $VM" + utmctl stop "$VM" 2>/dev/null || true + sleep 2 + utmctl delete "$VM" 2>/dev/null || true + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-utm-aarch64" + path: | + builds/testing_passed/aarch64/*.box + builds/testing_passed/aarch64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression diff --git a/.github/workflows/pkr-bld-virtualbox-arm64.yml b/.github/workflows/pkr-bld-virtualbox-arm64.yml index 8132e2238..127eb61d2 100644 --- a/.github/workflows/pkr-bld-virtualbox-arm64.yml +++ b/.github/workflows/pkr-bld-virtualbox-arm64.yml @@ -22,12 +22,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - fedora-43 - - freebsd-13 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-9 - oraclelinux-10 @@ -35,8 +33,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - virtualbox-iso diff --git a/.github/workflows/pkr-bld-virtualbox-x64.yml b/.github/workflows/pkr-bld-virtualbox-x64.yml index b09fcbc75..2752fcd5e 100644 --- a/.github/workflows/pkr-bld-virtualbox-x64.yml +++ b/.github/workflows/pkr-bld-virtualbox-x64.yml @@ -23,12 +23,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - fedora-43 - - freebsd-13 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-8 - oraclelinux-9 @@ -38,8 +36,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - virtualbox-iso diff --git a/.github/workflows/pkr-bld-virtualbox.yml b/.github/workflows/pkr-bld-virtualbox.yml new file mode 100644 index 000000000..fce1039ec --- /dev/null +++ b/.github/workflows/pkr-bld-virtualbox.yml @@ -0,0 +1,137 @@ +--- +on: + workflow_call: + +permissions: + contents: read + +env: + PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # PACKER_LOG: 1 + +jobs: + generate-matrix: + runs-on: ubuntu-latest + outputs: + x64_oses: ${{ steps.set-matrix.outputs.x64_oses }} + arm64_oses: ${{ steps.set-matrix.outputs.arm64_oses }} + steps: + - name: Checkout + uses: actions/checkout@main + - name: Set matrix + id: set-matrix + run: | + # arm64 exclusions: no aarch64 pkrvars exist for these OS versions + ARM64_EXCLUDE="almalinux-8 oraclelinux-8 rockylinux-8" + X64=$(ruby -r yaml -r json -e "puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') }.to_json") + ARM64=$(ruby -r yaml -r json -e "excl=%w[almalinux-8 oraclelinux-8 rockylinux-8]; puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') || excl.include?(o) }.to_json") + echo "x64_oses=${X64}" >> "$GITHUB_OUTPUT" + echo "arm64_oses=${ARM64}" >> "$GITHUB_OUTPUT" + + x86_64: + needs: generate-matrix + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.x64_oses) }} + provider: + - virtualbox-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: Install Vagrant VirtualBox + run: | + wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg + wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor | sudo tee /usr/share/keyrings/oracle-virtualbox-2016.gpg + echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list + echo "deb [signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list + sudo apt-get update + sudo apt-get install -y software-properties-common vagrant virtualbox-7.2 + - name: Install Chef + uses: actionshub/chef-install@3.0.0 + - name: Setup Packer + uses: hashicorp/setup-packer@main + with: + version: latest + - name: Install Bento + run: | + eval "$(chef shell-init bash)" + gem build bento.gemspec + gem install bento-*.gem + - name: Bento build + run: | + rm -rf builds + sudo mkdir -p /mnt/builds/iso + sudo mkdir -p /mnt/builds/build_complete + sudo chmod -R 777 /mnt/builds + sudo ln -s /mnt/builds ./ + eval "$(chef shell-init bash)" + export LOGNAME=$USER + bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" + ls -alh builds/build_complete/ + cat builds/build_complete/${{ matrix.os }}*-x86_64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(VBoxManage list vms | grep '${{ matrix.os }}' | awk -F'"' '{print $2}')" + echo "VM Name: $VM" + VBoxManage controlvm "$VM" poweroff 2>/dev/null || true + sleep 2 + VBoxManage unregistervm "$VM" --delete 2>/dev/null || true + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + export LOGNAME=$USER + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-virtualbox-x86_64" + path: | + builds/testing_passed/x86_64/*.box + builds/testing_passed/x86_64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression + + aarch64: + needs: generate-matrix + runs-on: [self-hosted, ARM64, virtualbox] + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.arm64_oses) }} + provider: + - virtualbox-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: Bento build + run: | + eval "$(chef shell-init bash)" + bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl" + ls -alh builds/build_complete/ + cat builds/build_complete/${{ matrix.os }}*-aarch64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(VBoxManage list vms | grep '${{ matrix.os }}' | awk -F'"' '{print $2}')" + echo "VM Name: $VM" + VBoxManage controlvm "$VM" poweroff 2>/dev/null || true + sleep 2 + VBoxManage unregistervm "$VM" --delete 2>/dev/null || true + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-virtualbox-aarch64" + path: | + builds/testing_passed/aarch64/*.box + builds/testing_passed/aarch64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression diff --git a/.github/workflows/pkr-bld-vmware-arm64.yml b/.github/workflows/pkr-bld-vmware-arm64.yml index c89d18c5c..780b9c0b6 100644 --- a/.github/workflows/pkr-bld-vmware-arm64.yml +++ b/.github/workflows/pkr-bld-vmware-arm64.yml @@ -22,12 +22,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - fedora-43 - - freebsd-13 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-9 - oraclelinux-10 @@ -35,8 +33,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - vmware-iso diff --git a/.github/workflows/pkr-bld-vmware-x64.yml b/.github/workflows/pkr-bld-vmware-x64.yml index 5d2341526..fa4411eac 100644 --- a/.github/workflows/pkr-bld-vmware-x64.yml +++ b/.github/workflows/pkr-bld-vmware-x64.yml @@ -23,12 +23,10 @@ jobs: - centos-stream-10 - debian-12 - debian-13 - - fedora-42 - fedora-43 - - freebsd-13 + - fedora-44 - freebsd-14 - freebsd-15 - - opensuse-leap-15 - opensuse-leap-16 - oraclelinux-8 - oraclelinux-9 @@ -38,8 +36,6 @@ jobs: - rockylinux-10 - ubuntu-22.04 - ubuntu-24.04 - - ubuntu-25.04 - - ubuntu-25.10 - ubuntu-26.04 provider: - vmware-iso diff --git a/.github/workflows/pkr-bld-vmware.yml b/.github/workflows/pkr-bld-vmware.yml new file mode 100644 index 000000000..c5c76652b --- /dev/null +++ b/.github/workflows/pkr-bld-vmware.yml @@ -0,0 +1,114 @@ +--- +on: + workflow_call: + +permissions: + contents: read + +env: + PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + # PACKER_LOG: "1" + +jobs: + generate-matrix: + runs-on: ubuntu-latest + outputs: + x64_oses: ${{ steps.set-matrix.outputs.x64_oses }} + arm64_oses: ${{ steps.set-matrix.outputs.arm64_oses }} + steps: + - name: Checkout + uses: actions/checkout@main + - name: Set matrix + id: set-matrix + run: | + # arm64 exclusions: no aarch64 pkrvars exist for these OS versions + X64=$(ruby -r yaml -r json -e "puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') }.to_json") + ARM64=$(ruby -r yaml -r json -e "excl=%w[almalinux-8 oraclelinux-8 rockylinux-8]; puts YAML.load_file('builds.yml')['public'].reject { |o| o.start_with?('amazonlinux') || excl.include?(o) }.to_json") + echo "x64_oses=${X64}" >> "$GITHUB_OUTPUT" + echo "arm64_oses=${ARM64}" >> "$GITHUB_OUTPUT" + + x86_64: + needs: generate-matrix + runs-on: [self-hosted, X64, vmware] + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.x64_oses) }} + provider: + - vmware-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: Bento build + run: | + eval "$(chef shell-init bash)" + bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" + ls -alh builds/build_complete/ + cat builds/build_complete/${{ matrix.os }}*-x86_64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VMX="$(find "$HOME/Documents/Virtual Machines.localized" -name "*.vmx" | grep '${{ matrix.os }}' | head -1)" + echo "VMX Path: $VMX" + if [ -n "$VMX" ]; then + vmrun stop "$VMX" hard 2>/dev/null || true + sleep 3 + rm -rf "$(dirname "$VMX")" + fi + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-vmware-x86_64" + path: | + builds/testing_passed/x86_64/*.box + builds/testing_passed/x86_64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression + + aarch64: + needs: generate-matrix + runs-on: [self-hosted, ARM64, vmware] + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.generate-matrix.outputs.arm64_oses) }} + provider: + - vmware-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: Bento build + run: | + eval "$(chef shell-init bash)" + bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl" + ls -alh builds/build_complete/ + cat builds/build_complete/${{ matrix.os }}*-aarch64._metadata.json + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VMX="$(find "$HOME/Documents/Virtual Machines.localized" -name "*.vmx" | grep '${{ matrix.os }}' | head -1)" + echo "VMX Path: $VMX" + if [ -n "$VMX" ]; then + vmrun stop "$VMX" hard 2>/dev/null || true + sleep 3 + rm -rf "$(dirname "$VMX")" + fi + - name: Bento Test + run: | + eval "$(chef shell-init bash)" + bento test + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-vmware-aarch64" + path: | + builds/testing_passed/aarch64/*.box + builds/testing_passed/aarch64/*.json + overwrite: true + retention-days: 10 + compression-level: 0 # no compression diff --git a/.github/workflows/test-pkr-bld-parallels.yml b/.github/workflows/test-pkr-bld-parallels.yml deleted file mode 100644 index d6de2796c..000000000 --- a/.github/workflows/test-pkr-bld-parallels.yml +++ /dev/null @@ -1,155 +0,0 @@ ---- -on: - workflow_call: - -permissions: - contents: read - -env: - PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - # PACKER_LOG: "1" - -jobs: - x86_64: - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - os: - - almalinux-8 - - almalinux-9 - - almalinux-10 - - centos-stream-9 - - debian-11 - - debian-12 - - fedora-42 - - fedora-43 - - freebsd-13 - - freebsd-14 - - freebsd-15 - - opensuse-leap-15 - - opensuse-leap-16 - - oraclelinux-8 - - oraclelinux-9 - - oraclelinux-10 - - rockylinux-8 - - rockylinux-9 - - rockylinux-10 - - ubuntu-22.04 - - ubuntu-24.04 - - ubuntu-26.04 - provider: - - parallels-iso - steps: - - name: Checkout - uses: actions/checkout@main - - name: Install Vagrant Parallels - run: | - brew tap hashicorp/tap - brew update - brew install --cask hashicorp/tap/hashicorp-vagrant - brew install --cask parallels - brew install --cask parallels-virtualization-sdk - vagrant plugin install vagrant-parallels - - name: Install Chef - uses: actionshub/chef-install@3.0.0 - - name: Setup Packer - uses: hashicorp/setup-packer@main - with: - version: latest - - name: Install Bento - run: | - eval "$(chef shell-init bash)" - gem build bento.gemspec - gem install bento-*.gem - - name: Bento build - run: | - eval "$(chef shell-init bash)" - bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" - ls -alh builds/build_complete/ - cat builds/build_complete/${{ matrix.os }}*-x86_64._metadata.json - - name: Upload build artifact - uses: actions/upload-artifact@v3 - with: - name: "${{ matrix.os }}-parallels-x86_64" - path: | - builds/build_complete/*.box - builds/build_complete/*.json - retention-days: 10 - compression-level: 0 # no compression - - name: Bento Test - run: | - eval "$(chef shell-init bash)" - bento test - - aarch64: - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - os: - - almalinux-8 - - almalinux-9 - - centos-stream-9 - - debian-11 - - debian-12 - - fedora-40 - - fedora-41 - - freebsd-13 - - freebsd-14 - - freebsd-15 - - opensuse-leap-15 - - oraclelinux-8 - - oraclelinux-9 - - rockylinux-8 - - rockylinux-9 - - ubuntu-20.04 - - ubuntu-22.04 - - ubuntu-24.04 - - ubuntu-26.04 - provider: - - parallels-iso - steps: - - name: Checkout - uses: actions/checkout@main - - name: Install Vagrant Parallels - run: | - brew tap hashicorp/tap - brew update - brew install --cask hashicorp/tap/hashicorp-vagrant - brew install --cask parallels - brew install --cask parallels-virtualization-sdk - vagrant plugin install vagrant-parallels - - name: Install Chef - uses: actionshub/chef-install@3.0.0 - with: - version: 24.2.1058 - - name: Setup Packer - uses: hashicorp/setup-packer@main - with: - version: latest - - name: Install Bento - run: | - eval "$(chef shell-init bash)" - gem build bento.gemspec - gem install bento-*.gem - - name: Bento build - run: | - eval "$(chef shell-init bash)" - bento build -o ${{ matrix.provider }}.vm --vars 'ssh_timeout=30m' os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl" - ls -alh builds/build_complete/ - cat builds/build_complete/${{ matrix.os }}*-aarch64._metadata.json - - name: Bento Test - run: | - eval "$(chef shell-init bash)" - bento test - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - name: "${{ matrix.os }}-parallels-aarch64" - path: | - builds/testing_passed/aarch64/*.box - builds/testing_passed/aarch64/*.json - overwrite: true - retention-days: 10 - compression-level: 0 # no compression diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 000000000..93a568f3b --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,6 @@ +--- +config: + line-length: false # MD013 +ignores: + - .github/copilot-instructions.md + - AGENTS.md diff --git a/.mdlrc b/.mdlrc deleted file mode 100644 index 295c24970..000000000 --- a/.mdlrc +++ /dev/null @@ -1 +0,0 @@ -rules "~MD007", "~MD013", "~MD024", "~MD033" diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..e37b54824 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,263 @@ +# Bento Repository - Agent Instructions + +This repository contains the Bento project, which provides: +1. **Ruby CLI Wrapper**: A Ruby gem (`bento`) that wraps Hashicorp Packer for building Vagrant boxes +2. **Packer Templates**: HCL-based Packer templates for building Vagrant base boxes across multiple operating systems and providers + +## Repository Overview + +### Ruby Component (CLI Wrapper) +- **Language**: Ruby 3.0+ +- **Main Executable**: `bin/bento` +- **Library Code**: `lib/bento/` +- **Key Features**: Build, test, upload, list, and normalize Vagrant boxes +- **Dependencies**: mixlib-shellout, Packer, Vagrant + +### Packer Component (Box Definitions) +- **Language**: HCL (HashiCorp Configuration Language) +- **Templates Directory**: `packer_templates/` +- **OS Variable Files**: `os_pkrvars/` (organized by OS family) +- **Supported Providers**: VirtualBox, VMware, Parallels, UTM, QEMU, Hyper-V +- **Supported Architectures**: x86_64, aarch64 + +## Code Change Requirements + +### For ALL Changes to This Repository: + +#### 1. Linting Requirements +Before committing any changes, you **MUST** run the following linters based on the files modified: + +**Ruby Files** (`*.rb`, `Rakefile`, `*.gemspec`): +```bash +bundle install +bundle exec cookstyle -a . +``` + +**Markdown Files** (`*.md`): +```bash +# Markdown linting is performed via GitHub Actions +# Local testing not required but verify links work +``` + +**YAML Files** (`*.yml`, `*.yaml`): +```bash +# YAML linting is performed via GitHub Actions +# Ensure valid YAML syntax +``` + +**Shell Scripts** (`*.sh`): +```bash +shellcheck *.sh +``` + +**PowerShell Scripts** (`*.ps1`): +```bash +# PowerShell linting is performed via GitHub Actions +``` + +**Packer Templates** (`*.pkr.hcl`, `*.pkrvars.hcl`): +```bash +cd /path/to/bento +packer init -upgrade ./packer_templates +packer validate -var-file=os_pkrvars//