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

I have the above function being used within a bash script . But the liquibase tool is unable to find the respective directory e. g

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

The setup.sh script contains above function and I am try to change directory within function to e.g testdb and run liquibase tool .

 ./setup.sh 

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

How to fix the change directory issue , so that liquibase finds the desired update.xml file. I could have provided relative path e.g ./migrations/testdb/update.xml but liquibase does not respect that very well, bcz it fails to include all changelog files relativeToChangelogFile="true" fail

running the tool from command line work perfectly e.g cd ./migrations/testdb && liquibase ......

Please help me sort out this issue

Edit

Seems to be similar issue like this , but I am not getting how to alter the script in my situation

Community
  • 1
  • 1
sakhunzai
  • 13,900
  • 23
  • 98
  • 159

0 Answers0