Skip to content
Snippets Groups Projects
Commit 4b607871 authored by Benjamin Ledel's avatar Benjamin Ledel
Browse files

* fix tests

parent 9f3242d8
No related branches found
No related tags found
No related merge requests found
Pipeline #1640303 failed
......@@ -42,12 +42,6 @@ docker compose ps
After that you should be able to visit http://localhost:8004/ and see the rights engine.
### Migrate rights-engine database (only required once after first start) and create mongo db index
```bash
docker compose exec -it rights-engine sh -c 'python3 manage.py sqlflush | sed s/TRUNCATE/DROP\ TABLE\ IF\ EXISTS/g | python3 manage.py dbshell && echo DROP\ TABLE\ IF\ EXISTS\ django_migrations\; | python3 manage.py dbshell && python3 manage.py migrate && python3 manage.py loaddata fixtures/initial_db.json && python3 manage.py create_mongo_index'
```
### Migrate analytics-engine database (only required once after first start)
```bash
......@@ -227,12 +221,6 @@ See section `Installing Traefik`
$ docker compose up -d
```
#### 7. Migrate DB
```console
$ docker compose exec -it rights-engine sh -c 'python3 manage.py sqlflush | sed s/TRUNCATE/DROP\ TABLE\ IF\ EXISTS/g | python3 manage.py dbshell && echo DROP\ TABLE\ IF\ EXISTS\ django_migrations\; | python3 manage.py dbshell && python3 manage.py migrate && python3 manage.py loaddata fixtures/initial_db.json'
```
### Analytics Engine VM setup
#### 1. Clone deployment repository
......
......@@ -69,7 +69,10 @@ RUN cd frontend && npm run build
ENV VIRTUAL_ENV=/env
ENV PATH=/env/bin:$PATH
# Gunicorn Server
CMD ["gunicorn", "--bind", ":80", "--workers", "3", "--timeout", "240", "--access-logfile", "-", "--error-logfile", "-", "backend.wsgi"]
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Use entrypoint script to start the container
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 80
#!/bin/sh
echo "Running database migrations and role setup..."
python manage.py check_and_apply_migrations
echo "Starting Gunicorn server..."
exec gunicorn --bind :80 --workers 3 --timeout 240 --access-logfile - --error-logfile - backend.wsgi
......@@ -23,7 +23,6 @@ class ProviderTestCase(TestCase):
normal_user = CustomUser.objects.create_user(self.test_user_email, self.test_user_password)
provider_user = CustomUser.objects.create_user(self.test_provider_email, self.test_provider_password)
assign_role(provider_user, 'provider')
assign_role(normal_user, 'user')
assign_role(provider_user, 'provider_manager')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment