forked from vmware-samples/vcenter-event-broker-appliance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·31 lines (22 loc) · 890 Bytes
/
build.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
#!/bin/bash
# Copyright 2019 VMware, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-2
set -euo pipefail
VEBA_BOM_FILE=veba-bom.json
if [ ! -e ${VEBA_BOM_FILE} ]; then
echo "Unable to locate veba-bom.json in current directory which is required"
exit 1
fi
if ! hash jq 2>/dev/null; then
echo "jq utility is not installed on this system"
exit 1
fi
if [[ ! -z $(git status -s) ]]; then
echo "Dirty Git repository, please clean up any untracked files or commit them before building"
exit
fi
rm -f output-vmware-iso/*.ova
VEBA_VERSION_FROM_BOM=$(jq -r < ${VEBA_BOM_FILE} '.veba.version')
VEBA_COMMIT=$(git rev-parse --short HEAD)
echo "Building VEBA OVA from ${VEBA_VERSION_FROM_BOM} ..."
packer build -var "VEBA_VERSION=${VEBA_VERSION_FROM_BOM}" -var "VEBA_COMMIT=${VEBA_COMMIT}" -var-file=photon-builder.json -var-file=photon-version.json photon.json