Add a script for creating a customer
This commit is contained in:
parent
79cdf25efd
commit
5bbca47bd1
27
add_customer
Executable file
27
add_customer
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
basename="$(dirname "${0}")"
|
||||
|
||||
customer=${1}
|
||||
shift
|
||||
environ=${1}
|
||||
shift
|
||||
|
||||
if [[ -z ${customer} ]] || [[ -z ${environ} ]]; then
|
||||
echo "Usage: ${0} <customer> <environment>"
|
||||
echo "Example: ${0} vr test"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ${customer} == 'test' ]] || [[ ${customer} == 'prod' ]]; then
|
||||
temp=${customer}
|
||||
customer=${environ}
|
||||
environ=${temp}
|
||||
fi
|
||||
customer_dir="${basename}/customers/overlays/${customer}"
|
||||
mkdir -p "${customer_dir}"
|
||||
cp -a "${basename}/customers/overlays/vr/${environ}" "${customer_dir}/"
|
||||
sed -i "s/vr/${customer}/g" "${customer_dir}/${environ}/nextcloud-ingress.yml" "${customer_dir}/${environ}/nextcloud-deployment.yml"
|
||||
git add "${customer_dir}/${environ}"
|
||||
git commit -m "Adding ${customer} to ${environ}"
|
||||
${basename}/bump-tag
|
Loading…
Reference in a new issue