From 5bbca47bd11ccd48441f58c6224ce7d7df5efac0 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Fri, 9 Jun 2023 13:12:42 +0200 Subject: [PATCH] Add a script for creating a customer --- add_customer | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 add_customer diff --git a/add_customer b/add_customer new file mode 100755 index 0000000..b8caa17 --- /dev/null +++ b/add_customer @@ -0,0 +1,27 @@ +#!/bin/bash + +basename="$(dirname "${0}")" + +customer=${1} +shift +environ=${1} +shift + +if [[ -z ${customer} ]] || [[ -z ${environ} ]]; then + echo "Usage: ${0} " + 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