Module: Alphonse::Configs::Tasks
- Included in:
- Operator
- Defined in:
- lib/alphonse/configs/operation.rb
Instance Method Summary collapse
- #branch ⇒ Object
- #bundle ⇒ Object (also: #install_gems)
- #cd_to_parent_path ⇒ Object
- #cd_to_path ⇒ Object (also: #cd)
- #db_migrate ⇒ Object (also: #update_database)
- #db_setup ⇒ Object (also: #setup_database)
- #git_clone ⇒ Object (also: #gc, #clone_repository)
- #git_pull ⇒ Object (also: #gl, #update_repository)
-
#list ⇒ Object
(also: #ls)
For testing only.
- #mkdir_path ⇒ Object (also: #setup_directory)
- #repository ⇒ Object
- #restart_app ⇒ Object
- #set_path_variable ⇒ Object
- #source_shell_rc ⇒ Object
- #start_app ⇒ Object
Instance Method Details
#branch ⇒ Object
26 27 28 |
# File 'lib/alphonse/configs/operation.rb', line 26 def branch config[:branch] || 'master' end |
#bundle ⇒ Object Also known as: install_gems
76 77 78 |
# File 'lib/alphonse/configs/operation.rb', line 76 def bundle bundle_install end |
#cd_to_parent_path ⇒ Object
60 61 62 |
# File 'lib/alphonse/configs/operation.rb', line 60 def cd_to_parent_path "cd #{config[:path]}" end |
#cd_to_path ⇒ Object Also known as: cd
55 56 57 |
# File 'lib/alphonse/configs/operation.rb', line 55 def cd_to_path "#{cd_to_parent_path}#{config[:app_name]}" end |
#db_migrate ⇒ Object Also known as: update_database
86 87 88 |
# File 'lib/alphonse/configs/operation.rb', line 86 def db_migrate rake("db:migrate RAILS_ENV=#{config[:environment]}") end |
#db_setup ⇒ Object Also known as: setup_database
81 82 83 |
# File 'lib/alphonse/configs/operation.rb', line 81 def db_setup rake("db:setup RAILS_ENV=#{config[:environment]}") end |
#git_clone ⇒ Object Also known as: gc, clone_repository
70 71 72 |
# File 'lib/alphonse/configs/operation.rb', line 70 def git_clone "git clone #{repository} #{config[:path]}#{config[:app_name]}" end |
#git_pull ⇒ Object Also known as: gl, update_repository
64 65 66 |
# File 'lib/alphonse/configs/operation.rb', line 64 def git_pull ["git checkout #{branch} -q", "git pull origin #{branch} -q", "git gc --aggressive"] end |
#list ⇒ Object Also known as: ls
For testing only
21 22 23 |
# File 'lib/alphonse/configs/operation.rb', line 21 def list "ls -a" end |
#mkdir_path ⇒ Object Also known as: setup_directory
50 51 52 |
# File 'lib/alphonse/configs/operation.rb', line 50 def mkdir_path "mkdir -p #{config[:path]}" end |
#repository ⇒ Object
30 31 32 |
# File 'lib/alphonse/configs/operation.rb', line 30 def repository config[:git_repo] end |
#restart_app ⇒ Object
46 47 48 |
# File 'lib/alphonse/configs/operation.rb', line 46 def restart_app (config[:restart_command] || 'touch tmp/restart.txt') end |
#set_path_variable ⇒ Object
34 35 36 |
# File 'lib/alphonse/configs/operation.rb', line 34 def set_path_variable ["export PATH=#{config[:env_path]}"] end |
#source_shell_rc ⇒ Object
38 39 40 |
# File 'lib/alphonse/configs/operation.rb', line 38 def source_shell_rc "source ~/.bashrc" end |
#start_app ⇒ Object
42 43 44 |
# File 'lib/alphonse/configs/operation.rb', line 42 def start_app (config[:start_command] || 'touch tmp/restart.txt') end |