-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-vsphere.sh
executable file
·36 lines (30 loc) · 1015 Bytes
/
build-vsphere.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd $DIR
if [[ -f /proc/version ]] && [[ "$( grep Microsoft /proc/version )" ]]; then
PACKER="packer.exe"
else
PACKER="packer"
fi
if [[ ! -e ./vsphere-environment-do-not-add ]]
then
echo "Please add a vsphere-environment-do-not-add file to set up the environment variables required to deploy"
echo "These vary based on the target VMWare server. The list can be found at the bottom of the packer template."
return 1
fi
source ./vsphere-environment-do-not-add
echo 'creating output directory'
mkdir -p output
rm -rf ./output/packer-ubuntu-22.04-amd64-vmware
echo 'building base images'
$PACKER build \
-only=vmware-iso \
-except=vagrant \
-var 'customise_for_buildmachine=1' \
-var 'build_directory=./output/' \
-var 'disk_size=200000' \
-var 'cpus=2' \
-var 'memory=4096' \
-var 'vmx_remove_ethernet_interfaces=false' \
-var 'box_basename=ccdc-basebox/ubuntu-22.04' \
./ubuntu-22.04-amd64.json