forked from sjones4/euca-me
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·26 lines (21 loc) · 1004 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
#!/bin/sh
#
TARGET="out"
TEMPLATE="euca-me-template.json"
CLOUDCONFIG="cloud-config.yaml"
[ ! -e "${TARGET}" ] || rm -rvf "${TARGET}"
mkdir -pv "${TARGET}"
echo "Building cloud config"
sed 's/^/ /' "euca-me.py" > "${TARGET}/euca-me.py"
sed 's/^/ /' "httpd.conf" > "${TARGET}/httpd.conf"
sed 's/^/ /' "pdns.conf" > "${TARGET}/pdns.conf"
cp "${CLOUDCONFIG}" "${TARGET}"
sed --in-place "/@@EUCA-ME_PY@@/r ${TARGET}/euca-me.py" "${TARGET}/${CLOUDCONFIG}"
sed --in-place "s/@@EUCA-ME_PY@@//" "${TARGET}/${CLOUDCONFIG}"
sed --in-place "/@@HTTPD_CONF@@/r ${TARGET}/httpd.conf" "${TARGET}/${CLOUDCONFIG}"
sed --in-place "s/@@HTTPD_CONF@@//" "${TARGET}/${CLOUDCONFIG}"
sed --in-place "/@@PDNS_CONF@@/r ${TARGET}/pdns.conf" "${TARGET}/${CLOUDCONFIG}"
sed --in-place "s/@@PDNS_CONF@@//" "${TARGET}/${CLOUDCONFIG}"
echo "Building cloudformation template"
pipenv run python template.py > "${TARGET}/${TEMPLATE}"
ls -1 out