continuum-stager-api 0.2.0 → 0.2.1
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/README.md +52 -3
- data/apcera-stager-api-contrib.gemspec +1 -1
- data/lib/apcera/stager/stager.rb +2 -3
- data/spec/apcera/stager/stager_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9a3c45ff6b52a8e4710ede0568aa5a33f69b39d
|
4
|
+
data.tar.gz: 8977446f15bcaea982b18a63b2b9fdb4842c934f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa75f52fb202c63fdc06c38f5165c5978fd69ade4f34703e5f723f963c749620b59dc787876ed75879ebd613c77adb1fb6b80931c8a80ddbf40a194a72d3ff3b
|
7
|
+
data.tar.gz: 96ecb863c5a4a76759afff4bfd8ad89ebddf34f0f3e7b14da173810f0dbe2077e97bc09ca46e8d6032c0b13b9d44a5a246c89802045803f3dd05406a92d0d204
|
data/README.md
CHANGED
@@ -2,15 +2,64 @@
|
|
2
2
|
|
3
3
|
Simple gem to assist users writing custom Continuum Stagers.
|
4
4
|
|
5
|
-
##
|
5
|
+
## Usage
|
6
6
|
|
7
|
-
|
7
|
+
First create your Gemfile. The contents should be:
|
8
8
|
|
9
9
|
```ruby
|
10
|
+
source "https://rubygems.org"
|
11
|
+
|
10
12
|
gem "continuum-stager-api"
|
11
13
|
```
|
12
14
|
|
13
|
-
Then `bundle install
|
15
|
+
Then run `bundle install` to download and install the gem and its dependencies.
|
16
|
+
|
17
|
+
Now that your environment is setup, create a new file for your stager. We recommend "stager.rb".
|
18
|
+
|
19
|
+
Start off with the contents:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
#!/usr/bin/env ruby
|
23
|
+
|
24
|
+
require "bundler"
|
25
|
+
Bundler.setup
|
26
|
+
|
27
|
+
require "continuum-stager-api"
|
28
|
+
|
29
|
+
stager = Apcera::Stager.new
|
30
|
+
|
31
|
+
# Download the package from the staging coordinator.
|
32
|
+
# This is the code that requires staging!
|
33
|
+
puts "Downloading Package..."
|
34
|
+
stager.download
|
35
|
+
|
36
|
+
# Extract the package to the "app" directory.
|
37
|
+
puts "Extracting Package..."
|
38
|
+
stager.extract("app")
|
39
|
+
|
40
|
+
# Your custom staging logic goes here.
|
41
|
+
# This will be a set of commands to execute in order to stage
|
42
|
+
# your applications.
|
43
|
+
|
44
|
+
# Finish staging, this will upload your final package to the
|
45
|
+
# staging coordinator.
|
46
|
+
puts "Completed Staging..."
|
47
|
+
stager.complete
|
48
|
+
```
|
49
|
+
|
50
|
+
## Deploying
|
51
|
+
|
52
|
+
Deploying just requires you to run `apc stager create`.
|
53
|
+
|
54
|
+
```console
|
55
|
+
apc stager create mystager --start-command="./stager.rb" --staging=/apcera::ruby --pipeline
|
56
|
+
```
|
57
|
+
|
58
|
+
Now you can deploy apps using your stager with `apc app create`.
|
59
|
+
|
60
|
+
```console
|
61
|
+
apc app create someapp --staging=mystager --start
|
62
|
+
```
|
14
63
|
|
15
64
|
## License
|
16
65
|
|
@@ -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.
|
18
|
+
gem.version = "0.2.1"
|
19
19
|
|
20
20
|
gem.add_development_dependency 'rspec', '~> 2.6.0'
|
21
21
|
gem.add_development_dependency 'rake'
|
data/lib/apcera/stager/stager.rb
CHANGED
@@ -114,12 +114,11 @@ module Apcera
|
|
114
114
|
end
|
115
115
|
|
116
116
|
# Delete environment variable from package.
|
117
|
-
def environment_remove(key
|
117
|
+
def environment_remove(key)
|
118
118
|
response = RestClient.put(stager_meta_url, {
|
119
119
|
:resource => "environment",
|
120
120
|
:action => "remove",
|
121
|
-
:key => key
|
122
|
-
:value => value
|
121
|
+
:key => key
|
123
122
|
})
|
124
123
|
rescue => e
|
125
124
|
fail e
|
@@ -361,7 +361,7 @@ describe Apcera::Stager do
|
|
361
361
|
context "environment_remove" do
|
362
362
|
it "should environment_remove an environment variable" do
|
363
363
|
VCR.use_cassette('environment_remove') do
|
364
|
-
@stager.environment_remove("TEST_VAR"
|
364
|
+
@stager.environment_remove("TEST_VAR")
|
365
365
|
end
|
366
366
|
end
|
367
367
|
|
@@ -369,7 +369,7 @@ describe Apcera::Stager do
|
|
369
369
|
@stager.should_receive(:exit0r).with(1) { raise }
|
370
370
|
|
371
371
|
VCR.use_cassette('invalid/environment_remove') do
|
372
|
-
expect { @stager.environment_remove("TEST_VAR"
|
372
|
+
expect { @stager.environment_remove("TEST_VAR") }.to raise_error
|
373
373
|
end
|
374
374
|
end
|
375
375
|
end
|
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.
|
4
|
+
version: 0.2.1
|
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-08
|
11
|
+
date: 2014-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|