GoLang-migrate
Migrate reads migrations from sources file and applies them in correct order to a database.
Prerequisite: Make sure you have SQL files in format used by the golang-migrate tool.
official-documentation: https://github.com/golang-migrate/migrate postgres-example: https://github.com/golang-migrate/migrate/tree/master/database/postgres
On the Edit build pipeline page, select the Pre-Build Stage (or Post-Build Stage). or
Click + Add task.
Select GoLang-migrate from PRESET PLUGINS.
Enter a relevant name in the
Task name
field. It is a mandatory field.Enter a descriptive message for the task in the
Description
field. It is an optional field.Provide a value for the input variable. Note: The value may be any of the values from the previous build stages, a global variable, or a custom value.
Trigger/Skip Condition
refers to a conditional statement to execute or skip the task. You can select either:Set trigger conditions
orSet skip conditions
Click Update Pipeline.
Notes
Use
in-cluster/ Execute tasks in application environment
feature inpre-deploy
orpost-deploy
, in case when the database service is not reachable or accessible from devtron cluster.In case the
DB_TYPE
is not supported for your database, then usePOST_COMMAND
asuse
DB_PASSWORD
withscope-variable
feature for more security.
Last updated