0
function setupMigrationDB(){

   #some other stuff code .. 
   MIGRATIONS_DIR=$8

   cd $MIGRATIONS_DIR   
     liquibase --classpath="${CLASSPATH}"  --driver="${DRIVER}" --username="${DB_ADMIN_USER}" --password="${DB_ADMIN_PWD}" --changeLogFile=update.xml --url="${URL}"  update -Dprefix="${PREFIX}"

   cd ../../
}

setupMigrationsDB arg1 ..... arg7 ./migrations/testdb

上記の関数を bash script 内で使用しています。しかし、liquibase ツールはそれぞれのディレクトリ e を見つけることができません。g

 -install[dir]
  --migrations[dir]
  ---testdb[dir] 
 -setup.sh

setup.sh スクリプトには上記の関数が含まれており、関数内のディレクトリを変更し testdbて liquibase tool を実行しようとしています。

 ./setup.sh 

  Liquibase Home: /usr/local/liquibase
  Liquibase Update Failed: /vagrant/testpkg/install/migrations/testdb does not exist

ディレクトリの変更の問題を修正して、liquibase が目的の update.xml ファイルを見つけられるようにする方法。./migrations/testdb/update.xml などの相対パスを提供することもできましたが、liquibase はそれをあまり尊重しませ relativeToChangelogFile="true"ん。

コマンドラインからツールを実行すると完全に機能します。 cd ./migrations/testdb && liquibase ......

この問題を解決するのを手伝ってください

編集

このような同様の問題のようですが、私の状況でスクリプトを変更する方法がわかりません

4

0 に答える 0