diff --git a/README.md b/README.md index 1dea0b70d1550b11bcbf38a7f856730a490bc6f9..24716340709af59eee83d2ad2c2365b050eb9ae8 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,19 @@ These diagrams show the current implementation and are kept up-to-date.  -## Test Environment on sdc-dev.astron.nl: +## Deployed Instances ### main GUI: - * https://sdc.astron.nl:5554/atdb/ + * test: https://sdc-dev.astron.nl:5554/atdb/ + * acc : http://dop457.astron.nl:5554/atdb/ + * prod: https://sdc.astron.nl:5554/atdb/ ### admin interface: - * https://sdc.astron.nl:5554/atdb/admin/ + * test: https://sdc-dev.astron.nl:5554/atdb/admin/ + * acc : http://dop457.astron.nl:5554/atdb/admin/ + * prod: https://sdc.astron.nl:5554/atdb/admin/ -### REST API +### REST API (prod) serializers: * workflows: http://sdc.astron.nl:5554/atdb/workflows/ * tasks: http://sdc.astron.nl:5554/atdb/tasks/ @@ -56,11 +60,31 @@ Return the sum the sizes of all tasks with a given list of statusses  ### CI/CD (semi) automatic deploy in Docker -For the `master` branch there is a CI/CD pipeline in place which builds and deploys the backend at https://sdc.astron.nl:5554/atdb/ +A gitlab CI/CD pipeline will automatically build and semi-automatically deploy ATDB on several targets, + depending on the name of the branch. + + * `master` => test: https://sdc-dev.astron.nl:5554/atdb/ + * `acceptance`=> acceptance: http://dop457.astron.nl:5554/atdb/ + * `release` => prod: https://sdc.astron.nl:5554/atdb/ The deploy step requires pushing the 'play' button in the gitlab pipelines section. This is done to not have a mandatory deploy for every minor commmit. +## The Procedure: + * commit changes to 'feature branch' + * gitlab: merge with `master` + * pipeline will start running: https://git.astron.nl/astron-sdc/atdb-ldv/-/pipelines + * if 'passed' then click `>>` on the 'deploy' stage, this will deploy to test on sdc-dev + + * gitlab: merge with `acceptance` + * pipeline will start running: https://git.astron.nl/astron-sdc/atdb-ldv/-/pipelines + * if 'passed' then click `>>` on the 'deploy' stage, this will deploy to acceptance on dop457 + + * gitlab: merge with `release` + * pipeline will start running: https://git.astron.nl/astron-sdc/atdb-ldv/-/pipelines + * if 'passed' then click `>>` on the 'deploy' stage, this will deploy to production on sdc + + ### Manual deploy in Docker (alternative to CI/CD) #### initial @@ -94,24 +118,11 @@ This is the procedure for that. - when automatic build is finished, push >> to deploy - on sdc machine: + on 'test', 'acc' and 'prod' machine's: > docker exec -it atdb-ldv python manage.py makemigrations --settings atdb.settings.docker_sdc > docker exec -it atdb-ldv python manage.py migrate --settings atdb.settings.docker_sdc - -## Postgres Database operations - -### dump a copy of the database - > cd $HOME/shared - > docker exec -it atdb-ldv-postgres pg_dump -U postgres -O atdbldv > atdb_ldv.sql - -### load a database (warning, this overwrites the database) - > docker exec -it atdb-ldv-postgres psql --command "drop database atdbldv" - > docker exec -it atdb-ldv-postgres psql --command "create database atdbldv" - > docker exec -it atdb-ldv-postgres psql -U postgres atdbldv -f /shared/atdb_ldv.sql - > docker exec atdb-ldv-postgres psql --command "grant ALL ON DATABASE atdbldv TO dbadmin;" - ## Original ATDB Context diagrams Similar diagram for ATDB-LDV will follow, showing the relationships with external services diff --git a/atdb/atdb/settings/docker_sdc.py b/atdb/atdb/settings/docker_sdc.py index bdb7cda51cc67b4e968e9339d04568a7297f7f92..24bd00da07d08bd5f2cae67b5ec55249a9b822ce 100644 --- a/atdb/atdb/settings/docker_sdc.py +++ b/atdb/atdb/settings/docker_sdc.py @@ -2,7 +2,10 @@ from atdb.settings.base import * import os # Import production setting must remain False. -DEBUG = False +try: + DEBUG = os.environ['DEBUG'] +except: + DEBUG = False ALLOWED_HOSTS = ["*"] diff --git a/atdb/run.bat b/atdb/run.bat new file mode 100644 index 0000000000000000000000000000000000000000..b428ce925c06e0abed59a1a7ff7396c680dae321 --- /dev/null +++ b/atdb/run.bat @@ -0,0 +1,7 @@ +SET DEBUG=True +SET DATABASE_HOST=localhost +SET DATABASE_PORT=5432 +SET DATABASE_NAME=atdb_ldv +SET DATABASE_USER=atdb_admin +SET DATABASE_PASSWORD=atdb123 +python manage.py runserver --settings=atdb.settings.dev diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index ce00b59cb75b4234e9f4add80aab39388831def5..6720e219c97566e34337f2f6ad97db86d225900f 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -44,7 +44,7 @@ </div> {% include 'taskdatabase/pagination.html' %} </div> - <p class="footer"> Version 1.0.0 (12 feb 2021 - 11:00) + <p class="footer"> Version 1.0.0 (12 feb 2021 - 15:00) <script type="text/javascript"> (function(seconds) { var refresh,