Skip to content

Commit

Permalink
build all providers
Browse files Browse the repository at this point in the history
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
  • Loading branch information
Stromweld committed Sep 18, 2023
1 parent 648e706 commit 2e26b0c
Show file tree
Hide file tree
Showing 5 changed files with 259 additions and 6 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/pkr-bld-win-10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
on:
workflow_call:

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

jobs:
x86_64:
runs-on: [self-hosted, X64, Windows, parallels]
strategy:
fail-fast: false
matrix:
os:
- windows-10
provider:
- parallels-iso
- qemu
- virtualbox-iso
- vmware-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
run: |
eval "$(chef shell-init bash)"
bento build -o parallels-iso.vm,qemu.vm,virtualbox-iso.vm,vmware-iso.vm --vars "qemu_accelerator=hvf" 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
- name: Remove VM in case of canceled job
if: cancelled()
run: |
VM="$(prlctl list -a | grep ${{ matrix.os }} | cut -d " " -f 1)"
echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64
prlctl stop "$VM" --kill 2> /dev/null
sleep 1
prlctl delete "$VM" 2> /dev/null
sleep 2
- name: Upload build artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.os }}-x86_64"
path: |
builds
!builds/uploaded/*
retention-days: 10
64 changes: 64 additions & 0 deletions .github/workflows/pkr-bld-win-11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
on:
workflow_call:

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

jobs:
x86_64:
runs-on: [self-hosted, X64, Windows, parallels]
strategy:
fail-fast: false
matrix:
os:
- windows-11
provider:
- parallels-iso
- qemu
- virtualbox-iso
- vmware-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
run: |
eval "$(chef shell-init bash)"
bento build -o parallels-iso.vm,qemu.vm,virtualbox-iso.vm,vmware-iso.vm --vars "qemu_accelerator=hvf" 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
- name: Remove VM in case of canceled job
if: cancelled()
run: |
VM="$(prlctl list -a | grep ${{ matrix.os }} | cut -d " " -f 1)"
echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64
prlctl stop "$VM" --kill 2> /dev/null
sleep 1
prlctl delete "$VM" 2> /dev/null
sleep 2
- name: Upload build artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.os }}-x86_64"
path: |
builds
!builds/uploaded/*
retention-days: 10
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ jobs:
fail-fast: false
matrix:
os:
- windows-10
- windows-11
- windows-2016
- windows-2019
- windows-2022
provider:
- parallels-iso
- qemu
Expand All @@ -42,7 +38,7 @@ jobs:
# 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
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"
bento build -o parallels-iso.vm,qemu.vm,virtualbox-iso.vm,vmware-iso.vm --vars "qemu_accelerator=hvf" os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl"
ls -alh builds
# - name: Bento Test
# run: |
Expand All @@ -58,9 +54,10 @@ jobs:
prlctl delete "$VM" 2> /dev/null
sleep 2
- name: Upload build artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.os }}-all-x86_64"
name: "${{ matrix.os }}-x86_64"
path: |
builds
!builds/uploaded/*
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/pkr-bld-win-2019.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
on:
workflow_call:

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

jobs:
x86_64:
runs-on: [self-hosted, X64, Windows, parallels]
strategy:
fail-fast: false
matrix:
os:
- windows-2019
provider:
- parallels-iso
- qemu
- virtualbox-iso
- vmware-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
run: |
eval "$(chef shell-init bash)"
bento build -o parallels-iso.vm,qemu.vm,virtualbox-iso.vm,vmware-iso.vm --vars "qemu_accelerator=hvf" 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
- name: Remove VM in case of canceled job
if: cancelled()
run: |
VM="$(prlctl list -a | grep ${{ matrix.os }} | cut -d " " -f 1)"
echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64
prlctl stop "$VM" --kill 2> /dev/null
sleep 1
prlctl delete "$VM" 2> /dev/null
sleep 2
- name: Upload build artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.os }}-x86_64"
path: |
builds
!builds/uploaded/*
retention-days: 10
64 changes: 64 additions & 0 deletions .github/workflows/pkr-bld-win-2022.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
on:
workflow_call:

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

jobs:
x86_64:
runs-on: [self-hosted, X64, Windows, parallels]
strategy:
fail-fast: false
matrix:
os:
- windows-2022
provider:
- parallels-iso
- qemu
- virtualbox-iso
- vmware-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
run: |
eval "$(chef shell-init bash)"
bento build -o parallels-iso.vm,qemu.vm,virtualbox-iso.vm,vmware-iso.vm --vars "qemu_accelerator=hvf" 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
- name: Remove VM in case of canceled job
if: cancelled()
run: |
VM="$(prlctl list -a | grep ${{ matrix.os }} | cut -d " " -f 1)"
echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64
prlctl stop "$VM" --kill 2> /dev/null
sleep 1
prlctl delete "$VM" 2> /dev/null
sleep 2
- name: Upload build artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.os }}-x86_64"
path: |
builds
!builds/uploaded/*
retention-days: 10

0 comments on commit 2e26b0c

Please sign in to comment.