Skip to content

Commit

Permalink
Test Ubuntu 20.04 and 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
replaceafill committed Jan 23, 2025
1 parent f1dfc68 commit 9e2095e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/vagrant-box-archivematica.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ on:
- "dev/add-24.04-vagrant-base-image"
jobs:
build-base-image:
name: Build base image
name: "Build base image Ubuntu ${{ matrix.ubuntu-version }}"
runs-on: ubuntu-24.04
env:
PACKER_CACHE_DIR: ${{ github.workspace }}/.packer_cache
PACKER_LOG: TRACE
strategy:
fail-fast: false
matrix:
ubuntu-version: [
"20.04",
"22.04",
]
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -26,29 +33,36 @@ jobs:
echo "LOGNAME=$USER" >> $GITHUB_ENV
- name: Build
run: |
cd ${{ github.workspace }}/packer/templates/vagrant-base-ubuntu-22.04-amd64
cd "${{ github.workspace }}/packer/templates/vagrant-base-ubuntu-${{ matrix.ubuntu-version }}-amd64"
packer init template.json.pkr.hcl
packer build -on-error=abort template.json.pkr.hcl
- name: Upload base image
uses: actions/upload-artifact@v4
with:
name: base-image
path: "${{ github.workspace }}/packer/builds/virtualbox/vagrant-base-ubuntu-22.04-amd64"
name: "base-image-${{ matrix.ubuntu-version }}"
path: "${{ github.workspace }}/packer/builds/virtualbox/vagrant-base-ubuntu-${{ matrix.ubuntu-version }}-amd64"
vagrant-box-archivematica:
name: Build and upload box image
name: "Build and upload box image Ubuntu ${{ matrix.ubuntu-version }}"
runs-on: ubuntu-24.04
needs: ["build-base-image"]
env:
PACKER_CACHE_DIR: ${{ github.workspace }}/.packer_cache
PACKER_LOG: TRACE
strategy:
fail-fast: false
matrix:
ubuntu-version: [
"20.04",
"22.04",
]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Restore base image
uses: actions/download-artifact@v4
with:
name: base-image
path: "${{ github.workspace }}/packer/builds/virtualbox/vagrant-base-ubuntu-22.04-amd64"
name: "base-image-${{ matrix.ubuntu-version }}"
path: "${{ github.workspace }}/packer/builds/virtualbox/vagrant-base-ubuntu-${{ matrix.ubuntu-version }}-amd64"
- name: "Install packer, vagrant and VirtualBox"
run: |
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
Expand All @@ -68,7 +82,7 @@ jobs:
run: |
cd ${{ github.workspace }}/packer/templates/vagrant-box-archivematica
packer init template.json.pkr.hcl
packer build -on-error=abort template.json.pkr.hcl
packer build -on-error=abort -var "release=${{ matrix.ubuntu-version }}" template.json.pkr.hcl
mv ${{ github.workspace }}/packer/builds/virtualbox/vagrant-am.box \
${{ github.workspace }}/archivematica-vagrant-v1.17.0.box
- name: Provision a test VM with the new image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ packer {
}
}

variable "release" {
type = string
default = "22.04"
}

source "virtualbox-ovf" "ubuntu" {
headless = "true"
shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now"
source_path = "../../builds/virtualbox/vagrant-base-ubuntu-22.04-amd64/vagrant-base-ubuntu-22.04-amd64.ovf"
source_path = "../../builds/virtualbox/vagrant-base-ubuntu-${var.release}-amd64/vagrant-base-ubuntu-${var.release}-amd64.ovf"
ssh_password = "vagrant"
ssh_username = "vagrant"
ssh_wait_timeout = "30s"
Expand Down

0 comments on commit 9e2095e

Please sign in to comment.