pivotal-cf / toolsmiths-shared-scripts

Apache License 2.0
20 stars 21 forks source link

Allow p-runtime path to be specified #5

Closed scottmuc closed 8 years ago

scottmuc commented 8 years ago

I didn't submit a PR because I didn't think that this repo should be forked to my private org and I wasn't able to push a branch to this repo.

commit f047cda64c2add8db191f5907d792bb647b1b59e
Author: Scott Muc <smuc@pivotal.io>
Date:   Mon Jul 11 11:51:01 2016 -0600

    Allow specification of p-runtime directory

    The path to `p-runtime` is cleary a dependency of the script so let's
    make it explicit. My preference would be to remove the default, but this
    change should at least make it compatible with its current usage.

diff --git a/deploy_pcf/deploy_pcf.rb b/deploy_pcf/deploy_pcf.rb
index 70ddfaa..7664d65 100755
--- a/deploy_pcf/deploy_pcf.rb
+++ b/deploy_pcf/deploy_pcf.rb
@@ -81,6 +81,9 @@ OptionParser.new do |opts|
   opts.on('-W', '--elastic-runtime-version [VERSION]') do |elastic_runtime_version|
     options[:elastic_runtime_version] = elastic_runtime_version
   end
+  opts.on('-P', '--p-runtime-directory [DIR]') do |p_runtime_directory|
+    options[:p_runtime_directory] = p_runtime_directory
+  end
   opts.on('-S', '--stemcell [PATH]') do |stemcell|
     options[:stemcell] = File.expand_path(stemcell)
   end
@@ -180,7 +183,8 @@ if options[:dry_run]
 end

 ENV['ENV_DIRECTORY'] = options[:environment_directory]
-runtime_dir=File.expand_path('../..', File.dirname(__FILE__)) + "/p-runtime"
+default_p_runtime_directory = File.expand_path('../..', File.dirname(__FILE__)) + "/p-runtime"
+runtime_dir = options.fetch(:p_runtime_directory], default_p_runtime_directory)

 Dir.chdir(runtime_dir)
 result = system("bundle")
cf-gitbot commented 8 years ago

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

derwei commented 8 years ago

Thanks for submitting the change! I've merged it into the code: https://github.com/pivotal-cf/toolsmiths-shared-scripts/commit/78a284197bc9770f543c9f9f049fc82f9d55f179

scottmuc commented 8 years ago

@derwei thanks!