diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f3713843dd321f41b4b67701fda4464fe634954f..6906fb791f9e7b6a8d4ecd19992ff3bd519a51a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,7 +30,7 @@ docker-test-build: - docker push $CI_REGISTRY_IMAGE$DOCKER_IMAGE_TAG -docker-build-master: +docker-build-main: # Official docker image. image: docker$DOCKER_BUILD_IMAGE_TAG stage: build @@ -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" - echo "Application deployed" when: manual - only: - - main + docker-deploy-main-production: # image: docker:latest @@ -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" - echo "Application deployed" when: manual - only: - - main + diff --git a/database/database.py b/database/database.py index 05678a8deec4ec9f2d1d198a011807f9b1599dfb..048201df4c8a1b78821929c32a8edd97170f8ab0 100644 --- a/database/database.py +++ b/database/database.py @@ -8,7 +8,7 @@ from sqlalchemy.orm import sessionmaker # DATABASE_URL = "postgresql://postgres:secret@145.38.187.31/adex_cache" # 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) engine = create_engine( diff --git a/database/models.py b/database/models.py index dc7c9eb85fdd4128a690739871d32ec812e83a13..d6148719e358a4eaac03ed924271c4ec87869a86 100644 --- a/database/models.py +++ b/database/models.py @@ -4,7 +4,8 @@ from .database import Base # sql alchemy model 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) pid = Column(String) name = Column(String) diff --git a/docker/docker-compose-dev-cd.yml b/docker/docker-compose-dev-cd.yml index decf89be3afc023d0cb413e612e70dac43dcabab..24929da0787567c1e51f6f5b7d52617800cd8c68 100644 --- a/docker/docker-compose-dev-cd.yml +++ b/docker/docker-compose-dev-cd.yml @@ -20,7 +20,7 @@ services: - traefik_proxy - adex_network env_file: - - $HOME/shared/adex_backend.env + - $HOME/shared/adex_backend_fastapi.env volumes: - $HOME/shared:/shared - adex-cache-db:/var/lib/postgresql/data @@ -47,7 +47,7 @@ services: depends_on: - adex-cache-db env_file: - - $HOME/shared/adex_backend.env + - $HOME/shared/adex_backend_fastapi.env restart: always volumes: diff --git a/main.py b/main.py index 3ba56cade57866668304dfd893ed91f808492972..33caf5e58feff321e2410d823d8bfb586774c17d 100644 --- a/main.py +++ b/main.py @@ -9,7 +9,7 @@ from routers import skyviews app = FastAPI( title="ADEX backend", description="ADEX backend FastAPI", - version="0.0.1", + version="1.0.0", docs_url='/adex-fastapi/docs', redoc_url='/adex-fastapi/redoc', openapi_url='/adex-fastapi/openapi.json', diff --git a/run.bat b/run.bat index 76ea2dfabb42ced29be00701422d3be1adb8f576..bff0aa32f0fb95e74bb4a831711a5705878556c9 100644 --- a/run.bat +++ b/run.bat @@ -1 +1,2 @@ +SET DATABASE_URL=postgresql://postgres:postgres@localhost/adex_cache_django uvicorn main:app --reload \ No newline at end of file