Initial commit
This commit is contained in:
12
.gitea/actions/create/action.yml
Normal file
12
.gitea/actions/create/action.yml
Normal file
@ -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 -
|
||||||
31
.gitea/actions/create/postgres-template.yaml
Normal file
31
.gitea/actions/create/postgres-template.yaml
Normal file
@ -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
|
||||||
11
.gitea/actions/delete/action.yml
Normal file
11
.gitea/actions/delete/action.yml
Normal file
@ -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
|
||||||
Reference in New Issue
Block a user