diff --git a/.db-env b/.db-env index d5a81db..04f24d5 100644 --- a/.db-env +++ b/.db-env @@ -1,7 +1,11 @@ POSTGRES_USER=postgres +PGDATABASE=surveyDB POSTGRES_PASSWORD=makingwarmhomes POSTGRES_HOST=localhost POSTGRES_PORT=5432 PGADMIN_DEFAULT_EMAIL=junte@domna.homes PGADMIN_DEFAULT_PASSWORD=makingwarmhomes -DATABASE_URL=postgresql://postgres:makingwarmhomes@db:5432/postgres \ No newline at end of file +DATABASE_URL=postgresql://postgres:makingwarmhomes@db:5432/postgres + +# Prod(dev-aws) Database Don't use!!!! +#DATABASE_URL=postgresql://postgres:makingwarmhomes@terraform-20250331175522503500000002.cdgzupxvdyp0.eu-west-2.rds.amazonaws.com:5432/surveyDB \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 76f9ce8..823f974 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ "postStartCommand": "bash .devcontainer/post-install.sh", "mounts": [ "source=${localEnv:HOME},target=/workspaces/home,type=bind", - "source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind" + "source=${localEnv:HOME}/.aws/,target=/home/vscode/.aws/,type=bind" ], "customizations": { "vscode": { diff --git a/.github/workflows/db_migration.yml b/.github/workflows/db_migration.yml index 7c087d4..2d53c78 100644 --- a/.github/workflows/db_migration.yml +++ b/.github/workflows/db_migration.yml @@ -1 +1,34 @@ -# Once the database is live, I will need to do some work to ensure database migration within the local branch. Will add the code here \ No newline at end of file +name: Run on Database Migration on Production (aws-dev) + +on: + push: + branches: + - main + +jobs: + db_migration: + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + - name: Install dependencies + run: | + pip install poetry + poetry install --no-root + - name: run script + run: | + poetry run alembic upgrade head + env: + PYTHONPATH: ${{ github.workspace }} + DATABASE_URL: postgresql://postgres:makingwarmhomes@terraform-20250331175522503500000002.cdgzupxvdyp0.eu-west-2.rds.amazonaws.com:5432/surveyDB + SOUTH_COAST_INSULATION_SERVICE_SHAREPOINT_ID: ${{ secrets.SOUTH_COAST_INSULATION_SERVICE_SHAREPOINT_ID }} + JJC_SERVICE_SHAREPOINT_ID: ${{ secrets.JJC_SERVICE_SHAREPOINT_ID }} + BAXTER_KELLY_SERVICE_SHAREPOINT_ID: ${{ secrets.BAXTER_KELLY_SERVICE_SHAREPOINT_ID }} + SGEC_SERVICE_SHAREPOINT_ID: ${{ secrets.SGEC_SERVICE_SHAREPOINT_ID }} + SHAREPOINT_CLIENT_ID: ${{ secrets.SHAREPOINT_CLIENT_ID }} + SHAREPOINT_CLIENT_SECRET: ${{ secrets.SHAREPOINT_CLIENT_SECRET }} + SHAREPOINT_TENANT_ID: ${{ secrets.SHAREPOINT_TENANT_ID }} \ No newline at end of file