Skip to content
Snippets Groups Projects
Commit a5adbd13 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

Merge branch 'hookup-to-django' into 'main'

Hookup to django

See merge request !6
parents 7910df3d 93f74f58
No related branches found
No related tags found
1 merge request!6Hookup to django
Pipeline #40644 passed with warnings
...@@ -30,7 +30,7 @@ docker-test-build: ...@@ -30,7 +30,7 @@ docker-test-build:
- docker push $CI_REGISTRY_IMAGE$DOCKER_IMAGE_TAG - docker push $CI_REGISTRY_IMAGE$DOCKER_IMAGE_TAG
docker-build-master: docker-build-main:
# Official docker image. # Official docker image.
image: docker$DOCKER_BUILD_IMAGE_TAG image: docker$DOCKER_BUILD_IMAGE_TAG
stage: build stage: build
...@@ -82,8 +82,7 @@ docker-deploy-main-test: ...@@ -82,8 +82,7 @@ docker-deploy-main-test:
- ssh -o StrictHostKeyChecking=no sdc@dop814.astron.nl "docker-compose -p adex-backend -f /docker_compose/adex-backend-fastapi/docker-compose-dev-cd.yml up -d" - ssh -o StrictHostKeyChecking=no sdc@dop814.astron.nl "docker-compose -p adex-backend -f /docker_compose/adex-backend-fastapi/docker-compose-dev-cd.yml up -d"
- echo "Application deployed" - echo "Application deployed"
when: manual when: manual
only:
- main
docker-deploy-main-production: docker-deploy-main-production:
# image: docker:latest # image: docker:latest
...@@ -122,6 +121,5 @@ docker-deploy-main-production: ...@@ -122,6 +121,5 @@ docker-deploy-main-production:
- ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker-compose -p adex-backend -f /opt/dockercompose/adex-backend-fastapi/docker-compose-production-cd.yml up -d" - ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker-compose -p adex-backend -f /opt/dockercompose/adex-backend-fastapi/docker-compose-production-cd.yml up -d"
- echo "Application deployed" - echo "Application deployed"
when: manual when: manual
only:
- main
...@@ -8,7 +8,7 @@ from sqlalchemy.orm import sessionmaker ...@@ -8,7 +8,7 @@ from sqlalchemy.orm import sessionmaker
# DATABASE_URL = "postgresql://postgres:secret@145.38.187.31/adex_cache" # DATABASE_URL = "postgresql://postgres:secret@145.38.187.31/adex_cache"
# read from environment # read from environment
DATABASE_URL = os.environ.get('DATABASE_URL', 'postgresql://postgres:postgres@localhost/adex_cache') DATABASE_URL = os.environ.get('DATABASE_URL', 'postgresql://postgres:postgres@localhost/adex_cache_fastapi')
print('DATABASE_URL = '+DATABASE_URL) print('DATABASE_URL = '+DATABASE_URL)
engine = create_engine( engine = create_engine(
......
...@@ -4,7 +4,8 @@ from .database import Base ...@@ -4,7 +4,8 @@ from .database import Base
# sql alchemy model # sql alchemy model
class SkyView(Base): class SkyView(Base):
__tablename__ = "skyviews" #__tablename__ = "skyviews" # using the adex_cache_fastapi.skyviews table
__tablename__ = "adex_cache_skyview" # using the adex_cache_django.adex_cache_skyview table
id = Column(Integer, primary_key=True, index=True) id = Column(Integer, primary_key=True, index=True)
pid = Column(String) pid = Column(String)
name = Column(String) name = Column(String)
......
...@@ -20,7 +20,7 @@ services: ...@@ -20,7 +20,7 @@ services:
- traefik_proxy - traefik_proxy
- adex_network - adex_network
env_file: env_file:
- $HOME/shared/adex_backend.env - $HOME/shared/adex_backend_fastapi.env
volumes: volumes:
- $HOME/shared:/shared - $HOME/shared:/shared
- adex-cache-db:/var/lib/postgresql/data - adex-cache-db:/var/lib/postgresql/data
...@@ -47,7 +47,7 @@ services: ...@@ -47,7 +47,7 @@ services:
depends_on: depends_on:
- adex-cache-db - adex-cache-db
env_file: env_file:
- $HOME/shared/adex_backend.env - $HOME/shared/adex_backend_fastapi.env
restart: always restart: always
volumes: volumes:
......
...@@ -9,7 +9,7 @@ from routers import skyviews ...@@ -9,7 +9,7 @@ from routers import skyviews
app = FastAPI( app = FastAPI(
title="ADEX backend", title="ADEX backend",
description="ADEX backend FastAPI", description="ADEX backend FastAPI",
version="0.0.1", version="1.0.0",
docs_url='/adex-fastapi/docs', docs_url='/adex-fastapi/docs',
redoc_url='/adex-fastapi/redoc', redoc_url='/adex-fastapi/redoc',
openapi_url='/adex-fastapi/openapi.json', openapi_url='/adex-fastapi/openapi.json',
......
SET DATABASE_URL=postgresql://postgres:postgres@localhost/adex_cache_django
uvicorn main:app --reload uvicorn main:app --reload
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment