Documentation
¶
Index ¶
- Constants
- func Add(ctx context.Context, migration sdk.Migration)
- func ArtifactoryIntegration(ctx context.Context, dbFunc func() *gorp.DbMap) error
- func AuthConsumerTokenExpiration(ctx context.Context, dbFunc func() *gorp.DbMap, duration time.Duration) error
- func CountSecret(db gorp.SqlExecutor, id int64) (int64, error)
- func Delete(db gorp.SqlExecutor, mig *sdk.Migration) error
- func GetAll(db gorp.SqlExecutor) ([]sdk.Migration, error)
- func GetByName(db gorp.SqlExecutor, name string) (*sdk.Migration, error)
- func Insert(db gorp.SqlExecutor, mig *sdk.Migration) error
- func LoadLastRunsByDate(db gorp.SqlExecutor) ([]sdk.WorkflowRun, error)
- func Run(ctx context.Context, db gorp.SqlExecutor)
- func RunsSecrets(ctx context.Context, dbFunc func() *gorp.DbMap) error
- func SaveAllMigrations(db gorp.SqlExecutor) error
- func Status(db gorp.SqlExecutor) sdk.MonitoringStatusLine
- func Update(db gorp.SqlExecutor, mig *sdk.Migration) error
- func UpdateStatus(db gorp.SqlExecutor, id int64, status string) error
- type WorkflowRun
Constants ¶
const MinCompatibleRelease = "0.46.0"
MinCompatibleRelease represent the minimum release which is working with these migrations, need to update when we delete migration in our codebase
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add adds a migration to the list of migrations to run at API start time example of usage:
migrate.Add(sdk.Migration{Name: "MyMigration", Release: "0.39.3", Mandatory: true, ExecFunc: func(ctx context.Context) error {
return migrate.MyMigration(ctx, a.Cache, a.DBConnectionFactory.GetDBMap)
}})
func ArtifactoryIntegration ¶
func CountSecret ¶
func CountSecret(db gorp.SqlExecutor, id int64) (int64, error)
func Delete ¶
func Delete(db gorp.SqlExecutor, mig *sdk.Migration) error
Delete migration in database.
func GetAll ¶
func GetAll(db gorp.SqlExecutor) ([]sdk.Migration, error)
GetAll returns the migration for given name.
func Insert ¶
func Insert(db gorp.SqlExecutor, mig *sdk.Migration) error
Insert migration in database.
func LoadLastRunsByDate ¶
func LoadLastRunsByDate(db gorp.SqlExecutor) ([]sdk.WorkflowRun, error)
LoadLastRuns returns the last run per last_mdodified
func SaveAllMigrations ¶
func SaveAllMigrations(db gorp.SqlExecutor) error
SaveAllMigrations save all local migrations marked to "done" into database (in case of a fresh installation)
func Status ¶
func Status(db gorp.SqlExecutor) sdk.MonitoringStatusLine
Status returns monitoring status, if there are cds migration in progress it returns WARN
func Update ¶
func Update(db gorp.SqlExecutor, mig *sdk.Migration) error
Update migration in database.
func UpdateStatus ¶
func UpdateStatus(db gorp.SqlExecutor, id int64, status string) error
UpdateStatus update the status of a migration given its id