-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to ubuntu-latest runners (#1561)
- Add back iso check, packer lint, and amazonlinux builds to build pipeline - Fix amazonlinux 2 build script - Added amazonlinux 2023 build scripts - Migrate Virtualbox and Qemu builds to github hosted runners from self-hosted runners - Added test-kitchen and kitchen-vagrant dependencies to gemspec - Added arg for bento test command to specify a specific build to test - this passes the arg to the kitchen test command - Fix vagrant post-processor to specify custom vagrant file for freebsd builds - Remove gui true from windows custom vagrant file - Fix test to skip removing linux-firmware on oraclelinux - Renamed oracle boxes to oraclelinux for consistency and remove edge cases in code - Removed unused -c flag for specifying a specific config file for bento build - Added --on-error flag to bento build command to pass to packer command - Added cpu architecture support to bento build command, so it'll only test builds that work with the current cpu architecture - Remove additional Ubuntu user-date last-command that may be locking macaddress - Add to test to move failed test boxes to builds/failed_testing directory - Changed ssh_timeout to 15m
- Loading branch information
Showing
41 changed files
with
419 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,51 +4,61 @@ on: | |
|
||
env: | ||
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
PACKER_LOG: "1" | ||
|
||
jobs: | ||
x86_64: | ||
runs-on: [self-hosted, X64, virtualbox] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- amazonlinux-2 | ||
- 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.0 qemu-utils genisoimage | ||
VBoxManage --version | ||
vagrant --version | ||
- name: Install Chef | ||
uses: actionshub/[email protected] | ||
- name: Setup Packer | ||
uses: hashicorp/setup-packer@main | ||
with: | ||
version: latest | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
# - name: Setup Packer | ||
# uses: hashicorp/setup-packer@main | ||
# with: | ||
# version: latest | ||
- name: Packer Init | ||
run: packer init -upgrade packer_templates | ||
- 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 | ||
- name: Packer Validate | ||
run: packer validate -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates | ||
- 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 chmod -R 777 /mnt/builds | ||
sudo ln -s /mnt/builds ./ | ||
eval "$(chef shell-init bash)" | ||
./AMZ_build_virtualbox-ovf.sh | ||
bento build --metadata_only os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" | ||
./${{ matrix.os }}-x86_64-virtualbox-build.sh | ||
ls -alh builds | ||
# - name: Bento Test | ||
# run: | | ||
# eval "$(chef shell-init bash)" | ||
# bento test | ||
- name: Remove VM in case of canceled job | ||
if: cancelled() | ||
run: | | ||
echo Powering off and deleting any existing VMs named AmazonLinuxBento | ||
VBoxManage controlvm AmazonLinuxBento poweroff --type headless 2> /dev/null | ||
sleep 1 | ||
VBoxManage unregistervm AmazonLinuxBento --delete 2> /dev/null | ||
sleep 2 | ||
cat builds/${{ matrix.os }}*-x86_64._metadata.json | ||
- name: Upload build artifact | ||
uses: actions/upload-artifact@main | ||
with: | ||
name: "${{ matrix.os }}-virtualbox-x86_64" | ||
path: | | ||
builds | ||
!builds/uploaded/* | ||
builds/*.box | ||
builds/*.json | ||
retention-days: 10 | ||
compression-level: 0 # no compression | ||
- name: Bento Test | ||
run: | | ||
eval "$(chef shell-init bash)" | ||
bento test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,11 @@ on: | |
|
||
env: | ||
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
PACKER_LOG: "1" | ||
|
||
jobs: | ||
aarch64: | ||
runs-on: [self-hosted, ARM64, qemu] | ||
runs-on: macos-14 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -24,9 +25,9 @@ jobs: | |
- freebsd-13 | ||
- freebsd-14 | ||
- opensuse-leap-15 | ||
- oracle-7 | ||
- oracle-8 | ||
- oracle-9 | ||
- oraclelinux-7 | ||
- oraclelinux-8 | ||
- oraclelinux-9 | ||
- rockylinux-8 | ||
- rockylinux-9 | ||
- ubuntu-20.04 | ||
|
@@ -37,35 +38,40 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
- name: iso-availability | ||
shell: pwsh | ||
run: Invoke-RestMethod -Method Head -Verbose -Uri $(Get-Content os_pkrvars/$('${{ matrix.os }}'.split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl | ConvertFrom-StringData).iso_url.Trim('"') | ||
# - name: Setup Packer | ||
# if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
# uses: hashicorp/setup-packer@main | ||
# with: | ||
# version: latest | ||
- name: Packer Init | ||
run: packer init -upgrade packer_templates | ||
- 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 | ||
- name: Packer Validate | ||
run: packer validate -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl" packer_templates | ||
- name: Packer build | ||
# run: packer build -timestamp-ui -only=${{ matrix.provider }}.vm -var "qemu_accelerator=hvf" -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl" packer_templates | ||
- name: Install Vagrant QEMU | ||
run: | | ||
brew install qemu libvirt | ||
brew tap hashicorp/tap | ||
brew install --cask hashicorp/tap/hashicorp-vagrant | ||
brew services start libvirt | ||
vagrant plugin install vagrant-libvirt vagrant-qemu | ||
- name: Install Chef | ||
uses: actionshub/[email protected] | ||
- 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 "qemu_accelerator=hvf" os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl" | ||
ls -alh builds | ||
# - name: Bento Test | ||
# run: | | ||
# eval "$(chef shell-init bash)" | ||
# bento test | ||
ls -alh builds/ | ||
cat builds/${{ matrix.os }}*-aarch64._metadata.json | ||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "${{ matrix.os }}-qemu-aarch64" | ||
path: | | ||
builds | ||
!builds/uploaded/* | ||
builds/*.box | ||
builds/*.json | ||
retention-days: 10 | ||
compression-level: 0 # no compression | ||
- name: Bento Test | ||
run: | | ||
eval "$(chef shell-init bash)" | ||
bento test libvirt |
Oops, something went wrong.