-
Notifications
You must be signed in to change notification settings - Fork 10
35 lines (33 loc) · 1.46 KB
/
quick-start.yml
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
name: quick-start
on: [push]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Download docker-compose file
run: wget https://raw.githubusercontent.com/maykinmedia/objects-api/${GITHUB_REF_NAME}/docker-compose.yml
- name: Download setup-configuration data file
run: wget -P docker/setup_configuration https://raw.githubusercontent.com/maykinmedia/objects-api/${GITHUB_REF_NAME}/docker/setup_configuration/data.yaml
- name: Start docker containers
run: docker compose up -d --no-build
- name: Wait for migrations to finish
run: |
echo "Waiting for migrations to complete..."
until ! docker compose exec -T web src/manage.py showmigrations | grep -q '\[ \]'; do
echo "Migrations not finished, waiting..."
sleep 3
done
- name: Show web-init logs
run: docker compose logs web-init
- name: Load fixtures
run: docker compose exec -T web src/manage.py loaddata demodata
- name: Create superuser
run: docker compose exec -T web src/manage.py createsuperuser --username admin --email [email protected] --no-input
- name: Check main page
run: |
curl_status=$(curl -w '%{http_code}' -o /dev/null -s http://localhost:8000/)
if [[ $curl_status != 200 ]]; then
printf "Index page responds with ${curl_status} status.\r\n\r\n" >&2
curl -i http://localhost:8000
exit 1
fi