Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- current_repo_name=$(basename `git rev-parse --show-toplevel`)
- repo_name="`git rev-parse --show-toplevel`"
- version="`date +%Y%m%d%H%M%S`"
- deploy_dir_name="$repo_name-deploy-$version"
- branch_name=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
- mkdir "$deploy_dir_name"
- git clone git@github.com:receipt-bank/"$current_repo_name".git "$deploy_dir_name"
- cd "$deploy_dir_name"
- configby_variables_file="$deploy_dir_name"/config/configby.variables.yml
- cp "$deploy_dir_name"/config/configby.variables.example.yml "$configby_variables_file"
- gsed -ri 's/^(\s*)(user\s*:\s*root\s*$)/\1user: sarcx/' "$configby_variables_file"
- gsed -ri "s/^(\s*)(name\s*:\s*receiptbank_development\s*$)/\1name: receiptbank_development$version/" "$configby_variables_file"
- gsed -ri "s/^(\s*)(test_database\s*:\s*receiptbank_test\s*$)/\1test_database: receiptbank_test$version/" "$configby_variables_file"
- bundle install
- git-hooks/hm --install
- bundle exec rake db:create db:structure:load db:test:prepare
- ./bin/install
- git checkout "$branch_name"
- # calling other file
- git-merge-master
- echo "$deploy_dir_name"
- bundle exec rake db:drop
- rm -r -f "$deploy_dir_name"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement