continuum-stager-api 0.2.2 → 0.2.3

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: 2f6aa579caf6e92fa421193727ff865cba9820e6
4
- data.tar.gz: 81e903ff8464cea6d632da7d8543dc140eb42d0d
3
+ metadata.gz: 2e3a6b627ab832440fc2d6b7898a3aa0d256dc31
4
+ data.tar.gz: 57d827c7d0f5d08be7b4f28d7fb192b953faeca3
5
5
  SHA512:
6
- metadata.gz: f829476a2d3145331e53e566e2ebb606a5b4556c3cfd15dea5819b1a557919c449fdc655d90b0234ebf2e671c6f7ea003a4bbac6f6298f1e13c3ea169512f009
7
- data.tar.gz: 7276d5344d0ba1350aa5978da8ff2c99fd826422ba6c858cd2d8bc3d28846e8aac23793728aa7c62820ce2a7979bd81cdcf5fc71443aef9f97156d3349deb1f7
6
+ metadata.gz: f19532a6fed320b883dd772f8d474c5e040e84fad64f42ac09d6a526cdfd03a715be05e4dab5b3389bc438b55052d20c7e015c9458ddf9afd5a9d39bac303c17
7
+ data.tar.gz: 9bc33cfcf83b60529ceb0bc38b6ff39d8b697770a1607ce78896896391d044789f82d9b238b83f7de08006947d6bba0d57caafb12d6dd9fd9c7e89bbeedbcc5a
data/.gitignore CHANGED
@@ -17,6 +17,6 @@ rdoc
17
17
  spec/reports
18
18
  test/tmp
19
19
  test/version_tmp
20
- tmp
20
+ tmp/*
21
21
  .powenv
22
22
  .idea/
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014 Apcera
3
+ Copyright (c) 2014-2015 Apcera
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -65,7 +65,7 @@ apc app create someapp --staging=mystager --start
65
65
 
66
66
  The MIT License (MIT)
67
67
 
68
- Copyright (c) 2014 Apcera
68
+ Copyright (c) 2014-2015 Apcera
69
69
 
70
70
  Permission is hereby granted, free of charge, to any person obtaining a copy
71
71
  of this software and associated documentation files (the "Software"), to deal
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.test_files = `git ls-files -- {spec}/*`.split("\n")
16
16
  gem.name = "continuum-stager-api"
17
17
  gem.require_paths = ["lib"]
18
- gem.version = "0.2.2"
18
+ gem.version = "0.2.3"
19
19
 
20
20
  gem.add_development_dependency 'rspec', '~> 2.6.0'
21
21
  gem.add_development_dependency 'rake'
@@ -14,6 +14,22 @@ module Apcera
14
14
  setup_environment
15
15
  end
16
16
 
17
+ # Setup /stagerfs chroot environment so it is ready to run commands
18
+ # from pulled in dependencies. This does the following:
19
+ # - Setup working resolv.conf
20
+ # - Bind mounts /proc to /stagerfs/proc
21
+ # - Recursively bind mounts /dev to /stagerfs/dev
22
+ def setup_chroot
23
+ execute("sudo mkdir -p /stagerfs/etc")
24
+ execute("sudo cp /etc/resolv.conf /stagerfs/etc/resolv.conf")
25
+
26
+ execute("sudo mkdir -p /stagerfs/proc")
27
+ execute("sudo mount --bind /proc /stagerfs/proc")
28
+
29
+ execute("sudo mkdir -p /stagerfs/dev")
30
+ execute("sudo mount --rbind /dev /stagerfs/dev")
31
+ end
32
+
17
33
  # Download a package from the staging coordinator.
18
34
  # We use Net::HTTP here because it supports streaming downloads.
19
35
  def download
@@ -58,6 +58,19 @@ describe Apcera::Stager do
58
58
  FileUtils.rm_rf Dir.glob(test_files)
59
59
  end
60
60
 
61
+ context "setup_chroot" do
62
+ it "should setup a working chrooted environment in /stagerfs" do
63
+ @stager.should_receive(:execute).with("sudo mkdir -p /stagerfs/etc")
64
+ @stager.should_receive(:execute).with("sudo cp /etc/resolv.conf /stagerfs/etc/resolv.conf")
65
+ @stager.should_receive(:execute).with("sudo mkdir -p /stagerfs/proc")
66
+ @stager.should_receive(:execute).with("sudo mount --bind /proc /stagerfs/proc")
67
+ @stager.should_receive(:execute).with("sudo mkdir -p /stagerfs/dev")
68
+ @stager.should_receive(:execute).with("sudo mount --rbind /dev /stagerfs/dev")
69
+
70
+ @stager.setup_chroot
71
+ end
72
+ end
73
+
61
74
  context "download" do
62
75
  it "should download the app package to pkg.tar.gz" do
63
76
  VCR.use_cassette('download') do
data/spec/tmp/.gitkeep ADDED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: continuum-stager-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Ellithorpe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-09 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -161,6 +161,7 @@ files:
161
161
  - spec/fixtures/cassettes/templates_remove.yml
162
162
  - spec/fixtures/cassettes/upload.yml
163
163
  - spec/spec_helper.rb
164
+ - spec/tmp/.gitkeep
164
165
  homepage: http://apcera.com
165
166
  licenses:
166
167
  - MIT
@@ -181,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
182
  version: '0'
182
183
  requirements: []
183
184
  rubyforge_project:
184
- rubygems_version: 2.2.2
185
+ rubygems_version: 2.4.8
185
186
  signing_key:
186
187
  specification_version: 4
187
188
  summary: Continuum Stager api library which makes it super easy to write stagers for