mortar 0.15.15 → 0.15.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,15 +45,15 @@ class Mortar::Command::Version < Mortar::Command::Base
45
45
  # -v, --version VERSION_NUMBER # specify which version to upgrade to
46
46
  def upgrade
47
47
  validate_arguments!
48
+ version_argument = ""
48
49
  if installed_with_omnibus?
49
- version_number = ''
50
50
  if options[:version]
51
- version_number = " -v " + options[:version]
51
+ version_argument = "MORTAR_VERSION=" + options[:version] +" "
52
52
  end
53
53
  shell_url = ENV.fetch("MORTAR_INSTALL", "http://install.mortardata.com")
54
54
  dir = "/opt/mortar/installer"
55
55
  begin
56
- cmd = "echo 'Upgrading will prompt for your sudo password.\n' && sudo mkdir -p #{dir} && sudo curl -sS -L -o #{dir}/install.sh #{shell_url} && sudo bash #{dir}/install.sh#{version_number}"
56
+ cmd = "echo 'Upgrading will prompt for your sudo password.\n' && MORTAR_URL=\"#{shell_url}\" #{version_argument}bash -c \"$(curl -sSL #{shell_url})\""
57
57
  Kernel.system cmd
58
58
  ensure
59
59
  end
@@ -51,7 +51,7 @@ module Mortar
51
51
  end
52
52
 
53
53
  def installed_with_omnibus?
54
- File.exists?('/opt/mortar/version-manifest.txt')
54
+ File.exists?('/opt/mortar/install/version-manifest.txt')
55
55
  end
56
56
 
57
57
  def write_to_file(str_data, path, mkdir_p=true)
@@ -16,5 +16,5 @@
16
16
 
17
17
  module Mortar
18
18
  # see http://semver.org/
19
- VERSION = "0.15.15"
19
+ VERSION = "0.15.16"
20
20
  end
@@ -25,9 +25,9 @@ module Mortar::Command
25
25
  end
26
26
 
27
27
  base_url = "http://install.mortardata.com"
28
- base_version = "0.15.1"
28
+ base_version = ""
29
29
  tmp_dir_dumm = "/opt/mortar/installer"
30
- curl_command = "echo 'Upgrading will prompt for your sudo password.\n' && sudo mkdir -p #{tmp_dir_dumm} && sudo curl -sS -L -o #{tmp_dir_dumm}/install.sh #{base_url} && sudo bash #{tmp_dir_dumm}/install.sh"
30
+ curl_command = "echo 'Upgrading will prompt for your sudo password.\n' && MORTAR_URL=\"#{base_url}\" bash -c \"$(curl -sSL #{base_url})\""
31
31
 
32
32
  context("version in prod") do
33
33
  mortar_install_env = ENV['MORTAR_INSTALL']
@@ -48,7 +48,7 @@ module Mortar::Command
48
48
 
49
49
  it "makes curl request for different versions when requested" do
50
50
  mortar_version = "0.15.1"
51
- curl_command_with_version = curl_command + " -v " + mortar_version
51
+ curl_command_with_version = "echo 'Upgrading will prompt for your sudo password.\n' && MORTAR_URL=\"#{base_url}\" MORTAR_VERSION=#{mortar_version} bash -c \"$(curl -sSL #{base_url})\""
52
52
  mock(Kernel).system( curl_command_with_version)
53
53
  mock(Kernel).system( curl_command_with_version)
54
54
  any_instance_of(Mortar::Command::Version) do |base|
@@ -62,8 +62,9 @@ module Mortar::Command
62
62
  end
63
63
 
64
64
  context("version dev") do
65
- dev_url = "dev_url.com"
66
- dev_curl = "echo 'Upgrading will prompt for your sudo password.\n' && sudo mkdir -p #{tmp_dir_dumm} && sudo curl -sS -L -o #{tmp_dir_dumm}/install.sh #{dev_url} && sudo bash #{tmp_dir_dumm}/install.sh"
65
+ dev_url = "install.m0rtardata.com"
66
+ base_version = "0.15.1"
67
+ dev_curl = "echo 'Upgrading will prompt for your sudo password.\n' && MORTAR_URL=\"#{dev_url}\" bash -c \"$(curl -sSL #{dev_url})\""
67
68
  before(:each) do
68
69
  ENV['MORTAR_INSTALL'] = dev_url
69
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mortar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.15
4
+ version: 0.15.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-02 00:00:00.000000000 Z
12
+ date: 2014-05-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc