【发布时间】:2019-06-16 23:10:10
【问题描述】:
我正在尝试通过在其中一个阶段运行 shell 命令将 db 迁移与 ci/cd 管道中的Flyway 集成。 (由于我不允许向管道添加任何新插件,所以不能使用 Flyway 插件)
我试过这样:
stage('migrate-sql') {
steps {
sh """
docker run --rm \
-v /GetShorty/Apis/Sql:/flyway/sql \
boxfuse/flyway:5.2.4 \
-url=jdbc:postgresql://****:5432/**** \
-user=**** \
-password=**** \
-baselineOnMigrate=false \
-locations=/GetShorty/Apis/Sql \
-connectRetries=60 \
migrate
"""
}
}
但没有应用迁移,因为它似乎找不到迁移文件夹
WARNING: Unable to resolve location /GetShorty/Apis/Sql
Successfully validated 0 migrations (execution time 00:00.378s)
Current version of schema "public": << Empty Schema >>
Schema "public" is up to date. No migration necessary.
考虑如下投影结构:
知道这里可能出了什么问题吗?
【问题讨论】: