Skip to content

Commit

Permalink
Merge pull request #100 from maykinmedia/feature/ci-quick-start
Browse files Browse the repository at this point in the history
check quick start in CI
  • Loading branch information
annashamray committed Dec 29, 2020
2 parents 1c80eeb + 2022fa7 commit ba84592
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 19 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/quick_start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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/master/docker-compose-quickstart.yml -O docker-compose-qs.yml
- name: Start docker containers
run: docker-compose -f docker-compose-qs.yml up -d
- name: Wait until DB container starts
run: sleep 10
- name: Load fixtures
run: docker-compose -f docker-compose-qs.yml exec -T web src/manage.py loaddata demodata
- 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" >&2
exit 1
fi
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ ENV DJANGO_SETTINGS_MODULE=objects.conf.docker

ARG SECRET_KEY=dummy

# copy fixtures
COPY src/objects/fixtures /app/src/fixtures

# Run collectstatic, so the result is already included in the image
RUN python src/manage.py collectstatic --noinput

Expand Down
5 changes: 3 additions & 2 deletions README.NL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ Quickstart
.. code:: bash
$ wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose.yml
$ docker-compose up -d
$ docker-compose -f docker-compose-qs.yml up -d
$ docker-compose exec web src/manage.py loaddata demodata
$ docker-compose exec web src/manage.py createsuperuser
2. In de browser, navigeer naar ``http://localhost:8000/`` om de admin en de
2. In de browser, navigeer naar ``http://localhost:8000/`` om de admin en de
API te benaderen.


Expand Down
9 changes: 5 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Reference implementation

|build-status| |coverage| |black| |docker| |python-versions|

The reference implementation is used to demonstrate the API in action and can
The reference implementation is used to demonstrate the API in action and can
be used for test and demo purposes. The reference implementation is open source,
well tested and available as Docker image.

Expand All @@ -57,11 +57,12 @@ Quickstart

.. code:: bash
$ wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose.yml
$ docker-compose up -d
$ wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml
$ docker-compose -f docker-compose-qs.yml up -d
$ docker-compose exec web src/manage.py loaddata demodata
$ docker-compose exec web src/manage.py createsuperuser
2. In the browser, navigate to ``http://localhost:8000/`` to access the admin
2. In the browser, navigate to ``http://localhost:8000/`` to access the admin
and the API.


Expand Down
20 changes: 10 additions & 10 deletions docs/installation/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Quickstart
==========

A simple ``docker-compose-quickstart.yml`` file is available to get the API's
up and running in minutes. This file has some convenience settings to get
up and running in minutes. This file has some convenience settings to get
started quickly and these should never be used for anything besides testing:

* A default secret is set in the ``SECRET_KEY`` environment variable
Expand All @@ -31,25 +31,25 @@ Objecttypes API

.. code:: shell
$ wget https://raw.githubusercontent.com/maykinmedia/objecttypes-api/master/docker-compose-quickstart.yml -O docker-compose.yml
$ wget https://raw.githubusercontent.com/maykinmedia/objecttypes-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml
.. tab:: Windows Powershell 3

.. code:: shell
PS> wget https://raw.githubusercontent.com/maykinmedia/objecttypes-api/master/docker-compose-quickstart.yml -Odocker-compose.yml
PS> wget https://raw.githubusercontent.com/maykinmedia/objecttypes-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml
3. Start the Docker containers:

.. code:: shell
$ docker-compose up -d
$ docker-compose -f docker-compose-qs.yml up -d
4. Import a demo set of objecttypes:

.. code:: shell
$ docker-compose -f docker-compose-quickstart.yml exec web src/manage.py loaddata demodata
$ docker-compose exec web src/manage.py loaddata demodata
Objects API
-----------
Expand All @@ -69,19 +69,19 @@ Objects API

.. code:: shell
$ wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose.yml
$ wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml
.. tab:: Windows Powershell 3

.. code:: shell
PS> wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -Odocker-compose-quickstart.yml
PS> wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml
3. Start the Docker containers:

.. code:: shell
$ docker-compose up -d
$ docker-compose -f docker-compose-qs.yml up -d
4. Import a demo set of objects (linking to the demo objecttypes):

Expand All @@ -91,9 +91,9 @@ Objects API
5. Retrieve an object via the Objects API in your webbrowser:

.. code::
.. code::
http://localhost:8000/api/v1/objects/
TODO: Auth, fixtures, objects...
TODO: Auth, fixtures, objects...

0 comments on commit ba84592

Please sign in to comment.