1
0
Fork 0
This commit is contained in:
Ilya Mukhortov 2023-11-24 20:56:50 +10:00
parent f21b9adc64
commit 5ce5251a91
4 changed files with 11 additions and 37 deletions

7
medicine-remd/install.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
docker exec -i medicine-stack-postgres psql -c 'CREATE DATABASE medicine_remd' --username=postgres
echo "readonly" | docker login docker.med-logic.ru --username readonly --password-stdin
docker pull docker.med-logic.ru/medicine-remd:latest
docker-compose run --rm medicine-remd python manage.py post_install
docker-compose up -d

4
medicine-remd/restart.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
docker-compose stop
docker-compose up -d

View File

@ -1,35 +0,0 @@
#!/bin/sh
set -e
COMMAND="$1"
ARGUMENT="$2"
create_database() {
docker exec -i medicine-stack-postgres psql -c 'CREATE DATABASE medicine_remd' --username=postgres
}
drop_database() {
docker exec -i medicine-stack-postgres psql -c 'DROP DATABASE medicine_remd' --username=postgres
}
install() {
echo "readonly" | docker login docker.med-logic.ru --username readonly --password-stdin
docker pull docker.med-logic.ru/medicine-remd:latest
docker-compose run --rm medicine-remd python manage.py post_install
docker-compose up -d
}
update() {
echo "readonly" | docker login docker.med-logic.ru --username readonly --password-stdin
docker pull docker.med-logic.ru/medicine-remd:latest
docker-compose run --rm medicine-remd python manage.py migrate --noinput
docker-compose run --rm medicine-remd python manage.py catalog_loaddata
docker-compose stop
docker-compose up -d
docker rmi $(docker images -f "dangling=true" -q)
}
${COMMAND}

View File

@ -6,8 +6,6 @@ cd /root/medicine-config/medicine-remd
echo "readonly" | docker login docker.med-logic.ru --username readonly --password-stdin echo "readonly" | docker login docker.med-logic.ru --username readonly --password-stdin
docker pull docker.med-logic.ru/medicine-remd:latest docker pull docker.med-logic.ru/medicine-remd:latest
docker-compose run --rm medicine-remd python manage.py migrate --noinput
docker-compose run --rm medicine-remd python manage.py load_sync_config
docker-compose stop docker-compose stop
docker-compose up -d docker-compose up -d