vocker 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/development/Vagrantfile +0 -1
- data/lib/vocker/cap/debian/docker_install.rb +6 -6
- data/lib/vocker/docker_client.rb +13 -7
- data/lib/vocker/provisioner.rb +1 -1
- data/lib/vocker/version.rb +1 -1
- data/spec/unit/docker_client_spec.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 315ab3e764686000c69f9d0cb24bf5893fddad0f
|
4
|
+
data.tar.gz: 402042dff0ed768ace0fc49032ed043e666e8393
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7136d70584226624f2b1e90748807dbee4a8af868d215b7afb3d04ba6ea7d35192c709a595b277d080c8848f380234eec872908db99e510fc6a2126200b1e42
|
7
|
+
data.tar.gz: 42723e0cae99b1ae6026fd357d106a95ce8a1985fea5b950ed62bee437693cd580549ddb542910013a08bb418efa4cb3687be1ac2a2fafce09cd2527628264ca
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
data/development/Vagrantfile
CHANGED
@@ -10,7 +10,6 @@ Vagrant.require_plugin 'vocker'
|
|
10
10
|
Vagrant.configure("2") do |config|
|
11
11
|
config.vm.box = "raring64"
|
12
12
|
config.vm.synced_folder "../", "/vagrant", id: 'vagrant-root'#, nfs: true
|
13
|
-
config.vm.synced_folder "~/projetos/oss/ventriloquist", "/home/vagrant/ventriloquist"
|
14
13
|
config.vm.network :private_network, ip: "192.168.123.123"
|
15
14
|
|
16
15
|
config.cache.auto_detect = true
|
@@ -4,15 +4,15 @@ module VagrantPlugins
|
|
4
4
|
module Debian
|
5
5
|
module DockerInstall
|
6
6
|
def self.docker_install(machine)
|
7
|
-
# Inspired on https://github.com/progrium/dokku/blob/master/Makefile#L33-L40
|
8
7
|
machine.communicate.tap do |comm|
|
9
|
-
# TODO:
|
10
|
-
|
11
|
-
|
8
|
+
# TODO: Perform check on the host machine if aufs is installed and using LXC
|
9
|
+
if machine.provider_name != :lxc
|
10
|
+
comm.sudo("lsmod | grep aufs || modprobe aufs || apt-get install -y linux-image-extra-`uname -r`")
|
11
|
+
end
|
12
|
+
comm.sudo("curl http://get.docker.io/gpg | apt-key add -")
|
13
|
+
comm.sudo("echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list")
|
12
14
|
comm.sudo("apt-get update")
|
13
15
|
comm.sudo("apt-get install -y -q xz-utils lxc-docker -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold'")
|
14
|
-
# TODO: Error out if provider is lxc
|
15
|
-
# comm.sudo("lsmod | grep aufs || modprobe aufs || apt-get install -y linux-image-extra-`uname -r`")
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/vocker/docker_client.rb
CHANGED
@@ -24,14 +24,20 @@ module VagrantPlugins
|
|
24
24
|
cids_dir = "/var/lib/vocker/cids"
|
25
25
|
config[:cidfile] ||= "#{cids_dir}/#{Digest::SHA1.hexdigest name}"
|
26
26
|
|
27
|
-
id = "$(cat #{config[:cidfile]})"
|
28
|
-
|
29
27
|
@machine.communicate.sudo("mkdir -p #{cids_dir}")
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
run_container(config)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def run_container(config)
|
33
|
+
raise "Container's cidfile was not provided!" unless config[:cidfile]
|
34
|
+
|
35
|
+
id = "$(cat #{config[:cidfile]})"
|
36
|
+
|
37
|
+
if container_exist?(id)
|
38
|
+
start_container(id)
|
39
|
+
else
|
40
|
+
create_container(config)
|
35
41
|
end
|
36
42
|
end
|
37
43
|
|
data/lib/vocker/provisioner.rb
CHANGED
@@ -14,7 +14,7 @@ module VagrantPlugins
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def provision
|
17
|
-
@logger = Log4r::Logger.new("vagrant::
|
17
|
+
@logger = Log4r::Logger.new("vagrant::provisioners::vocker")
|
18
18
|
|
19
19
|
@logger.info("Checking for Docker installation...")
|
20
20
|
@installer.ensure_installed
|
data/lib/vocker/version.rb
CHANGED
@@ -32,7 +32,7 @@ describe VagrantPlugins::Vocker::DockerClient do
|
|
32
32
|
|
33
33
|
it 'ensures container ids folder exists' do
|
34
34
|
subject.run containers
|
35
|
-
expect(communicator).to have_received.sudo(
|
35
|
+
expect(communicator).to have_received.sudo('mkdir -p /var/lib/vocker/cids')
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'automatically assigns a digest of the command as the cidfile if not specified' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vocker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabio Rehm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -47,6 +47,8 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- .gitignore
|
49
49
|
- .rspec
|
50
|
+
- .travis.yml
|
51
|
+
- CHANGELOG.md
|
50
52
|
- Gemfile
|
51
53
|
- Gemfile.lock
|
52
54
|
- Guardfile
|