From 56ca8cc70f8ba42cde769ad53d707bebbc8fbc60 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 3 Nov 2022 00:35:43 +0300 Subject: [PATCH] create bases --- config/nocloud/user-data | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/nocloud/user-data b/config/nocloud/user-data index 4679cd2..3789607 100644 --- a/config/nocloud/user-data +++ b/config/nocloud/user-data @@ -300,6 +300,21 @@ autoinstall: # apt-get install -y wsdd # systemctl enable wsdd.service --now + # --- create bases --- + - | + set -x + export PATH="$PATH:/opt/1cv8/x86_64/current" + export DB_ADDR=localhost + export CLUSTER_ADDR=localhost + export CLUSTER_ID=$(rac cluster list $CLUSTER_ADDR | rg -e "^cluster\s*:" -m 1 | rg -e "[[:xdigit:]-]{36}" -o) + rac infobase --cluster=$CLUSTER_ID create --create-database --name=test1 --dbms=PostgreSQL --db-server=$DB_ADDR --db-name=test1 --locale=ru --db-user=postgres --db-pwd=postgres --license-distribution=allow $CLUSTER_ADDR + rac infobase --cluster=$CLUSTER_ID create --create-database --name=test2 --dbms=PostgreSQL --db-server=$DB_ADDR --db-name=test2 --locale=ru --db-user=postgres --db-pwd=postgres --license-distribution=allow $CLUSTER_ADDR + rac infobase --cluster=$CLUSTER_ID create --create-database --name=test3 --dbms=PostgreSQL --db-server=$DB_ADDR --db-name=test3 --locale=ru --db-user=postgres --db-pwd=postgres --license-distribution=allow $CLUSTER_ADDR + + sudo -u admin1c sh -exc "cd /home/admin1c/webpub1c && . venv/bin/activate && python webpub1c.py add_module && python webpub1c.py add test1 && python webpub1c.py add test2 && python webpub1c.py add test3" + systemctl restart apache2 + + # --- final --- - | set -x