From 9d3fdf5bb7897739a5fadc2b46271f0983c37884 Mon Sep 17 00:00:00 2001 From: Sergiotarxz Date: Sat, 1 Jul 2023 04:48:33 +0200 Subject: [PATCH] Adding docker actions for database migrations. --- CONTRIBUTING.md | 25 +++++++++++++++++++++++-- install_docker.sh | 2 ++ prepare_docker.sh | 2 ++ upgrade_docker.sh | 2 ++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 install_docker.sh create mode 100644 prepare_docker.sh create mode 100644 upgrade_docker.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9713e6..034fc7f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,8 +54,29 @@ bash start_docker.sh The first time you execute this the database migrations won't be applied but we are going to solve this soon. -As soon as the application is already listening interrupt -the process and +As soon as the application is already listening open +a new terminal and execute the following command to install +the database migrations. + +```shell +bash install_docker.sh +``` + +It is very important that all the docker actions are +done when the container is started otherwise they +will throw error and do nothing. + +### Creating new migrations. + +```shell +bash prepare_docker.sh +``` + +### Upgrading the database with the new migrations. + +```shell +bash upgrade_docker.sh +``` ## Installing diff --git a/install_docker.sh b/install_docker.sh new file mode 100644 index 0000000..55ff870 --- /dev/null +++ b/install_docker.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo docker exec LasTresDocker bash -c 'source ~/.profile && perl /var/lib/las_tres/LasTres/script/install.pl' diff --git a/prepare_docker.sh b/prepare_docker.sh new file mode 100644 index 0000000..6fa7b85 --- /dev/null +++ b/prepare_docker.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo docker exec LasTresDocker bash -c 'source ~/.profile && perl /var/lib/las_tres/LasTres/script/prepare.pl' diff --git a/upgrade_docker.sh b/upgrade_docker.sh new file mode 100644 index 0000000..149298a --- /dev/null +++ b/upgrade_docker.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo docker exec LasTresDocker bash -c 'source ~/.profile && perl /var/lib/las_tres/LasTres/script/upgrade.pl'