Skip to content

Commit c21a9b4

Browse files
committed
Remove config files and create alembic workflow
1 parent efe6e59 commit c21a9b4

File tree

10 files changed

+48
-244
lines changed

10 files changed

+48
-244
lines changed

.github/workflows/alembic.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Alembic Upgrade Head
2+
on: pull_request
3+
4+
jobs:
5+
alembic_upgrade_head:
6+
runs-on: ubuntu-latest
7+
8+
services:
9+
postgres:
10+
image: postgres:latest
11+
ports:
12+
- 5432:5432
13+
options: >-
14+
--health-cmd "pg_isready -U postgres"
15+
--health-interval 10s
16+
--health-timeout 5s
17+
--health-retries 5
18+
env:
19+
POSTGRES_USER: csss-site
20+
POSTGRES_DB: main
21+
POSTGRES_HOST_AUTH_METHOD: trust
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Wait for PostgreSQL to be ready
27+
run: |
28+
until pg_isready -h localhost -p 5432 -U csss-site; do
29+
echo "Waiting for PostgreSQL..."
30+
sleep 1
31+
done
32+
33+
- name: Install dependencies
34+
run: |
35+
sudo apt-get install python3.11 python3.11-venv postgresql postgresql-contrib
36+
python3.11 -m pip install --upgrade pip
37+
python3.11 -m venv venv
38+
source ./venv/bin/activate
39+
pip install -r requirements.txt
40+
41+
- name: Run alembic upgrade head
42+
run: |
43+
source ./venv/bin/activate
44+
cd src
45+
alembic upgrade head

.github/workflows/pytest_unit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Unit Tests
22
on: pull_request
33

44
jobs:
5-
test:
5+
unit_tests:
66
runs-on: ubuntu-latest
77
timeout-minutes: 5
88

@@ -31,4 +31,4 @@ jobs:
3131
- name: Run unit tests
3232
run: |
3333
source ./venv/bin/activate
34-
pytest ./tests/unit -v
34+
pytest ./tests/unit -v

config/csss-site.service

Lines changed: 0 additions & 14 deletions
This file was deleted.

config/nginx.conf

Lines changed: 0 additions & 30 deletions
This file was deleted.

config/sudoers.conf

Lines changed: 0 additions & 2 deletions
This file was deleted.

config/update_config.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

deploy.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

fresh_setup.sh

Lines changed: 0 additions & 135 deletions
This file was deleted.

gunicorn_start.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/alembic.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ output_encoding = utf-8
3131

3232
# for local testing
3333
# sqlalchemy.url = sqlalchemy+asyncpg:///csss-site-backend
34-
sqlalchemy.url = sqlalchemy+asyncpg:///main
34+
sqlalchemy.url = sqlalchemy+asyncpg://csss-site@localhost/main
3535

3636
# Logging configuration
3737
[loggers]

0 commit comments

Comments
 (0)