Skip to content

Commit

Permalink
Changing development branch to use development container and simplify…
Browse files Browse the repository at this point in the history
… build script

Signed-off-by: William Lam <wlam@vmware.com>
  • Loading branch information
William Lam committed Oct 15, 2020
1 parent 2b8b852 commit 0dbb217
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 20 deletions.
18 changes: 4 additions & 14 deletions build.sh
Expand Up @@ -16,11 +16,6 @@ if ! hash jq 2>/dev/null; then
exit 1
fi

if [ $# -ne 1 ]; then
echo -e "\n\tUsage: $0 [master|release]\n"
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
Expand All @@ -29,13 +24,8 @@ 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

if [ "$1" == "release" ]; then
echo "Building VEBA OVA release ..."
packer build -var "VEBA_VERSION=${VEBA_VERSION_FROM_BOM}-release" -var "VEBA_COMMIT=$(git rev-parse --short HEAD)" -var-file=photon-builder.json -var-file=photon-version.json photon.json
elif [ "$1" == "master" ]; then
echo "Building VEBA OVA master ..."
packer build -var "VEBA_VERSION=${VEBA_VERSION_FROM_BOM}" -var "VEBA_COMMIT=$(git rev-parse --short HEAD)" -var-file=photon-builder.json -var-file=photon-version.json photon.json
else
echo -e "\nPlease specify release or master to build ...\n"
fi
26 changes: 24 additions & 2 deletions docs/kb/contribute-appliance.md
Expand Up @@ -47,10 +47,32 @@ Step 2 - Edit the `photon-builder.json` file to configure the vSphere endpoint f

> **Note:** If you need to change the default root password on the VMware Event Broker Appliance, take a look at `photon-version.json`
Step 3 - Start the build by running the build script
Step 3 - The `veba-bom.json` will need to be updated to specify the branch you wish to build the vCenter Event Broker Appliance code from whether that is from master, a release- branch or from development. Below are two examples of how to correctly set the versions needed prior to building.

> **Note:** The default BOM version in development will be the development branch. No changes will be necessary unless you wish to build from a release or master branch.
Example 1 (build from master branch):
```
".veba.version" => "v0.5.0"
"vmware-event-router.version" => "v0.5.0"
"vmware-event-router.containers[0].version" => "v0.5.0"
```

Example 2 (build from development branch):
```
".veba.version" => "development"
"vmware-event-router.version" => "development"
"vmware-event-router.containers[0].version" => "development"
```

* master branch will be reflected using a stable tag, e.g. v0.5.0
* Any release- branch will be reflected using release-<version> omitting v for backwards-compat reasons, e.g. release-0.5.0
* Router image tags, based on the branch where changes are pushed to, will use <image>:v0.5.0 for master, <image>:release-0.5.0 for release-<version> and <image>:development on every push to development branch. In addition, the master and development container images will also be tagged with the corresponding COMMIT_ID of the pushed commit.

Step 4 - Start the build by running the build script

```
./build.sh master
./build.sh
````

If you wish to automatically deploy the VMware Event Broker Appliance after successfully building the OVA, please take a look at the script samples located in the test directory.
8 changes: 4 additions & 4 deletions veba-bom.json
@@ -1,12 +1,12 @@
{
"veba": {
"version": "v0.4.1"
"version": "development"
},
"vmware-event-router": {
"gitRepoTag": "v0.4.1",
"gitRepoTag": "development",
"containers": [{
"name": "vmware/veba-event-router",
"version": "v0.4.1"
"version": "development"
}]
},
"antrea": {
Expand Down Expand Up @@ -100,7 +100,7 @@
}
},
"tinywww": {
"gitRepoTag": "latest",
"gitRepoTag": "master",
"containers": [{
"name": "embano1/tinywww",
"version": "latest"
Expand Down

0 comments on commit 0dbb217

Please sign in to comment.