Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[maykinmedia/open-api-framework#100] Add quick-start.yml #229

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/quick-start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Quick Start

on:
push:
branches:
- master
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:
open-api-workflow-quick-start:
uses: maykinmedia/open-api-workflows/.github/workflows/quick-start.yml@feature/add-quick-start
with:
superuser: 'open-admin'
13 changes: 9 additions & 4 deletions bin/setup_configuration.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#!/bin/bash

# setup initial configuration using environment variables
# setup initial configuration using a yaml file
# Run this script from the root of the repository

#set -e
set -e

src/manage.py migrate
src/manage.py setup_configuration --yaml-file setup_configuration/data.yaml
if [[ "${RUN_SETUP_CONFIG,,}" =~ ^(true|1|yes)$ ]]; then
# wait for required services
/wait_for_db.sh

src/manage.py migrate
src/manage.py setup_configuration --yaml-file setup_configuration/data.yaml
fi
38 changes: 21 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ services:
web:
build: .
environment: &app-env
- DJANGO_SETTINGS_MODULE=nrc.conf.docker
- SECRET_KEY=${SECRET_KEY:-\(,gc7VE(#CO<zCR3e(lRtOsw5q+U2DpG5o\X#P4PVRm*=u|E%}
- IS_HTTPS=no
- ALLOWED_HOSTS=*
- CACHE_DEFAULT=redis:6379/0
- CACHE_AXES=redis:6379/1
- RABBITMQ_HOST=rabbitmq
- PUBLISH_BROKER_URL=amqp://guest:guest@rabbitmq:5672/%2F
- CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672//
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- CELERY_LOGLEVEL=DEBUG
- CELERY_WORKER_CONCURRENCY=${CELERY_WORKER_CONCURRENCY:-4}
- SUBPATH=${SUBPATH:-/}
- OPENNOTIFICATIES_SUPERUSER_USERNAME=admin
- OPENNOTIFICATIES_SUPERUSER_EMAIL=admin@localhost
- DJANGO_SUPERUSER_PASSWORD=admin
DJANGO_SETTINGS_MODULE: nrc.conf.docker
SECRET_KEY: ${SECRET_KEY:-\(,gc7VE(#CO<zCR3e(lRtOsw5q+U2DpG5o\X#P4PVRm*=u|E%}
IS_HTTPS: no
ALLOWED_HOSTS: '*'
CACHE_DEFAULT: redis:6379/0
CACHE_AXES: redis:6379/1
RABBITMQ_HOST: rabbitmq
PUBLISH_BROKER_URL: amqp://guest:guest@rabbitmq:5672/%2F
CELERY_BROKER_URL: amqp://guest:guest@rabbitmq:5672//
CELERY_RESULT_BACKEND: redis://redis:6379/1
CELERY_LOGLEVEL: DEBUG
CELERY_WORKER_CONCURRENCY: ${CELERY_WORKER_CONCURRENCY:-4}
SUBPATH: ${SUBPATH:-/}
OPENNOTIFICATIES_SUPERUSER_USERNAME: admin
OPENNOTIFICATIES_SUPERUSER_EMAIL: admin@localhost
DJANGO_SUPERUSER_PASSWORD: admin
healthcheck:
test: ["CMD", "python", "-c", "import requests; exit(requests.head('http://localhost:8000/admin/').status_code not in [200, 302])"]
interval: 30s
Expand All @@ -56,7 +56,11 @@ services:

web-init:
build: .
environment: *app-env
environment:
<<: *app-env
#
# Django-setup-configuration
RUN_SETUP_CONFIG: ${RUN_SETUP_CONFIG:-true}
command: /setup_configuration.sh
depends_on:
- db
Expand Down