-
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.
Signed-off-by: Corey Hemminger <[email protected]>
- Loading branch information
Showing
106 changed files
with
2,138 additions
and
1,029 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
Oops, something went wrong.