From a27d33b7dfff8b199fddad7f80c3d244ceab6361 Mon Sep 17 00:00:00 2001 From: Benjamin Krein Date: Mon, 20 Jan 2025 09:20:18 -0500 Subject: [PATCH] fix vbox build --- .github/workflows/manual-build.yml | 2 +- fujinet.pkr.hcl | 1 + output/.gitkeep | 0 packer_build.sh | 14 ++++++++++++-- 4 files changed, 14 insertions(+), 3 deletions(-) delete mode 100644 output/.gitkeep diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml index 69275fb..7c7e20e 100644 --- a/.github/workflows/manual-build.yml +++ b/.github/workflows/manual-build.yml @@ -26,4 +26,4 @@ jobs: # Runs a set of commands using the runners shell - name: Manual Build - run: ./packer_build.sh -v ${{ github.event.inputs.version }} + run: ./packer_build.sh -u -v ${{ github.event.inputs.version }} diff --git a/fujinet.pkr.hcl b/fujinet.pkr.hcl index ea1a24f..19ef5c4 100644 --- a/fujinet.pkr.hcl +++ b/fujinet.pkr.hcl @@ -131,6 +131,7 @@ source "virtualbox-iso" "fujinet" { "auto lowmem/low=true preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/vbox-preseed.cfg netcfg/get_hostname=fujinet-vm" ] vboxmanage = [ + ["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"], ["modifyvm", "{{.Name}}", "--memory", "4096"], ["modifyvm", "{{.Name}}", "--cpus", "2"], ["modifyvm", "{{.Name}}", "--draganddrop", "bidirectional"], diff --git a/output/.gitkeep b/output/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/packer_build.sh b/packer_build.sh index 3b104e9..1affd32 100755 --- a/packer_build.sh +++ b/packer_build.sh @@ -1,30 +1,34 @@ #!/usr/bin/env bash +set -x VERSION="test" COPY_ONLY="false" +CLEAN_ALL="false" LOCAL_ONLY="true" OUTPUT_FLAG="" function usage() { - echo "$0 [-o build_output] [-v version] [-l] [-c] [-n] [-h]" + echo "$0 [-o build_output] [-v version] [-l] [-c] [-x] [-n] [-h]" echo echo " -o Set the type of VM to build (default 'virtualbox-iso', alternative 'qemu', 'vmware-iso')" echo " -v Provide a version for the VM build (default: 'test')" echo " -u If set build WILL be uploaded to MEGA (local only)" echo " -c Just copy the OVA to MEGA" + echo " -x Clean all former builds" echo " -n Disable (no) color" echo " -h Display this help" echo exit 1 } -while getopts "v:o:lucnh" opt +while getopts "v:o:lucxnh" opt do case "$opt" in o) OUTPUT_TYPE="$OPTARG" ;; v) VERSION="$OPTARG" ;; u) LOCAL_ONLY="false" ;; c) COPY_ONLY="true" ;; + x) CLEAN_ALL="true" ;; n) COLOR_FLAG="-color=false" ;; *) usage ;; esac @@ -35,6 +39,12 @@ then OUTPUT_FLAG="-only=build.${OUTPUT_TYPE}.fujinet" fi +if [[ "$CLEAN_ALL" == "true" ]] +then + rm -rf "$HOME/VirtualBox\ VMs/fujinet-debian12-vbox" + rm -f "./output*/*" +fi + if [[ "$VERSION" != "test" ]] then git tag "$VERSION"