diff --git a/bash_scripts/install-base.sh b/bash_scripts/install-base.sh index 0183210..d131385 100755 --- a/bash_scripts/install-base.sh +++ b/bash_scripts/install-base.sh @@ -1,12 +1,6 @@ set -e -echo "readonly" | docker login docker.med-logic.ru --username readonly --password-stdin - -docker pull docker.med-logic.ru/medicine-nginx:latest -docker pull docker.med-logic.ru/medicine-app:latest -docker pull docker.med-logic.ru/tfoms-patient:latest - NETWORK_NAME=medicine-network if [ -z $(docker network ls --filter name=^${NETWORK_NAME}$ --format="{{ .Name }}") ] ; then docker network create ${NETWORK_NAME} ; @@ -15,18 +9,10 @@ fi cd /root/medicine-config/thirdparty-apps docker-compose pull docker-compose build +docker-compose up -d cd /root/medicine-config/medicine-stack docker-compose up -d sleep 10 docker-compose exec postgres psql -c 'CREATE DATABASE medicine' --username=postgres -docker-compose exec postgres psql -c 'CREATE DATABASE tfoms_patient' --username=postgres - docker-compose exec postgres psql -d medicine -c "CREATE ROLE readonly; GRANT USAGE ON SCHEMA public TO readonly; GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly; CREATE USER readonly_user WITH PASSWORD 'readonly_password'; GRANT readonly TO readonly_user; ALTER ROLE readonly WITH LOGIN;" --username=postgres - -cd /root/medicine-config/thirdparty-apps -docker-compose up -d - -cd /root/medicine-config/tfoms-patient -docker-compose up -d -docker-compose run --rm app bash -c "(cd /app/tfoms && flask db upgrade)" diff --git a/bash_scripts/install-remd.sh b/bash_scripts/install-remd.sh index cccdf38..bf55104 100755 --- a/bash_scripts/install-remd.sh +++ b/bash_scripts/install-remd.sh @@ -8,5 +8,6 @@ cd /root/medicine-config/medicine-stack docker-compose exec postgres psql -c 'CREATE DATABASE medicine_remd' --username=postgres cd /root/medicine-config/medicine-remd +docker-compose run --rm medicine-remd python manage.py migrate docker-compose run --rm medicine-remd python manage.py post_install docker-compose up -d diff --git a/bash_scripts/install_old.sh b/bash_scripts/install_old.sh new file mode 100755 index 0000000..0183210 --- /dev/null +++ b/bash_scripts/install_old.sh @@ -0,0 +1,32 @@ + +set -e + +echo "readonly" | docker login docker.med-logic.ru --username readonly --password-stdin + +docker pull docker.med-logic.ru/medicine-nginx:latest +docker pull docker.med-logic.ru/medicine-app:latest +docker pull docker.med-logic.ru/tfoms-patient:latest + +NETWORK_NAME=medicine-network +if [ -z $(docker network ls --filter name=^${NETWORK_NAME}$ --format="{{ .Name }}") ] ; then + docker network create ${NETWORK_NAME} ; +fi + +cd /root/medicine-config/thirdparty-apps +docker-compose pull +docker-compose build + +cd /root/medicine-config/medicine-stack +docker-compose up -d +sleep 10 +docker-compose exec postgres psql -c 'CREATE DATABASE medicine' --username=postgres +docker-compose exec postgres psql -c 'CREATE DATABASE tfoms_patient' --username=postgres + +docker-compose exec postgres psql -d medicine -c "CREATE ROLE readonly; GRANT USAGE ON SCHEMA public TO readonly; GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly; CREATE USER readonly_user WITH PASSWORD 'readonly_password'; GRANT readonly TO readonly_user; ALTER ROLE readonly WITH LOGIN;" --username=postgres + +cd /root/medicine-config/thirdparty-apps +docker-compose up -d + +cd /root/medicine-config/tfoms-patient +docker-compose up -d +docker-compose run --rm app bash -c "(cd /app/tfoms && flask db upgrade)"