Advertisement
vitvayti

migration.sh

Nov 7th, 2024
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ $CI_COMMIT_REF_NAME = "master" ]; then
  4.  
  5.   php /home/bitrix/www/scripts/mirgration_setup.php
  6.  
  7.   #create symlink for migrate files from submodules
  8.   migrationsDir="/home/bitrix/www/local/php_interface/reducemigrations"
  9.   for i in `find /home/bitrix/www/local/modules -maxdepth 1 -type d`
  10.   do
  11.     find $i/migrations/*.php -exec ln -sf {} $migrationsDir \;
  12.   done
  13.  
  14.   php /home/bitrix/www/bitrix/tools/migrate apply -f #run migrate scenario
  15.  
  16.   echo "Success"
  17.  
  18. else
  19.  
  20.     echo "Run only for master, current branch is $CI_COMMIT_REF_NAME"
  21.  
  22. fi
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement