1

For a research subject, I need to know if some people/companies use Liquibase to manage "other things" than database.

For example, to migrate some data from an existing database. We are several developers, each one with one database for test on our local machine. From time to time, we need to update all the data from our database, or add some existing from the production server to run some test. Right now, we extract them in a JAR, and we run those JAR manually. We would like to automatize this action, by writing in our xml some command. For example :

    <changeSet id="2013-08-06_refactorProjectTable" author="morgan">
        <comment>A</comment>
        <executeCommand executable="java">
            <arg value="-jar"/>
            <arg value="/home/etiik/Bureau/SRMvision/integration-1.6-refactorProjectTable.jar"/>
        </executeCommand>
     </changeSet>

The question we ask ourself is if some people already did it, and if it's viable or not ?! Moreover, I could need some help about the absolute path here. As I told before, it's on our local machine ..So it's not really helpful like this. I would like to know if it was possible to use it as for the , which is a relative path. Actually, if I try to do the same way, it fails at deploy (when I run pwd in this executeCommand, I see that I'm in the config folder of my glassfish domain!)

Thanks for your help! :) Best Regards,

Morgan

4

2 回答 2

0

如果很多人以这种方式使用 Liquibase,我会感到惊讶。理想情况下,您会将上述任务构建到执行环境的不同部分。使用 Ant 或 Maven 等流行系统,您可以设置每次运行某个命令(例如 liquibase:update 或 liquibase:rollback)时运行的类似内容。

执行环境应该设置一个当前目录。在 Maven 中,它只会考虑来自其本地根目录的文件,这非常有用,因为您可以随意调整代码和项目。缺点是 liquibase maven 插件有点无情。目前尚不清楚责任归咎于 maven 还是插件,但这是需要牢记的。我花了一两天时间与它战斗。

如您所知,我在纽约市的一家中型初创公司担任软件工程师,如果这对您的研究有用的话。

于 2013-10-30T19:05:14.823 回答
0

老问题,但在玩过之后看起来你可以运行相对于 liquibase jar 文件的可执行文件,例如

<changeSet id="OU" author="mathew">
        <executeCommand executable="{liquibase.jar dir}../bin/update-scripts/some.sh" />
    </changeSet>
于 2017-05-06T15:20:02.267 回答