dock0 0.0.4 → 0.0.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: 86db9bf623fa4fbb36f27052e0840772fa84a5dd
4
- data.tar.gz: d018c8f6b981ac4f65951c7071ae4d041f6b309a
3
+ metadata.gz: 72a1ac483ac3434ca192c35f523914204bcbb94b
4
+ data.tar.gz: 52387fb55eebc89045520cf4233baf152173d3ab
5
5
  SHA512:
6
- metadata.gz: e53cdc249cb4ad2d804ba87035f3099e3b99befaf5af20ccc7816171dfb2517dee844652e5f16d02d065eec3903ecd666dd9083950c7b814e3a198b50cb10b76
7
- data.tar.gz: 8de5fd31242d696a9d577a20225c6e7f6cad1358632c47fa42518496020421cf65d9a8162622fded233c50e146b56fcc331b2c5b7ed7aafb4c9efe02838ae35d
6
+ metadata.gz: 8fe7377163f44daef47d2a0ad380bb2884c1af22e8a58700004f4174b570a84455ef32e77a25ee2b033a6cfbee08cd1f0b253ad6a06b52deaaa4cc33383f0548
7
+ data.tar.gz: a97849f1eb43477128dcbc6e78294e64740de6be50b283fa308dd4bcb4748aec6a281dbc8cc8a7f1cc5628a6a6033b70125ac5cd1833aa9374b373ac76f41b97
data/.travis.yml CHANGED
@@ -8,7 +8,6 @@ notifications:
8
8
  email: false
9
9
  irc:
10
10
  channels:
11
- - ircs://irc.oftc.net:6697#akerl
12
- channel_key: sekrit
11
+ - secure: dfWgouxmAn52BMnVIonQJv4XXXL+9nMRehTQIESu67yZF8laXmLfXFTer20OqLeHfjU94TL2LKaijzR1jlMKwwwe6960vsaWMlX4Lx9BK3OKDHO0d2+IpqrmKwlKyA2dfLTf0SX8VpaF6YNt88V6Zk7uiaiU9ea+9qYkBsFp2vc=
13
12
  template:
14
- - '%{repository}/%{branch}/%{build_number}: %{message} -- %{build_url}'
13
+ - "%{repository}/%{branch}/%{build_number}: %{message} -- %{build_url}"
data/README.md CHANGED
@@ -1,9 +1,12 @@
1
1
  dock0
2
2
  =========
3
3
 
4
- [![Gem Version](https://badge.fury.io/rb/dock0.png)](http://badge.fury.io/rb/dock0)
5
- [![Dependency Status](https://gemnasium.com/akerl/dock0.png)](https://gemnasium.com/akerl/dock0)
6
- [![Code Climate](https://codeclimate.com/github/akerl/dock0.png)](https://codeclimate.com/github/akerl/dock0)
4
+ [![Gem Version](https://img.shields.io/gem/v/dock0.svg)](https://rubygems.org/gems/dock0)
5
+ [![Dependency Status](https://img.shields.io/gemnasium/dock0/dock0.svg)](https://gemnasium.com/dock0/dock0)
6
+ [![Code Climate](https://img.shields.io/codeclimate/github/dock0/dock0.svg)](https://codeclimate.com/github/dock0/dock0)
7
+ [![Coverage Status](https://img.shields.io/coveralls/dock0/dock0.svg)](https://coveralls.io/r/dock0/dock0)
8
+ [![Build Status](https://img.shields.io/travis/dock0/dock0.svg)](https://travis-ci.org/dock0/dock0)
9
+ [![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
7
10
 
8
11
  Dynamic Arch image generator for building a read-only host system for [Docker](https://www.docker.io)
9
12
 
@@ -11,7 +14,7 @@ Dynamic Arch image generator for building a read-only host system for [Docker](h
11
14
 
12
15
  This is basically a meta-script that builds Arch images. Its primary use is to build read-only Docker hosts for me, but it could realistically be repurposed for other kinds of minimal deployments.
13
16
 
14
- An example configuration can be found in [this repo](https://www.github.com/akerl/my_dock0).
17
+ An example configuration can be found in [this repo](https://www.github.com/dock0/host_config).
15
18
 
16
19
  The dock0 command accepts a list of configuration files as arguments. It changes to the directory of the first file given, so all other files and configuration options can use relative pathing based from that location:
17
20
 
data/Rakefile CHANGED
@@ -1,21 +1,19 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
2
3
  require 'rubocop/rake_task'
3
4
 
4
- desc 'Update bundle'
5
- task :bundle do
6
- `bundle update`
7
- end
5
+ desc 'Run tests'
6
+ RSpec::Core::RakeTask.new(:spec)
8
7
 
9
8
  desc 'Run Rubocop on the gem'
10
9
  Rubocop::RakeTask.new(:rubocop) do |task|
11
- task.patterns = ['lib/**/*.rb', 'spec/*.rb', 'spec/helpers/*.rb', 'bin/*']
10
+ task.patterns = ['lib/**/*.rb', 'spec/**/*.rb']
12
11
  task.fail_on_error = true
13
12
  end
14
13
 
15
14
  desc 'Run travis-lint on .travis.yml'
16
15
  task :travislint do
17
- print 'There is an issue with your .travis.yml' unless system('travis-lint')
16
+ print 'There may be an issue with your .travis.yml' unless system('travis-lint')
18
17
  end
19
18
 
20
- task default: [:travislint, :rubocop, :build]
21
- task release: [:bundle]
19
+ task default: [:spec, :travislint, :rubocop, :build]
data/dock0.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'dock0'
3
- s.version = '0.0.4'
3
+ s.version = '0.0.5'
4
4
  s.date = Time.now.strftime("%Y-%m-%d")
5
5
 
6
6
  s.summary = 'Builds a read-only Arch host for Docker'
@@ -14,8 +14,10 @@ Gem::Specification.new do |s|
14
14
  s.test_files = `git ls-files spec/*`.split
15
15
  s.executables = ['dock0']
16
16
 
17
- s.add_development_dependency 'rubocop'
18
- s.add_development_dependency 'travis-lint'
19
- s.add_development_dependency 'rake'
20
- s.add_development_dependency 'fuubar'
17
+ s.add_development_dependency 'rubocop', '~> 0.19.0'
18
+ s.add_development_dependency 'travis-lint', '~> 1.8.0'
19
+ s.add_development_dependency 'rake', '~> 10.1.1'
20
+ s.add_development_dependency 'coveralls', '~> 0.7.0'
21
+ s.add_development_dependency 'rspec', '~> 2.14.1'
22
+ s.add_development_dependency 'fuubar', '~> 1.3.2'
21
23
  end
data/lib/dock0.rb CHANGED
@@ -4,7 +4,6 @@ require 'English'
4
4
 
5
5
  ##
6
6
  # Dock0 provides an interface for building Arch images
7
-
8
7
  module Dock0
9
8
  class << self
10
9
  ##
@@ -17,7 +16,6 @@ module Dock0
17
16
 
18
17
  ##
19
18
  # An Image is an Arch system being built
20
-
21
19
  class Image
22
20
  attr_reader :device_path, :config
23
21
 
@@ -28,6 +26,7 @@ module Dock0
28
26
  @config = configs.each_with_object({}) do |path, obj|
29
27
  obj.merge! YAML.load(File.read(path))
30
28
  end
29
+ @stamp = Time.new.strftime '%F-%H%M'
31
30
  end
32
31
 
33
32
  def run(cmd)
@@ -66,6 +65,9 @@ module Dock0
66
65
  puts "Applying overlay from #{@config['paths']['overlay']}"
67
66
  overlay_path = @config['paths']['overlay'] + '/.'
68
67
  FileUtils.cp_r overlay_path, @config['paths']['build']
68
+ File.open("#{@config['paths']['build']}/.stamp", 'w') do |fh|
69
+ fh.write @stamp
70
+ end
69
71
  end
70
72
 
71
73
  def run_scripts
@@ -88,13 +90,19 @@ module Dock0
88
90
  end
89
91
 
90
92
  def finalize
91
- sleep 5
92
93
  puts 'Packing up root FS'
94
+ mount_path = @config['paths']['mount']
95
+ squash_path = "#{mount_path}/#{@stamp}.fs.sfs"
93
96
  run "umount #{@config['paths']['build']}"
94
- run "mksquashfs #{@config['paths']['build_file']} \
95
- #{@config['paths']['mount']}/root.fs.sfs"
97
+ run "mksquashfs #{@config['paths']['build_file']} #{squash_path}"
98
+ File.symlink "#{@stamp}.fs.sfs", "#{mount_path}/root.fs.sfs"
99
+ end
100
+
101
+ def cleanup
96
102
  puts 'Unmounting target device'
97
- run "umount #{@config['paths']['mount']}"
103
+ run "umount #{mount_path}"
104
+ puts 'Removing temporary build image'
105
+ File.unlink @config['paths']['build_file']
98
106
  end
99
107
 
100
108
  def easy_mode
@@ -104,7 +112,9 @@ module Dock0
104
112
  apply_overlay
105
113
  run_scripts
106
114
  run_commands
115
+ sleep 5
107
116
  finalize
117
+ cleanup
108
118
  end
109
119
  end
110
120
  end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Dock0 do
4
+ it 'is' do
5
+ expect(1).to eql 1
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require 'simplecov'
2
+ require 'coveralls'
3
+
4
+ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
5
+ SimpleCov.start do
6
+ add_filter '/spec/'
7
+ end
8
+
9
+ require 'rspec'
10
+ require 'dock0'
metadata CHANGED
@@ -1,71 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dock0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-07 00:00:00.000000000 Z
11
+ date: 2014-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.19.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.19.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: travis-lint
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.8.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 1.8.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 10.1.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 10.1.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.7.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 0.7.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 2.14.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 2.14.1
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: fuubar
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
- - - ">="
87
+ - - ~>
60
88
  - !ruby/object:Gem::Version
61
- version: '0'
89
+ version: 1.3.2
62
90
  type: :development
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
- - - ">="
94
+ - - ~>
67
95
  - !ruby/object:Gem::Version
68
- version: '0'
96
+ version: 1.3.2
69
97
  description: Generates a read-only Arch host for running Docker containers
70
98
  email: me@lesaker.org
71
99
  executables:
@@ -73,10 +101,10 @@ executables:
73
101
  extensions: []
74
102
  extra_rdoc_files: []
75
103
  files:
76
- - ".gitignore"
77
- - ".rspec"
78
- - ".rubocop.yml"
79
- - ".travis.yml"
104
+ - .gitignore
105
+ - .rspec
106
+ - .rubocop.yml
107
+ - .travis.yml
80
108
  - Gemfile
81
109
  - LICENSE
82
110
  - README.md
@@ -84,6 +112,8 @@ files:
84
112
  - bin/dock0
85
113
  - dock0.gemspec
86
114
  - lib/dock0.rb
115
+ - spec/dock0_spec.rb
116
+ - spec/spec_helper.rb
87
117
  homepage: https://github.com/aker/dock0
88
118
  licenses:
89
119
  - MIT
@@ -94,18 +124,20 @@ require_paths:
94
124
  - lib
95
125
  required_ruby_version: !ruby/object:Gem::Requirement
96
126
  requirements:
97
- - - ">="
127
+ - - '>='
98
128
  - !ruby/object:Gem::Version
99
129
  version: '0'
100
130
  required_rubygems_version: !ruby/object:Gem::Requirement
101
131
  requirements:
102
- - - ">="
132
+ - - '>='
103
133
  - !ruby/object:Gem::Version
104
134
  version: '0'
105
135
  requirements: []
106
136
  rubyforge_project:
107
- rubygems_version: 2.0.14
137
+ rubygems_version: 2.0.3
108
138
  signing_key:
109
139
  specification_version: 4
110
140
  summary: Builds a read-only Arch host for Docker
111
- test_files: []
141
+ test_files:
142
+ - spec/dock0_spec.rb
143
+ - spec/spec_helper.rb