Skip to content

Commit

Permalink
add macos build (#1566)
Browse files Browse the repository at this point in the history
- Require ruby >= 3.0.0
- Add parallels-ipsw source
- Added MacOS template for parallels-ipsw
- Created MacOS scripts
- Adjusted build flags to all be lower case for consistency
- Removed extra amazonlinux directories to be more consistent with other builds
- Added build_files directory for all temp files to be stored in during packer building
- Opensuse-leap-15.5 updated to 15.6
- Remove Fedora 38 and add 40 builds
- Remove Ubuntu 23.10 and add 24.04 builds
  • Loading branch information
Stromweld authored Apr 26, 2024
1 parent db7858d commit b34c9c6
Show file tree
Hide file tree
Showing 45 changed files with 579 additions and 229 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
packer-iso-check:
uses: chef/github-workflows/.github/workflows/packer-iso-url-checker.yml@main
with:
EXCLUDE_REGEX: 'amazonlinux-2.*|rhel.*|sles.*|solaris.*|windows-11-aarch64.*'
EXCLUDE_REGEX: 'amazonlinux-2.*|rhel.*|sles.*|solaris.*|windows-11-aarch64.*,macos-*'

packer-lint:
uses: chef/github-workflows/.github/workflows/packer-lint.yml@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkr-bld-hyperv-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- rockylinux-9
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- hyperv-iso
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkr-bld-parallels-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- centos-stream-9
- debian-11
- debian-12
- fedora-38
- fedora-39
- fedora-40
- freebsd-13
- freebsd-14
- opensuse-leap-15
Expand All @@ -32,7 +32,7 @@ jobs:
- rockylinux-9
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- parallels-iso
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkr-bld-parallels-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- centos-stream-9
- debian-11
- debian-12
- fedora-38
- fedora-39
- fedora-40
- freebsd-13
- freebsd-14
- opensuse-leap-15
Expand All @@ -32,7 +32,7 @@ jobs:
- rockylinux-9
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- parallels-iso
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkr-bld-qemu-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- centos-stream-9
- debian-11
- debian-12
- fedora-38
- fedora-39
- fedora-40
- freebsd-13
- freebsd-14
- opensuse-leap-15
Expand All @@ -32,7 +32,7 @@ jobs:
- rockylinux-9
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- qemu
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkr-bld-qemu-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- centos-stream-9
- debian-11
- debian-12
- fedora-38
- fedora-39
- fedora-40
- freebsd-13
- freebsd-14
- opensuse-leap-15
Expand All @@ -32,7 +32,7 @@ jobs:
- rockylinux-9
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- qemu
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkr-bld-virtualbox-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- centos-stream-9
- debian-11
- debian-12
- fedora-38
- fedora-39
- fedora-40
- freebsd-13
- freebsd-14
- opensuse-leap-15
Expand All @@ -32,7 +32,7 @@ jobs:
- rockylinux-9
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- virtualbox-iso
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkr-bld-virtualbox-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- centos-stream-9
- debian-11
- debian-12
- fedora-38
- fedora-39
- fedora-40
- freebsd-13
- freebsd-14
- opensuse-leap-15
Expand All @@ -32,7 +32,7 @@ jobs:
- rockylinux-9
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- virtualbox-iso
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkr-bld-vmware-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- centos-stream-9
- debian-11
- debian-12
- fedora-38
- fedora-39
- fedora-40
- freebsd-13
- freebsd-14
- opensuse-leap-15
Expand All @@ -32,7 +32,7 @@ jobs:
- rockylinux-9
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- vmware-iso
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkr-bld-vmware-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- centos-stream-9
- debian-11
- debian-12
- fedora-38
- fedora-39
- fedora-40
- freebsd-13
- freebsd-14
- opensuse-leap-15
Expand All @@ -32,7 +32,7 @@ jobs:
- rockylinux-9
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- vmware-iso
steps:
Expand Down
86 changes: 50 additions & 36 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,42 @@
***Note:**
Markdown table generated at <https://www.tablesgenerator.com/markdown_tables#>

| | hyperv<br>x86_64 | parallels<br>x86_64 | parallels<br>aarch64 | qemu<br>x86_64 | qemu<br>aarch64 | virtualbox<br>x86_64 | virtualbox<br>aarch64 | vmware<br>x86_64 | vmware<br>aarch64 |
|:----------------:|:---:|:-------------------:|:--------------------:|:---:|:---:|:--------------------:|:---:|:-----------------:|:-----------------:|
| almalinux-8 | | x | | x | | x | | x | |
| almalinux-9 | | x | x | | | x | | x | x |
| amazonlinux-2 | | | | | | x | | | |
| amazonlinux-2023 | | | | | | x | | | |
| centos-7 | | x | | x | | x | | x | |
| centos-stream-8 | | x | | x | | x | | x | |
| centos-stream-9 | | | x | | | | | | |
| debian-11 | | x | x | | | x | | x | |
| debian-12 | | x | x | | | x | | x | x |
| fedora-38 | | x | | x | | x | | x | x |
| fedora-39 | | | | | | | | | |
| freebsd-13 | | | | | | x | | x | x |
| freebsd-14 | | | | | | x | | x | |
| opensuse-leap-15 | | x | | x | | x | | x | |
| oraclelinux-7 | | x | | x | | x | | x | |
| oraclelinux-8 | | | | x | | x | | x | |
| oraclelinux-9 | | x | x | | | x | | x | |
| rhel-7 | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed |
| rhel-8 | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed |
| rhel-9 | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed |
| rockylinux-8 | | x | | x | | x | | x | |
| rockylinux-9 | | x | | | | x | | x | x |
| sles-12 | license<br>needed | license<br>needed | na | license<br>needed | na | license<br>needed | na | license<br>needed | na |
| sles-13 | license<br>needed | license<br>needed | na | license<br>needed | na | license<br>needed | na | license<br>needed | na |
| solaris-11 | license<br>needed | license<br>needed | na | license<br>needed | na | license<br>needed | na | license<br>needed | na |
| ubuntu-20.04 | | x | x | | | x | | x | x |
| ubuntu-22.04 | | x | | x | | x | | x | |
| ubuntu-23.10 | | x | x | | | x | | x | x |
| windows-10 | | x | na | | na | x | na | | na |
| windows-11 | | x | x | | na | x | na | | |
| windows-2016 | | x | na | | na | x | na | | na |
| windows-2019 | | x | na | | na | x | na | | na |
| windows-2022 | | x | na | | na | x | na | | na |
| os | hyperv<br>x86_64 | parallels<br>x86_64 | parallels<br>aarch64 | qemu<br>x86_64 | qemu<br>aarch64 | virtualbox<br>x86_64 | virtualbox<br>aarch64 | vmware<br>x86_64 | vmware<br>aarch64 |
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| almalinux-8 | | x | | | | x | | x | |
| almalinux-9 | | x | | | | x | | x | x |
| amazonlinux-2 | | | | | | x | | | |
| amazonlinux-2023 | | | | | | x | | | |
| centos-7 | | | | | | x | | x | |
| centos-stream-8 | | x | | | | x | | x | |
| centos-stream-9 | | x | | | | x | | x | x |
| debian-11 | | x | x | | | x | | x | |
| debian-12 | | x | x | | | x | | x | x |
| fedora-39 | | x | x | | | x | | x | x |
| fedora-40 | | | | | | | | | |
| freebsd-13 | | | | | | x | | x | x |
| freebsd-14 | | | | | | | | | |
| macos | | | x | | | | | | |
| opensuse-leap-15 | | | | | | x | | x | x |
| oraclelinux-7 | | x | | | | x | | x | |
| oraclelinux-8 | | | | | | x | | x | |
| oraclelinux-9 | | x | x | | | x | | x | x |
| rhel-7 | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed |
| rhel-8 | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed |
| rhel-9 | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed | license<br>needed |
| rockylinux-8 | | x | | | | x | | x | |
| rockylinux-9 | | x | | | | x | | x | x |
| sles-12 | license<br>needed | license<br>needed | na | license<br>needed | na | license<br>needed | na | license<br>needed | na |
| sles-15 | license<br>needed | license<br>needed | na | license<br>needed | na | license<br>needed | na | license<br>needed | na |
| solaris-11 | license<br>needed | license<br>needed | na | license<br>needed | na | license<br>needed | na | license<br>needed | na |
| ubuntu-20.04 | | | x | | | x | | x | x |
| ubuntu-22.04 | | x | | | | x | | | |
| ubuntu-24.04 | | x | x | | | x | | x | x |
| windows-10 | | | na | | na | x | na | | na |
| windows-11 | | x | x | | | x | | x | |
| windows-2016 | | x | na | | na | x | na | x | na |
| windows-2019 | | x | na | | na | x | na | x | na |
| windows-2022 | | x | na | | na | x | na | | na |

### Todo

Expand All @@ -53,7 +54,20 @@ Markdown table generated at <https://www.tablesgenerator.com/markdown_tables#>
- Create CD pipeline to upload vagrant boxes after PR is merged
- Create CD pipeline to build and upload new versions of vagrant boxes once every 3 months with the latest patches

## [unreleased] (2024-04-11)
## [unreleased] (2024-04-26)

## [v4.1.1] (2024-04-26)

- Require ruby >= 3.0.0
- Add parallels-ipsw source
- Added MacOS template for parallels-ipsw
- Created MacOS scripts
- Adjusted build flags to all be lower case for consistency
- Removed extra amazonlinux directories to be more consistent with other builds
- Added build_files directory for all temp files to be stored in during packer building
- Opensuse-leap-15.5 updated to 15.6
- Remove Fedora 38 and add 40 builds
- Remove Ubuntu 23.10 and add 24.04 builds

## [v4.1.0] (2024-04-11)

Expand Down
15 changes: 8 additions & 7 deletions amazonlinux-2-x86_64-virtualbox-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ SCRIPT_RELATIVE_DIR=$(dirname "${BASH_SOURCE[0]}")
cd "$SCRIPT_RELATIVE_DIR" || exit

# set tmp dir for files
AMZDIR="$(pwd)/packer_templates/amz_working_files"

AMZDIR="$(pwd)/builds/build_files/amazonlinux-2-x86_64-virtualbox"
mkdir -p "$AMZDIR"
# Get virtualbox vdi file name with latest version number
IMG="$(wget -q https://cdn.amazonlinux.com/os-images/latest/virtualbox/ -O - | grep ".vdi" | cut -d "\"" -f 2)"

