-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathmake_manifest
executable file
·45 lines (35 loc) · 1.15 KB
/
make_manifest
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
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
release_dir=$(dirname $0)
templates=$release_dir/templates
infrastructure=$1
shift
if [ "$infrastructure" != "aws" ] && \
[ "$infrastructure" != "warden" ] && \
[ "$infrastructure" != "vsphere" ] ; then
echo "usage: ./make_manifest <aws|warden|vsphere> [stubs...]"
exit 1
fi
if [ "$infrastructure" == "warden" ] ; then
BOSH_STATUS=$(bosh status)
EXPECTED_DIRECTOR_NAME="Bosh Lite Director"
if [[ "$(echo "$BOSH_STATUS" | grep Name)" != *"$EXPECTED_DIRECTOR_NAME"* ]]; then
echo "Can only target $EXPECTED_DIRECTOR_NAME. Please use 'bosh target' before running this script."
exit 1
fi
temp_dir=$(mktemp -d admin_ui-XXXXXXXXXX) || { echo "Failed to create temp file"; exit 1; }
bosh -q download manifest cf-warden $temp_dir/cf-warden.yml
sed -i.back 's/!//g' $temp_dir/cf-warden.yml
spiff merge \
$templates/admin-ui-deployment.yml \
$temp_dir/cf-warden.yml \
$templates/warden-stub.yml \
$* > $release_dir/admin-ui.local.yml
rm -f $temp_dir/*
rmdir $temp_dir
bosh deployment $release_dir/admin-ui.local.yml
bosh status
else
spiff merge \
$templates/admin-ui-deployment.yml \
$*
fi