Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

helper methods for running vmc commands; better testing of existing a…

…pps running
  • Loading branch information...
commit c4877de0c2480ea71ce7b9df654c2743bffee89b 1 parent 980477c
@drnic authored
Showing with 13 additions and 5 deletions.
  1. +12 −4 scrolls/cf.rb
  2. +1 −1  scrolls/sidekiq.rb
View
16 scrolls/cf.rb
@@ -72,13 +72,21 @@
run "mkdir -p deploy"
run "cp #{project_name}.war deploy/"
end
- run "vmc _#{@vmc_version}_ push #{project_name} --runtime #{@cf_ruby_runtime} --path . --no-start"
- run "vmc _#{@vmc_version}_ env-add #{project_name} BUNDLE_WITHOUT=assets:test:development"
- run "vmc _#{@vmc_version}_ start #{project_name}"
+ run_vmc "push #{project_name} --runtime #{@cf_ruby_runtime} --path . --no-start"
+ run_vmc "env-add #{project_name} BUNDLE_WITHOUT=assets:test:development"
+ run_vmc "start #{project_name}"
+end
+
+def vmc
+ "vmc _#{@vmc_version}_"
+end
+
+def run_vmc(command)
+ run "#{vmc} #{command}"
end
def cf_delete_app(name)
- run %Q{vmc _#{@vmc_version}_ apps | grep "\\b#{name}\\b" && vmc _#{@vmc_version}_ delete #{name}}
+ run %Q{#{vmc} apps | grep " #{name} " && #{vmc} delete #{name}}
end
def cf_standalone_command(key, name, command, services={})
View
2  scrolls/sidekiq.rb
@@ -40,7 +40,7 @@
services = $cf_manifest["applications"]["."]["services"]
manifest_file = cf_standalone_command("worker", worker_name, "bundle exec sidekiq -e production", services)
cf_delete_app worker_name
- run "vmc _#{@vmc_version}_ push #{worker_name} --runtime #{@cf_ruby_runtime} --path . --manifest #{manifest_file}"
+ run_vmc "push #{worker_name} --path . --manifest #{manifest_file}"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.