Expand All @@ -24,12 +24,13 @@ echo "Cleaning up old files"
rm -f "$AMZDIR"/*.iso "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk

echo "Creating ISO"
SEED_ISO_DIR="$(pwd)/packer_templates/http/amazon"
if [ -x "$(command -v genisoimage)" ]; then
genisoimage -output "$AMZDIR"/seed.iso -volid cidata -joliet -rock "$AMZDIR"/../amz_seed_iso/user-data "$AMZDIR"/../amz_seed_iso/meta-data
genisoimage -output "$AMZDIR"/seed.iso -volid cidata -joliet -rock "$SEED_ISO_DIR"/user-data "$SEED_ISO_DIR"/meta-data
elif [ -x "$(command -v hdiutil)" ]; then
hdiutil makehybrid -o "$AMZDIR"/seed.iso -hfs -joliet -iso -default-volume-name cidata "$AMZDIR"/../amz_seed_iso
hdiutil makehybrid -o "$AMZDIR"/seed.iso -hfs -joliet -iso -default-volume-name cidata "$SEED_ISO_DIR"/
elif [ -x "$(command -v mkisofs)" ]; then
mkfsiso9660 -o "$AMZDIR"/seed.iso "$AMZDIR"/../amz_seed_iso
mkfsiso9660 -o "$AMZDIR"/seed.iso "$SEED_ISO_DIR"/
else
echo "No tool found to create the seed.iso"
exit 1
Expand Down Expand Up @@ -68,9 +69,9 @@ echo Deleting the VM
vboxmanage unregistervm $VM --delete

echo starting packer build of amazonlinux
if bento build --vars vbox_source_path="$AMZDIR"/amazon2_x86_64.ovf,vbox_checksum=null "$AMZDIR"/../../os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl; then
if bento build --vars vbox_source_path="$AMZDIR"/amazon2_x86_64.ovf,vbox_checksum=null "$(pwd)"/os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl; then
echo "Cleaning up files"
rm -f "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.iso
rm -f "$AMZDIR"
else
exit 1
fi
14 changes: 8 additions & 6 deletions amazonlinux-2023-aarch64-virtualbox-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ SCRIPT_RELATIVE_DIR=$(dirname "${BASH_SOURCE[0]}")
cd "$SCRIPT_RELATIVE_DIR" || exit

# set tmp dir for files
AMZDIR="$(pwd)/packer_templates/amz_working_files"
AMZDIR="$(pwd)/builds/build_files/amazonlinux-2023-aarch64-virtualbox"
mkdir -p "$AMZDIR"

echo "Cleaning up old files"
rm -f "$AMZDIR"/*.iso "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.vdi
Expand All @@ -26,12 +27,13 @@ if [ ! -f "$AMZDIR"/amazon2023_arm64.vdi ]; then
fi

echo "Creating ISO"
SEED_ISO_DIR="$(pwd)/packer_templates/http/amazon"
if [ -x "$(command -v genisoimage)" ]; then
genisoimage -output "$AMZDIR"/seed.iso -volid cidata -joliet -rock "$AMZDIR"/../amz_seed_iso/user-data "$AMZDIR"/../amz_seed_iso/meta-data
genisoimage -output "$AMZDIR"/seed.iso -volid cidata -joliet -rock "$SEED_ISO_DIR"/user-data "$SEED_ISO_DIR"/meta-data
elif [ -x "$(command -v hdiutil)" ]; then
hdiutil makehybrid -o "$AMZDIR"/seed.iso -hfs -joliet -iso -default-volume-name cidata "$AMZDIR"/../amz_seed_iso
hdiutil makehybrid -o "$AMZDIR"/seed.iso -hfs -joliet -iso -default-volume-name cidata "$SEED_ISO_DIR"/
elif [ -x "$(command -v mkisofs)" ]; then
mkfsiso9660 -o "$AMZDIR"/seed.iso "$AMZDIR"/../amz_seed_iso
mkfsiso9660 -o "$AMZDIR"/seed.iso "$SEED_ISO_DIR"/
else
echo "No tool found to create the seed.iso"
exit 1
Expand Down Expand Up @@ -76,9 +78,9 @@ echo "Deleting the VM"
vboxmanage unregistervm $VM --delete

echo "starting packer build of amazonlinux"
if bento build --vars vbox_source_path="$AMZDIR"/amazon2023_arm64.ovf,vbox_checksum=null "$AMZDIR"/../../os_pkrvars/amazonlinux/amazonlinux-2023-aarch64.pkrvars.hcl; then
if bento build --vars vbox_source_path="$AMZDIR"/amazon2023_arm64.ovf,vbox_checksum=null "$(pwd)"/os_pkrvars/amazonlinux/amazonlinux-2023-aarch64.pkrvars.hcl; then
echo "Cleaning up files"
rm -f "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.iso "$AMZDIR"/*.vdi "$AMZDIR"/*.qcow2
rm -f "$AMZDIR"
else
exit 1
fi
14 changes: 8 additions & 6 deletions amazonlinux-2023-x86_64-virtualbox-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ SCRIPT_RELATIVE_DIR=$(dirname "${BASH_SOURCE[0]}")
cd "$SCRIPT_RELATIVE_DIR" || exit

# set tmp dir for files
AMZDIR="$(pwd)/packer_templates/amz_working_files"
AMZDIR="$(pwd)/builds/build_files/amazonlinux-2023-x86_64-virtualbox"
mkdir -p "$AMZDIR"

echo "Cleaning up old files"
rm -f "$AMZDIR"/*.iso "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.vdi
Expand All @@ -26,12 +27,13 @@ if [ ! -f "$AMZDIR"/amazon2023_x86_64.vdi ]; then
fi

echo "Creating ISO"
SEED_ISO_DIR="$(pwd)/packer_templates/http/amazon"
if [ -x "$(command -v genisoimage)" ]; then
genisoimage -output "$AMZDIR"/seed.iso -volid cidata -joliet -rock "$AMZDIR"/../amz_seed_iso/user-data "$AMZDIR"/../amz_seed_iso/meta-data
genisoimage -output "$AMZDIR"/seed.iso -volid cidata -joliet -rock "$SEED_ISO_DIR"/user-data "$SEED_ISO_DIR"/meta-data
elif [ -x "$(command -v hdiutil)" ]; then
hdiutil makehybrid -o "$AMZDIR"/seed.iso -hfs -joliet -iso -default-volume-name cidata "$AMZDIR"/../amz_seed_iso
hdiutil makehybrid -o "$AMZDIR"/seed.iso -hfs -joliet -iso -default-volume-name cidata "$SEED_ISO_DIR"/
elif [ -x "$(command -v mkisofs)" ]; then
mkfsiso9660 -o "$AMZDIR"/seed.iso "$AMZDIR"/../amz_seed_iso
mkfsiso9660 -o "$AMZDIR"/seed.iso "$SEED_ISO_DIR"/
else
echo "No tool found to create the seed.iso"
exit 1
Expand Down Expand Up @@ -74,9 +76,9 @@ echo "Deleting the VM"
vboxmanage unregistervm $VM --delete

echo "starting packer build of amazonlinux"
if bento build --vars vbox_source_path="$AMZDIR"/amazon2023_x86_64.ovf,vbox_checksum=null "$AMZDIR"/../../os_pkrvars/amazonlinux/amazonlinux-2023-x86_64.pkrvars.hcl; then
if bento build --vars vbox_source_path="$AMZDIR"/amazon2023_x86_64.ovf,vbox_checksum=null "$(pwd)"/os_pkrvars/amazonlinux/amazonlinux-2023-x86_64.pkrvars.hcl; then
echo "Cleaning up files"
rm -f "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.iso "$AMZDIR"/*.vdi "$AMZDIR"/*.qcow2
rm -f "$AMZDIR"
else
exit 1
fi
2 changes: 1 addition & 1 deletion bento.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.email = '[email protected]'
s.homepage = 'https://github.com/chef/bento/'

s.required_ruby_version = '>= 2.6'
s.required_ruby_version = '>= 3.0'

s.add_dependency 'mixlib-shellout', '>= 2.3.2'
s.add_dependency 'test-kitchen'
Expand Down
Loading

0 comments on commit b34c9c6

Please sign in to comment.