commit c8aeedafdb905b84386ca71f3e23bb24a1c9cfdb Author: Valentin Afanasev Date: Tue Aug 5 02:11:04 2025 +0300 Initial commit diff --git a/.gitea/actions/create/action.yml b/.gitea/actions/create/action.yml new file mode 100644 index 0000000..637b61e --- /dev/null +++ b/.gitea/actions/create/action.yml @@ -0,0 +1,12 @@ +name: Run pg for tests +inputs: + service_name: + required: true +runs: + using: composite + env: + POD_NAME: ${{ inputs.service_name }} + APP_NAME: ${{ inputs.service_name }} + SERVICE_NAME: ${{ inputs.service_name }} + steps: + run: envsubst < postgres-template.yaml | werf kubectl apply - diff --git a/.gitea/actions/create/postgres-template.yaml b/.gitea/actions/create/postgres-template.yaml new file mode 100644 index 0000000..72d5c04 --- /dev/null +++ b/.gitea/actions/create/postgres-template.yaml @@ -0,0 +1,31 @@ +apiVersion: v1 +kind: Pod +metadata: + name: ${POD_NAME} + labels: + app: ${APP_NAME} +spec: + containers: + - name: postgres + image: postgres:15 + ports: + - containerPort: 5432 + env: + - name: POSTGRES_PASSWORD + value: test + readinessProbe: + exec: + command: ["pg_isready", "-U", "postgres"] + initialDelaySeconds: 5 + periodSeconds: 10 +--- +apiVersion: v1 +kind: Service +metadata: + name: ${SERVICE_NAME} +spec: + selector: + app: ${APP_NAME} + ports: + - port: 5432 + targetPort: 5432 diff --git a/.gitea/actions/delete/action.yml b/.gitea/actions/delete/action.yml new file mode 100644 index 0000000..f3e7007 --- /dev/null +++ b/.gitea/actions/delete/action.yml @@ -0,0 +1,11 @@ +name: Stop pg for tests +inputs: + service_name: + required: true +runs: + using: composite + env: + SERVICE_NAME: ${{ inputs.service_name }} + steps: + run: werf kubectl delete service/${SERVICE_NAME} --ignore-not-found + run: werf kubectl delete pod/${SERVICE_NAME} --ignore-not-found