Compare commits

...

5 Commits

Author SHA1 Message Date
9263e22095 change image to node-golint 2025-04-27 16:12:22 +03:00
5fb7578aec add container rules to migrate workflow 2025-04-23 17:54:03 +03:00
56ae05afd6 fix quotes in migration 2025-04-23 16:32:39 +03:00
c6e743aa34 fix quotes in migration 2025-04-23 16:02:35 +03:00
d1ef78c76e postgres migration 2025-04-22 01:20:57 +03:00

@ -0,0 +1,30 @@
name: Migrate Database
run-name: ${{ gitea.actor }} getmigrations and apply
on:
workflow_call:
secrets:
REGISTRY_USER:
required: true
REGISTRY_PASSWORD:
required: true
inputs:
runner:
required: true
type: string
branch_name:
description: "Name of the current branch"
required: true
type: string
jobs:
Migrate:
runs-on: ["${{ inputs.runner }}"]
container:
image: gitea.pena:3000/penadevops/container-images/node-golint:main
steps:
- name: Check out repository code
uses: https://gitea.pena/PenaDevops/actions.git/checkout@v1
- name: download packs
run: go mod download
- name: migrate
run: ./tools/migrate -verbose -source "file:/$(go list -f '{{.Dir}}' -m gitea.pena/SQuiz/common | sed 's|^/workspace/SQuiz/core||')/dal/schema/" -database "$(grep -E '^POSTGRES_URL=' "./deployments/${{ inputs.branch_name }}/config.env" | cut -d '=' -f2- | sed -E 's~host=([^ ]+) port=([^ ]+) user=([^ ]+) password=([^ ]+) dbname=([^ ]+) sslmode=([^ ]+)~postgresql://\3:\4@\1:\2/\5?sslmode=\6~' | sed 's~\"~~g')" up