linecook-gem 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9367aeabc5581c1a24ea293dabb516637516d55b
4
- data.tar.gz: d14069fbad0374c2f732bcc66d996a9b40618f2a
3
+ metadata.gz: 63aa11b78f4d54bbf71ed8fe7b0124ee187da340
4
+ data.tar.gz: f058f919337be4786451cab400fe98fecc851663
5
5
  SHA512:
6
- metadata.gz: 9fafb78bf48b48ec042e3df7c5bb1f860fa839d9135d1fbe57c44d05e42e0875c07ca86b27b7db001f08d7c3ca57413bdfaf99b4f7adbcba12116edfae1341d9
7
- data.tar.gz: 25483a77cd3d1e9c98cf2c37a414edcc1efdd17f1cc38216141bbd3d57c0560dba2b1599b946288d983f7e7325512711118bb32edaf38f6cfa1b56e83feab885
6
+ metadata.gz: 2d58fe7eb1dadfffa8843cf3268ae62895f464274b98ff66966649dbb32a45c24027adab83b1a00b8b09e1fc55d7d0e5b1e0c4b1fa0209df2ddfb6ebf296f368
7
+ data.tar.gz: 5b1a68cfd15ec88fcf6c2d287a5cb862c95db1e1846de8eb30ed2299d537c01630738ea0bbe5d2d258047fd1166866953e05fe66c346938c8cab692330fced5d
@@ -92,7 +92,7 @@ module Linecook
92
92
  def wait_ssh
93
93
  if @remote
94
94
  user = Linecook::Build::USERNAME
95
- cexec("id -u #{user} &>/dev/null || useradd -m -G sudo #{user}")
95
+ cexec("id -u #{user} || useradd -m -G sudo #{user}")
96
96
  cexec("mkdir -p /home/#{user}/.ssh")
97
97
  Linecook::Builder.ssh.upload(Linecook::SSH.public_key, "/tmp/#{@name}-pubkey")
98
98
  Linecook::Builder.ssh.run("sudo mv /tmp/#{@name}-pubkey #{@root}/home/#{user}/.ssh/authorized_keys")
@@ -7,7 +7,6 @@ module Linecook
7
7
  extend self
8
8
 
9
9
  def url(name)
10
- name = Linecook.config[:image][:images][name][:name]
11
10
  latest[:assets].find { |a| a[:name] =~ /#{name}/ }[:browser_download_url]
12
11
  end
13
12
 
@@ -14,13 +14,15 @@ module Linecook
14
14
  url_path = if image.is_a?(Symbol)
15
15
  image_name = Linecook.config[:image][:images][image][:name]
16
16
  path = File.join(IMAGE_PATH, image_name)
17
- provider(profile).url(name) unless File.exist?(path) || upgrade
17
+ provider(profile).url(image_name) unless File.exist?(path) || upgrade
18
18
  elsif image.is_a?(Hash)
19
19
  profile = :private
20
20
  encrypted = true
21
21
  name = image[:name] == :latest ? File.basename(latest(image[:type])) : image[:name]
22
22
  path = File.join([IMAGE_PATH, image[:type], name].compact)
23
23
  provider(profile).url(name, type: image[:type])
24
+ else
25
+ puts "#{image} is invalid"
24
26
  end
25
27
 
26
28
  Linecook::Downloader.download(url_path, path, encrypted: encrypted) unless File.exist?(path) || upgrade
@@ -1,3 +1,3 @@
1
1
  module Linecook
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linecook-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Hamel