mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
add postgres
This commit is contained in:
parent
ba331d44dc
commit
b991ab73f7
4 changed files with 38 additions and 3 deletions
3
.github/workflows/deploy_terraform.yml
vendored
3
.github/workflows/deploy_terraform.yml
vendored
|
|
@ -515,6 +515,9 @@ jobs:
|
|||
image_digest: ${{ needs.hubspot_etl_image.outputs.image_digest }}
|
||||
terraform_apply: ${{ needs.determine_stage.outputs.terraform_apply }}
|
||||
secrets:
|
||||
TF_VAR_db_host: ${{ secrets.DEV_DB_HOST }}
|
||||
TF_VAR_db_name: ${{ secrets.DEV_DB_NAME }}
|
||||
TF_VAR_db_port: ${{ secrets.DEV_DB_PORT }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: ${{ secrets.DEV_AWS_REGION }}
|
||||
|
|
|
|||
24
.github/workflows/unit_tests.yml
vendored
24
.github/workflows/unit_tests.yml
vendored
|
|
@ -11,6 +11,21 @@ jobs:
|
|||
name: Tests (Docker)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:15
|
||||
env:
|
||||
POSTGRES_USER: test
|
||||
POSTGRES_PASSWORD: test
|
||||
POSTGRES_DB: test
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -21,9 +36,12 @@ jobs:
|
|||
- name: Run tests
|
||||
run: |
|
||||
docker run --rm \
|
||||
--network host \
|
||||
-e EPC_AUTH_TOKEN=${{ secrets.DEV_EPC_AUTH_TOKEN }} \
|
||||
-e HUBSPOT_API_KEY=${{ secrets.HUBSPOT_API_KEY }} \
|
||||
-e DB_HOST=${{ secrets.DEV_DB_HOST }} \
|
||||
-e DB_NAME=${{ secrets.DEV_DB_NAME }} \
|
||||
-e DB_PORT=${{ secrets.DEV_DB_PORT }} \
|
||||
-e DB_HOST=localhost \
|
||||
-e DB_NAME=test \
|
||||
-e DB_USERNAME=test \
|
||||
-e DB_PASSWORD=test \
|
||||
-e DB_PORT=5432 \
|
||||
model-test pytest -vv -m 'not integration'
|
||||
|
|
|
|||
|
|
@ -35,3 +35,4 @@ locals {
|
|||
output "resolved_image_uri" {
|
||||
value = local.image_uri
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,3 +35,16 @@ locals {
|
|||
output "resolved_image_uri" {
|
||||
value = local.image_uri
|
||||
}
|
||||
|
||||
|
||||
variable "db_host" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "db_name" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "db_port" {
|
||||
type = string
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue