linecook-gem 0.4.1 → 0.4.2
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.
- checksums.yaml +4 -4
- data/lib/linecook/builder/build.rb +2 -2
- data/lib/linecook/cli.rb +1 -0
- data/lib/linecook/provisioner/manager.rb +1 -1
- data/lib/linecook/util/ssh.rb +1 -1
- data/lib/linecook/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24bf13e1616e8352819d62a8a7456dac3c2810a9
|
4
|
+
data.tar.gz: 93ac6a5839f3bd104b6b4b6be422683cefb4647d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aaaf7df96d2febdb5edc58dc27034d20ff00e906dc762fe15ec27291b310e3d47002d05cc3195043b73042a747c195a8fd760fdeb1b57b6c156e445e6ade4e0
|
7
|
+
data.tar.gz: 22af8bbb43d7495428e2db2a80562b4ca18549a9ae993ad3fa40b13bb5111e3e80a8b983473b54084f55a60f07913c461807b6732b2bda84eee7af0464e670e1
|
@@ -25,11 +25,11 @@ module Linecook
|
|
25
25
|
@ssh ||= Linecook::SSH.new(@container.ip, username: USERNAME, proxy: Linecook::Builder.ssh, keyfile: Linecook::SSH.private_key, setup: false)
|
26
26
|
end
|
27
27
|
|
28
|
-
def snapshot(save: false)
|
28
|
+
def snapshot(save: false, resume: false)
|
29
29
|
path = "/tmp/#{@id}-#{Time.now.to_i}.squashfs"
|
30
30
|
@container.pause
|
31
31
|
Linecook::Builder.ssh.run("sudo mksquashfs #{@container.root} #{path} -wildcards -e 'usr/src' 'var/lib/apt/lists/archive*' 'var/cache/apt/archives'") # FIXME make these excludes dynamic based on OS
|
32
|
-
@container.resume
|
32
|
+
@container.resume if resume
|
33
33
|
path = if save
|
34
34
|
local_path = File.join(Linecook::ImageManager::IMAGE_PATH, File.basename(path))
|
35
35
|
Linecook::Builder.ssh.download(path, local: local_path)
|
data/lib/linecook/cli.rb
CHANGED
@@ -114,6 +114,7 @@ class Build < Thor
|
|
114
114
|
|
115
115
|
desc 'snapshot', 'Take a snapshot of the build with NAME'
|
116
116
|
method_option :name, type: :string, required: true, banner: 'ROLE_NAME', desc: 'Name of the role to build', aliases: '-n'
|
117
|
+
method_option :resume, type: :boolean, default: false, desc: 'Resume the build after snapshotting it', aliases: '-r'
|
117
118
|
def snapshot
|
118
119
|
build = Linecook::Build.new(name, '')
|
119
120
|
build.snapshot(save: true)
|
@@ -12,7 +12,7 @@ module Linecook
|
|
12
12
|
def bake(name: nil, tag: nil, id: nil, snapshot: nil, upload: nil, package: nil, build: nil, keep: nil, clean: nil)
|
13
13
|
build_agent = Linecook::Build.new(name, tag: tag, id: id, image: image(name))
|
14
14
|
provider(name).provision(build_agent, name) if build
|
15
|
-
snapshot = build_agent.snapshot(save: true) if snapshot || upload || package
|
15
|
+
snapshot = build_agent.snapshot(save: true, resume: true unless clean) if snapshot || upload || package
|
16
16
|
Linecook::ImageManager.upload(snapshot, type: build_agent.type) if upload || package
|
17
17
|
Linecook::Packager.package(snapshot, type: build_agent.type) if package
|
18
18
|
rescue => e
|
data/lib/linecook/util/ssh.rb
CHANGED
@@ -88,7 +88,7 @@ module Linecook
|
|
88
88
|
|
89
89
|
def forward(local, remote:nil)
|
90
90
|
remote ||= local
|
91
|
-
opts = { password: @password }
|
91
|
+
opts = { password: @password, paranoid: Net::SSH::Verifiers::Null.new }
|
92
92
|
opts.merge!({ proxy: @proxy }) if @proxy
|
93
93
|
@session = Net::SSH.start(@hostname, @username, opts)
|
94
94
|
@session.forward.remote(local, '127.0.0.1', remote)
|
data/lib/linecook/version.rb
CHANGED