Skip to content

Commit

Permalink
merged with main
Browse files Browse the repository at this point in the history
Signed-off-by: Corey Hemminger <[email protected]>
  • Loading branch information
Stromweld committed Apr 26, 2024
2 parents ab6907d + b34c9c6 commit b9b5dd8
Show file tree
Hide file tree
Showing 106 changed files with 2,138 additions and 1,029 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ jobs:
#
# powershell-lint:
# uses: chef/github-workflows/.github/workflows/powershell-lint.yml@main

pkr-bld-hyper-v-x64:
uses: ./.github/workflows/test-pkr-bld-hyperv-x64.yml
secrets: inherit
pkr-bld-parallels-x64:
uses: ./.github/workflows/test-pkr-bld-parallels-x64.yml
secrets: inherit

#
# 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.*,macos-*'
#
# packer-lint:
# uses: chef/github-workflows/.github/workflows/packer-lint.yml@main
# secrets: inherit
#
# pkr-bld-amazonlinux-x64:
# uses: ./.github/workflows/pkr-bld-amazonlinux-x64.yml
# secrets: inherit
Expand Down Expand Up @@ -84,6 +86,7 @@ jobs:
# - xml-lint
# - powershell-lint
# - shellcheck-lint
# - packer-lint
# runs-on: Ubuntu-latest
# steps:
# - name: Decide whether the needed jobs succeeded or failed
Expand All @@ -92,3 +95,10 @@ jobs:
# allowed-failures:
# allowed-skips: ${{ toJSON(needs) }}
# jobs: ${{ toJSON(needs) }}

pkr-bld-hyper-v-x64:
uses: ./.github/workflows/test-pkr-bld-hyperv-x64.yml
secrets: inherit
pkr-bld-parallels-x64:
uses: ./.github/workflows/test-pkr-bld-parallels-x64.yml
secrets: inherit
64 changes: 37 additions & 27 deletions .github/workflows/old/pkr-bld-amazonlinux-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 8 additions & 14 deletions .github/workflows/old/pkr-bld-hyperv-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:

env:
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
PACKER_LOG: "1"

jobs:
x86_64:
Expand All @@ -24,33 +25,24 @@ 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
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- hyperv-iso
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
# uses: hashicorp/setup-packer@main
# with:
# version: latest
- name: Packer Init
run: packer init -upgrade packer_templates
- name: Packer FMT
run: packer fmt -check -recursive .
- name: Packer Validate
run: packer validate -var-file="os_pkrvars/$("${{ matrix.os }}".Split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
- name: Packer build
- name: Bento build
run: packer build -timestamp-ui -only="${{ matrix.provider }}.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()
Expand All @@ -66,4 +58,6 @@ jobs:
name: "${{ matrix.os }}-hyperv-x86_64"
path: |
builds/*.box
builds/*.json
retention-days: 10
compression-level: 0 # no compression
39 changes: 16 additions & 23 deletions .github/workflows/old/pkr-bld-parallels-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:

env:
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
PACKER_LOG: "1"

jobs:
aarch64:
Expand All @@ -19,48 +20,35 @@ jobs:
- centos-stream-9
- debian-11
- debian-12
- fedora-38
- fedora-39
- fedora-40
- 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
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- parallels-iso
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-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-aarch64.pkrvars.hcl" packer_templates
- 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
# - name: Bento Test
# run: |
# eval "$(chef shell-init bash)"
# bento test
ls -alh builds/
cat builds/${{ matrix.os }}*-aarch64._metadata.json
- name: Remove VM in case of canceled job
if: cancelled()
run: |
Expand All @@ -75,6 +63,11 @@ jobs:
with:
name: "${{ matrix.os }}-parallels-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
39 changes: 16 additions & 23 deletions .github/workflows/old/pkr-bld-parallels-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:

env:
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
PACKER_LOG: "1"

jobs:
x86_64:
Expand All @@ -19,47 +20,34 @@ jobs:
- centos-stream-9
- debian-11
- debian-12
- fedora-38
- fedora-39
- fedora-40
- 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
- ubuntu-22.04
- ubuntu-23.10
- ubuntu-24.04
provider:
- parallels-iso
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
# 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: Packer build
# run: packer build -timestamp-ui -only=${{ matrix.provider }}.vm -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates
- 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
# - name: Bento Test
# run: |
# eval "$(chef shell-init bash)"
# bento test
ls -alh builds/
cat builds/${{ matrix.os }}*-x86_64._metadata.json
- name: Remove VM in case of canceled job
if: cancelled()
run: |
Expand All @@ -74,6 +62,11 @@ jobs:
with:
name: "${{ matrix.os }}-parallels-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
Loading

0 comments on commit b9b5dd8

Please sign in to comment.