Compare commits

..

8 Commits

Author SHA1 Message Date
a409715729 use action_path 2025-08-08 00:20:55 +03:00
ed3f526647 Revert "debug1"
This reverts commit 4c961f681b.
2025-08-08 00:18:20 +03:00
4c961f681b debug1 2025-08-08 00:15:27 +03:00
f0913b7895 use pg15 2025-08-08 00:11:11 +03:00
e4abcb3540 up timeout 2025-08-08 00:05:45 +03:00
819a109d93 parametrize container 2025-08-07 22:32:21 +03:00
85aa6795d1 fix 2025-08-06 22:14:37 +03:00
3d89044f04 fix env 2025-08-06 22:14:17 +03:00
2 changed files with 27 additions and 11 deletions

View File

@ -2,15 +2,31 @@ name: Run pg for tests
inputs: inputs:
service_name: service_name:
required: true required: true
postgres_version:
required: false
default: 15
postgres_db:
required: false
default: test
postgres_user:
required: false
default: test
postgres_password:
required: false
default: test
runs: runs:
using: composite using: composite
env:
POD_NAME: ${{ inputs.service_name }}
APP_NAME: ${{ inputs.service_name }}
SERVICE_NAME: ${{ inputs.service_name }}
steps: steps:
- run: curl -s https://gitea.vecus.ru/ci/postgres-actions/raw/branch/master/.gitea/actions/create/postgres-template.yaml | envsubst | werf kubectl apply -f - - run: |
shell: bash cat ${{ gitea.action_path }}/postgres-template.yaml | envsubst | werf kubectl apply -f -
- run: werf kubectl wait --for=condition=ready pod/${POD_NAME} --timeout=60s werf kubectl wait --for=condition=ready pod/${POD_NAME} --timeout=600s
shell: bash shell: bash
env:
POD_NAME: ${{ inputs.service_name }}
APP_NAME: ${{ inputs.service_name }}
SERVICE_NAME: ${{ inputs.service_name }}
POSTGRES_VERSION: ${{ inputs.postgres_version }}
POSTGRES_DB: ${{ inputs.postgres_db }}
POSTGRES_USER: ${{ inputs.postgres_user }}
POSTGRES_PASSWORD: ${{ inputs.postgres_password }}

View File

@ -7,16 +7,16 @@ metadata:
spec: spec:
containers: containers:
- name: postgres - name: postgres
image: postgres:15 image: postgres:${POSTGRES_VERSION}
ports: ports:
- containerPort: 5432 - containerPort: 5432
env: env:
- name: POSTGRES_PASSWORD - name: POSTGRES_PASSWORD
value: test value: ${POSTGRES_PASSWORD}
- name: POSTGRES_USER - name: POSTGRES_USER
value: test value: ${POSTGRES_USER}
- name: POSTGRES_DB - name: POSTGRES_DB
value: test value: ${POSTGRES_DB}
readinessProbe: readinessProbe:
exec: exec:
command: ["pg_isready", "-U", "postgres"] command: ["pg_isready", "-U", "postgres"]