lib/vagrant-orchestrate/command/init.rb in vagrant-orchestrate-0.3.2 vs lib/vagrant-orchestrate/command/init.rb in vagrant-orchestrate-0.4.0

- old
+ new

@@ -39,11 +39,11 @@ o.on("--shell", "Shorthand for --provision-with shell") do options[:provisioners] << "shell" end o.on("--shell-paths x,y,z", Array, - "Comma separated list of shell scripts to run on provision. Only with --shell") do |list| + "Comma-separated list of shell scripts to run on provision. Only with --shell") do |list| options[:shell_paths] = list end o.on("--shell-inline command", String, "Inline script to run. Only with --shell") do |c| options[:shell_inline] = c @@ -64,11 +64,11 @@ o.on("--ssh-username USERNAME", String, "The username for communicating over ssh") do |u| options[:ssh_username] = u end - o.on("--ssh-password PASSWORD", String, "The username for communicating over ssh") do |p| + o.on("--ssh-password PASSWORD", String, "The password for communicating over ssh") do |p| options[:ssh_password] = p end o.on("--ssh-private-key-path PATH", String, "Paths to the private key for communinicating over ssh") do |k| options[:ssh_private_key_path] = k @@ -100,10 +100,19 @@ end o.on("-f", "--force", "Force overwriting of files") do options[:force] = true end + + o.on("--credentials-prompt", "Prompt for credentials when performing orchestrate operations") do + options[:creds_prompt] = true + end + + cfpmsg = "The path to a yaml file containing :username and :password fields to use with vagrant orchestrate" + o.on("--credentials-file-path FILEPATH", String, cfpmsg) do |file_path| + options[:creds_file_path] = file_path + end end argv = parse_options(opts) return unless argv @@ -129,11 +138,12 @@ ssh_username: options[:ssh_username], ssh_password: options[:ssh_password], ssh_private_key_path: options[:ssh_private_key_path], servers: options[:servers], environments: options[:environments], - plugins: options[:plugins] + plugins: options[:plugins], + creds_prompt: options[:creds_prompt] ) write_file("Vagrantfile", contents, options) FileUtils.cp(Orchestrate.source_root.join("templates", "vagrant", "dummy.box"), File.join(@env.cwd, "dummy.box")) @env.ui.info(I18n.t("vagrant.commands.init.success"), prefix: false) @@ -175,11 +185,11 @@ return unless environments.any? contents = TemplateRenderer.render(Orchestrate.source_root.join("templates/environment/servers.json"), environments: environments) write_file("servers.json", contents, options) - @env.ui.info("You've created an environment aware configuration.") - @env.ui.info("To complete the process you need to do the following: ") + @env.ui.info("You've created an environment-aware configuration.") + @env.ui.info("To complete the process, you need to do the following: ") @env.ui.info(" 1. Add the target servers to servers.json") @env.ui.info(" 2. Commit your changes") @env.ui.info(" 3. Create a git branch for each environment") environments.each do |env| @env.ui.info(" git branch #{env}")