kaz-vagrant/files/snster-kaz/hoster-a/kaz1/kaz.sh

53 lines
1.3 KiB
Bash
Raw Normal View History

2022-12-22 17:25:05 +01:00
#!/bin/bash
if [ -z "${SNSTERGUARD}" ] ; then
exit 1
fi
DIR=$(cd "$(dirname $0)"; pwd)
cd "${DIR}"
set -e
export OUTPUT_DIR="/root/install"
mkdir -p "${OUTPUT_DIR}/log/"
export DebugLog="${OUTPUT_DIR}/log/log-kaz-$(date +%y-%m-%d-%T)-"
(
echo "########## ********** Start kaz.sh $(date +%D-%T)"
docker-clean -a
rm -rf /kaz
if [ -z "${KAZBRANCH}" ] ; then
KAZBRANCH="master"
fi
echo -e "\n #### git checkout ${KAZBRANCH}\n"
# copie des sources
cd /
2023-03-06 11:27:55 +01:00
git clone https://git.kaz.bzh/KAZ/kaz.git
2022-12-22 17:25:05 +01:00
(cd /kaz ; git checkout "${KAZBRANCH}" )
2023-03-06 11:27:55 +01:00
cp "${DIR}/kaz-config/dockers.env" /kaz/config/dockers.env
2022-12-22 17:25:05 +01:00
for type in mail orga proxy withMail withoutMail ; do
2023-03-06 11:27:55 +01:00
[ -f "${DIR}/kaz-config/container-${type}.list" ] &&
cp "${DIR}/kaz-config/container-${type}.list" /kaz/config/
2022-12-22 17:25:05 +01:00
done
echo -e "\n #### secretGen\n"
/kaz/bin/secretGen.sh
2023-03-06 11:27:55 +01:00
echo -e "\n #### install\n"
2023-01-18 12:13:48 +01:00
/kaz/bin/install.sh
2022-12-22 17:25:05 +01:00
# On crée quelques comptes
mkdir -p /kaz/tmp
cp /root/createUser.txt /kaz/tmp/
2023-04-19 17:51:49 +02:00
/kaz/bin/createUser.sh -e || true
2023-03-06 11:27:55 +01:00
2022-12-22 17:25:05 +01:00
# clear apt cache
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
DEBIAN_FRONTEND=noninteractive apt-get clean
echo "########## ********** End kaz.sh $(date +%D-%T)"
) > >(tee ${DebugLog}stdout.log) 2> >(tee ${DebugLog}stderr.log >&2)