-
Notifications
You must be signed in to change notification settings - Fork 10
/
setup-uat.sh
executable file
·64 lines (53 loc) · 2.26 KB
/
setup-uat.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash -xe
# This file is used as a cmd script with an automatically built backend docker to run User Acceptance Tests against
# on circleCI. For more information about how this is used please see
# https://github.com/uktrade/data-hub-frontend#continuous-integration
es_amp=""
## If ES_APM_ENABLED is True wait for it to start
if [ "$ES_APM_ENABLED" = 'True' ] ; then
es_amp="-wait tcp://es-apm:8200"
fi
dockerize -wait tcp://postgres:5432 -wait tcp://opensearch:9200 -wait tcp://redis:6379 $es_amp
python /app/manage.py migrate
python /app/manage.py migrate_search
python /app/manage.py loadinitialmetadata --force
# TODO abstract this into a method in ./manage.py
echo "import datetime
from django.contrib.auth.models import Group
from django.utils.timezone import now
from datahub.company.models import Advisor
dit_east_midlands_id = '9010dd28-9798-e211-a939-e4115bead28a'
dit_staff_user = Advisor.objects.create_user(
email='dit_staff@datahub.com',
sso_email_user_id='dit_staff@id.test',
first_name='DIT',
last_name='Staff',
dit_team_id=dit_east_midlands_id,
)
welsh_government_id = 'bc85aa17-fabd-e511-88b6-e4115bead28a'
da_staff_user = Advisor.objects.create_user(
email='da_staff@datahub.com',
sso_email_user_id='da_staff@id.test',
first_name='DA',
last_name='Staff',
dit_team_id=welsh_government_id,
)
heart_of_the_south_west_lep_id = '08d987f8-6525-e511-b6bc-e4115bead28a'
lep_staff_user = Advisor.objects.create_user(
email='lep_staff@datahub.com',
sso_email_user_id='lep_staff@id.test',
first_name='LEP',
last_name='Staff',
dit_team_id=heart_of_the_south_west_lep_id,
)
" | /app/manage.py shell
python /app/manage.py add_access_token --skip-checks --hours 24 --token ditStaffToken dit_staff@id.test
python /app/manage.py add_access_token --skip-checks --hours 24 --token daStaffToken da_staff@id.test
python /app/manage.py add_access_token --skip-checks --hours 24 --token lepStaffToken lep_staff@id.test
python /app/manage.py loaddata --ignorenonexistent /app/fixtures/test_data.yaml
python /app/manage.py add_quote_to_order
python /app/manage.py add_invoice_to_order
python /app/manage.py set_order_as_paid
python /app/manage.py createinitialrevisions
python /app/manage.py collectstatic --noinput
DEBUG=False python app.py