Skip to content

Commit

Permalink
Merge pull request projectatomic#204 from bexelbie/bexelbie_openshift…
Browse files Browse the repository at this point in the history
…_env

Add Environement vars to OpenShift env output
  • Loading branch information
navidshaikh committed May 9, 2016
2 parents afeaf1c + d9e795c commit 00c07da
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Fix #191: 'vagrant service-manager restart' not handled correctly @budhrg
- Fixes #187, Updated commands in the Available Commands section @preeticp
- Fix #200: Simplify the eval hint for `vagrant service-manager env` command @budhrg
- Add environment variables for Openshift env output @bexelbie

## v1.0.1 Apr 12, 2016
- Updated SPEC (v1.0.0) for url, date and format @budhrg
Expand Down
12 changes: 12 additions & 0 deletions lib/vagrant-service-manager/plugin_util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ def self.print_shell_configure_info(ui, command = '')
ui.info "\n" + I18n.t("servicemanager.commands.env.#{label}", command: command)
end
end

def self.env_label(script_readable)
if script_readable
'script_readable'
elsif OS.unix?
'non_windows'
elsif OS.windows_cygwin?
'windows_cygwin'
else
'windows'
end
end
end
end
end
11 changes: 1 addition & 10 deletions lib/vagrant-service-manager/services/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,7 @@ def self.info(machine, ui, options = {})
end

def self.print_env_info(ui, options)
label = if options[:script_readable]
'script_readable'
elsif OS.unix?
'non_windows'
elsif OS.windows_cygwin?
'windows_cygwin'
else
'windows'
end

label = PluginUtil.env_label(options[:script_readable])
options[:secrets_path] = PluginUtil.windows_path(options[:secrets_path]) unless OS.unix?
message = I18n.t("servicemanager.commands.env.docker.#{label}",
ip: options[:guest_ip], port: PORT, path: options[:secrets_path],
Expand Down
3 changes: 1 addition & 2 deletions lib/vagrant-service-manager/services/open_shift.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def self.info(machine, ui, options = {})
end

def self.print_info(ui, options)
label = 'default'
label = 'script_readable' if options[:script_readable]
label = PluginUtil.env_label(options[:script_readable])
message = I18n.t("servicemanager.commands.env.openshift.#{label}",
openshift_url: options[:url],
openshift_console_url: options[:console_url])
Expand Down
14 changes: 13 additions & 1 deletion locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,21 @@ en:
DOCKER_TLS_VERIFY=1
DOCKER_API_VERSION=%{api_version}
openshift:
default: |-
windows: |-
# You can access the OpenShift console on: %{openshift_console_url}
# To use OpenShift CLI, run: oc login %{openshift_url}
setx OPENSHIFT_URL %{openshift_url}
setx OPENSHIFT_WEB_CONSOLE %{openshift_console_url}
non_windows: |-
# You can access the OpenShift console on: %{openshift_console_url}
# To use OpenShift CLI, run: oc login %{openshift_url}
export OPENSHIFT_URL=%{openshift_url}
export OPENSHIFT_WEB_CONSOLE=%{openshift_console_url}
windows_cygwin: |-
# You can access the OpenShift console on: %{openshift_console_url}
# To use OpenShift CLI, run: oc login %{openshift_url}
export OPENSHIFT_URL=%{openshift_url}
export OPENSHIFT_WEB_CONSOLE=%{openshift_console_url}
script_readable: |-
OPENSHIFT_URL=%{openshift_url}
OPENSHIFT_WEB_CONSOLE=%{openshift_console_url}
Expand Down

0 comments on commit 00c07da

Please sign in to comment.