feat: provide service to automatically validate DB migrations in the CI pipeline (#240)
Description
- Create an HTTP server providing an API to create clones and run DB migrations
Related issue
#240
Examples
CI Checker configuration
dle:
url: "https://dblab.domain.com"
verificationToken: "dle_secret_token"
platform:
url: "https://postgres.ai/api/general"
accessToken: "platform_secret_token"
enablePersonalTokens: true
source:
type: "github"
token: "vcs_secret_token"
runner:
image: "postgresai/migration-runner:latest"
POST /migration/run
curl --location --request POST "${CI_ENDPOINT}" \
--header "Verification-Token: ${SECRET_TOKEN}" \
--header 'Content-Type: application/json' \
--data '{"source":{"owner":"postgres-ai","repo":"runci","ref":"refs/heads/240-debug-ci"},"actor":"artyom","db_name":"test","commands":["sqitch deploy","env","echo 'Migration has been completed'"],"migration_envs":["DATABASE_LAB_CI=true"]}'
Checklist
-
the MR description has been reviewed -
this MR contains text changes and they have been reviewed OR there are no texts changes -
this MR contains GUI/CLI changes and they have been reviewed OR there are no GUI/CLI changes -
this MR contains API changes, specifications reflect those changes and they have been reviewed OR there are no API changes
Closes #240
Edited by Artyom Kartasov