Skip to content

Commit

Permalink
Merge pull request #2 from skara9/packer
Browse files Browse the repository at this point in the history
packer
  • Loading branch information
skara9 authored Sep 15, 2023
2 parents 8f60dca + 77b3380 commit 60e5cdc
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/packer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Packer

on:
workflow_dispatch:

jobs:
packer:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Packer
run: |
brew tap hashicorp/tap
brew install hashicorp/tap/packer
- name: Validate
run: |
packer validate packer/submitty-main.json
- name: Build
run: |
packer build packer/submitty-main.json
5 changes: 5 additions & 0 deletions packer/provisioner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
GIT_PATH=/usr/local/submitty/GIT_CHECKOUT/Submitty
DISTRO=$(lsb_release -si | tr '[:upper:]' '[:lower:]')
VERSION=$(lsb_release -sr | tr '[:upper:]' '[:lower:]')
mkdir -p ${GIT_PATH}/.vagrant/logs
bash ${GIT_PATH}/.setup/vagrant/setup_vagrant.sh 2>&1 | tee ${GIT_PATH}/.vagrant/logs/submitty-main.log
54 changes: 54 additions & 0 deletions packer/submitty-main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"builders": [
{
"type": "virtualbox-iso",
"guest_os_type": "Ubuntu_64",
"iso_url": "https://releases.ubuntu.com/jammy/ubuntu-22.04.3-live-server-amd64.iso",
"iso_checksum": "sha256:a4acfda10b18da50e2ec50ccaf860d7f20b389df8765611142305c0e911d16fd",
"ssh_username": "ubuntu",
"ssh_password": "ubuntu",
"ssh_port": 22,
"ssh_wait_timeout": "10m",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
"headless": true,
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"2048"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"2"
]
],
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic ",
"file=/floppy/preseed.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname=ubuntu ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
],
"boot_wait": "10s"
}
],
"provisioners": [
{
"type": "shell",
"script": "./provisioner.sh"
}
],
"post-processors": [
{
"type": "vagrant",
"output": "build/vb.box"
}
]
}

0 comments on commit 60e5cdc

Please sign in to comment.