Skip to content

Commit

Permalink
Merge pull request #10 from NIAEFEUP/TestBed
Browse files Browse the repository at this point in the history
TestBed Base with packer
  • Loading branch information
LuisDuarte1 committed Jan 11, 2024
2 parents ca2df7c + 13d049a commit d0ed57d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
16 changes: 16 additions & 0 deletions testbed/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# TestBed For OS testing

## Setup

### Pre-requisites

- VirtualBox
- Packer
- OS image url and checksum

### Configuration

- change packer.pkr.hcl to match your needs
- packer init packer.pkr.hcl
- packer build packer.pkr.hcl

33 changes: 33 additions & 0 deletions testbed/packer.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
packer {
required_plugins {
vagrant = {
source = "github.com/hashicorp/vagrant"
version = "~> 1"
}
}
}


source "virtualbox-iso" "generated" {
guest_os_type = "Linux_64"
iso_url = "https://channels.nixos.org/nixos-23.05/latest-nixos-minimal-x86_64-linux.iso"
iso_checksum = "c92fdd85e18466e4e557d59bed8edfa55f9f139c0b16cf060d59dc198e056e52"
ssh_username = "niaefeup"
ssh_password = "niaefeup"
boot_wait = "60s"
boot_command = [
"sudo su<enter><wait>",
"stop sshd<enter>",
"mkfs.btrfs -L nixos /dev/sda<enter><wait5>",
"mount -o discard,compress=lzo LABEL=nixos /mnt<enter><wait>",
"nixos-generate-config --root /mnt<enter><wait>",
"nixos-install && reboot<enter>"
]
}


build {
sources = [
"virtualbox-iso.generated"
]
}

0 comments on commit d0ed57d

Please sign in to comment.