Skip to content

Commit

Permalink
Update workflow and localtemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
hipek8 committed Dec 13, 2024
1 parent a601a0e commit d97c2cc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 19 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v2

- name: Install system packages
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev libssl-dev
env:
DEBIAN_FRONDEND: NONINTERACTIVE

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Upgrade pip
run: pip3 install -U pip

- name: Cache pip dependencies
uses: actions/cache@v2
with:
Expand All @@ -30,6 +39,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ralph's python dependencies
run: pip3 install -r "${GITHUB_WORKSPACE}/requirements/dev.txt"

Expand Down Expand Up @@ -86,7 +96,7 @@ jobs:
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev
sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev libssl-dev
env:
DEBIAN_FRONDEND: NONINTERACTIVE

Expand Down Expand Up @@ -134,7 +144,7 @@ jobs:
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev
sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev libssl-dev
env:
DEBIAN_FRONDEND: NONINTERACTIVE

Expand Down Expand Up @@ -223,7 +233,7 @@ jobs:
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev
sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev libssl-dev
env:
DEBIAN_FRONDEND: NONINTERACTIVE

Expand Down
46 changes: 30 additions & 16 deletions src/ralph/settings/local.template
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
from ralph.settings.dev import * # noqa

INSTALLED_APPS += ("corsheaders",)
DEBUG = True
MIDDLEWARE = MIDDLEWARE + ("corsheaders.middleware.CorsMiddleware",)

CORS_ORIGIN_WHITELIST = (
"https://localhost:8080",
"https://127.0.0.1:8080",
)

POSTGRES = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('DATABASE_NAME', 'ralph_ng'),
'USER': os.environ.get('DATABASE_USER', 'ralph_ng'),
'PASSWORD': os.environ.get('DATABASE_PASSWORD', 'ralph_ng') or None,
'HOST': os.environ.get('DATABASE_HOST', '127.0.0.1'),
'PORT': os.environ.get('DATABASE_PORT', 3306),
'ATOMIC_REQUESTS': True,
'TEST': {
'NAME': 'test_ralph_ng',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': os.environ.get('DATABASE_USER', 'ralph_ng'),
'PASSWORD': os.environ.get('DATABASE_PASSWORD', 'ralph_ng') or None,
'HOST': os.environ.get('DATABASE_HOST', '127.0.0.1'),
'PORT': os.environ.get('DATABASE_PORT', 3306),
}
"default": {
"ENGINE": "django.db.backends.postgresql"
if POSTGRES
else "django.db.backends.mysql",
"NAME": os.environ.get("DATABASE_NAME", "ralph_ng"),
"USER": os.environ.get("DATABASE_USER", "ralph_ng"),
"PASSWORD": os.environ.get("DATABASE_PASSWORD", "ralph_ng") or None,
"HOST": os.environ.get("DATABASE_HOST", "127.0.0.1"),
"PORT": 54320 if POSTGRES else 3306,
"ATOMIC_REQUESTS": False,
"TEST": {
"NAME": "test_ralph_ng",
"ENGINE": "django.db.backends.postgresql"
if POSTGRES
else "django.db.backends.mysql",
"USER": os.environ.get("DATABASE_USER", "ralph_ng"),
"PASSWORD": os.environ.get("DATABASE_PASSWORD", "ralph_ng") or None,
"HOST": os.environ.get("DATABASE_HOST", "127.0.0.1"),
"PORT": os.environ.get("DATABASE_PORT", 5432 if POSTGRES else 3306),
},
}
}

Expand Down

0 comments on commit d97c2cc

Please sign in to comment.