Advertisement
Guest User

Untitled

a guest
May 24th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. current_repo_name=$(basename `git rev-parse --show-toplevel`)
  4. repo_name="`git rev-parse --show-toplevel`"
  5. version="`date +%Y%m%d%H%M%S`"
  6. deploy_dir_name="$repo_name-deploy-$version"
  7. branch_name=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
  8.  
  9. mkdir "$deploy_dir_name"
  10.  
  11. git clone git@github.com:receipt-bank/"$current_repo_name".git "$deploy_dir_name"
  12.  
  13. cd "$deploy_dir_name"
  14.  
  15. configby_variables_file="$deploy_dir_name"/config/configby.variables.yml
  16. cp "$deploy_dir_name"/config/configby.variables.example.yml "$configby_variables_file"
  17.  
  18. gsed -ri 's/^(\s*)(user\s*:\s*root\s*$)/\1user: sarcx/' "$configby_variables_file"
  19. gsed -ri "s/^(\s*)(name\s*:\s*receiptbank_development\s*$)/\1name: receiptbank_development$version/" "$configby_variables_file"
  20. gsed -ri "s/^(\s*)(test_database\s*:\s*receiptbank_test\s*$)/\1test_database: receiptbank_test$version/" "$configby_variables_file"
  21.  
  22. bundle install
  23.  
  24. git-hooks/hm --install
  25.  
  26. bundle exec rake db:create db:structure:load db:test:prepare
  27.  
  28. ./bin/install
  29.  
  30. git checkout "$branch_name"
  31.  
  32. # calling other file
  33. git-merge-master
  34.  
  35. echo "$deploy_dir_name"
  36.  
  37. bundle exec rake db:drop
  38. rm -r -f "$deploy_dir_name"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement