conan_deploy 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -2
- data/lib/conan/deploy.rb +1 -1
- data/lib/conan/manifest_builder.rb +2 -1
- data/lib/conan/output.rb +11 -0
- data/lib/conan/version.rb +1 -1
- metadata +19 -3
data/README.md
CHANGED
@@ -7,14 +7,14 @@ This project provides automation for a [deployment pipeline](http://martinfowler
|
|
7
7
|
|
8
8
|
Applications are deployed from a Sonotype Nexus artifact repository, and not from the source repository. Java applications must be executable jars, and must the provide deployment resources needed in the jar. Ruby apps (Rails or otherwise) must be vendored and packaged as a tar ball, with a compatible structrue to provide the deployment resources.
|
9
9
|
|
10
|
-
Application artifacts are idenitifed and provisioned by Maven coordinates - group id, artifact id, packaging and version. The most recent version available on the repository will be used, or a promotion workflow along the pipeline(s) can be implemented by pinning the versions. Artifacts are pinned by keeping the build meta-data in an `environments` directory structure that mirrors the configuration model, which should be commited to version control after successful deployment and testing. _At this time, the `environments` directory and the `
|
10
|
+
Application artifacts are idenitifed and provisioned by Maven coordinates - group id, artifact id, packaging and version. The most recent version available on the repository will be used, or a promotion workflow along the pipeline(s) can be implemented by pinning the versions. Artifacts are pinned by keeping the build meta-data in an `environments` directory structure that mirrors the configuration model, which should be commited to version control after successful deployment and testing. _At this time, the `environments` directory and the `environments.rb` are located from the execution directory, which is assumed to be the [nexus-apps-manifest](https://github.com/MTNSatelliteComm/nexus-app-manifest) project._
|
11
11
|
|
12
12
|
Conan is also designed to be idempotent. It can be executed against a target deployment over and over, and it should not change an application unless it out of alignment with the configuration model. Applications are also assumed to support standard set of managments APIs which provide build metadata, and health to support this.
|
13
13
|
|
14
14
|
|
15
15
|
#Configuration
|
16
16
|
|
17
|
-
Configuration for the deployment pipline is loaded through a DSL which models a target environment(s). The DSL is loaded from a `
|
17
|
+
Configuration for the deployment pipline is loaded through a DSL which models a target environment(s). The DSL is loaded from a `environments.rb` file that should be provided in the execution directory.
|
18
18
|
|
19
19
|
```ruby
|
20
20
|
pipeline(:'team1') {
|
@@ -174,6 +174,13 @@ deploy.org = "mtn"
|
|
174
174
|
deploy.ship = "minnow1"
|
175
175
|
deploy_name = "foo-dev-minnow1"
|
176
176
|
```
|
177
|
+
|
178
|
+
App tokens for oauth are a special case, and assigned to special keys that will look something like:
|
179
|
+
```
|
180
|
+
oauth_id = application-gs8f8ae6-64a9-c987-c470-9c18b6fb918d
|
181
|
+
oauth_secret = "4z3r6e779455d89db8896b3f4d8c2369ae71e9ca662abb366eea905a41de1dcf"
|
182
|
+
```
|
183
|
+
|
177
184
|
The are also a number of shortcuts provided for shorter keys:
|
178
185
|
```
|
179
186
|
app_id => app.id
|
data/lib/conan/deploy.rb
CHANGED
@@ -8,7 +8,7 @@ module Conan
|
|
8
8
|
puts "> Environment: #{env}"
|
9
9
|
|
10
10
|
manifest = ManifestBuilder.build(options, pl, env) {
|
11
|
-
m = File.join(options[:directory], '
|
11
|
+
m = File.join(options[:directory], 'environments.rb')
|
12
12
|
puts "> Manifest: #{m}"
|
13
13
|
instance_eval(File.read(m), m)
|
14
14
|
}
|
@@ -3,6 +3,7 @@ require 'rexml/document'
|
|
3
3
|
require 'properties-ruby'
|
4
4
|
require 'json'
|
5
5
|
require 'securerandom'
|
6
|
+
require 'daphne_util'
|
6
7
|
|
7
8
|
require 'conan/output'
|
8
9
|
require 'conan/repository'
|
@@ -10,7 +11,7 @@ require 'conan/stackato'
|
|
10
11
|
require 'conan/newrelic'
|
11
12
|
|
12
13
|
module ManifestBuilder
|
13
|
-
def self.build(options, pipeline_id, env_id, artifact_repo=nil, outthingy=nil, &block)
|
14
|
+
def self.build(options, pipeline_id, env_id, artifact_repo=nil, outthingy=nil, &block)
|
14
15
|
manifest_dir = options[:directory]
|
15
16
|
output_type = options[:format]
|
16
17
|
|
data/lib/conan/output.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'daphne_util'
|
1
2
|
require 'conan/templates'
|
2
3
|
|
3
4
|
class OutThingy
|
@@ -80,10 +81,20 @@ class StackatoOutThingy < OutThingy
|
|
80
81
|
if (deploy.enabled?)
|
81
82
|
target_dir = workingDir(app)
|
82
83
|
templates_dir = File.join(target_dir, "deploy-templates")
|
84
|
+
|
85
|
+
daphne_tokens = [ "#{app.id}", "#{deploy.environment.id}" ]
|
86
|
+
daphne_tokens = daphne_tokens << "facility-#{deploy.facility_id}" unless deploy.facility_id.nil?
|
87
|
+
|
83
88
|
n_changes = Templates.evaluate templates_dir, target_dir, {
|
84
89
|
:app => app,
|
85
90
|
:deploy => deploy,
|
86
91
|
|
92
|
+
#daphne, generate oauth app tokens
|
93
|
+
#TODO: seems like this should be refactored
|
94
|
+
:oauth_id => DaphneUtil.generate_id(*daphne_tokens),
|
95
|
+
:oauth_secret => DaphneUtil.generate_secret(*daphne_tokens),
|
96
|
+
:api_key => DaphneUtil.generate_api_key(*daphne_tokens),
|
97
|
+
|
87
98
|
# short-cuts
|
88
99
|
:app_id => app.id,
|
89
100
|
:deploy_base_name => deploy.name(app.id),
|
data/lib/conan/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conan_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,8 +10,24 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-04-
|
14
|
-
dependencies:
|
13
|
+
date: 2014-04-16 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: daphne_util
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - '='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.2.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - '='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 0.2.0
|
15
31
|
description: Provision, configure, deploy and never hear da lamantation of da users
|
16
32
|
email: michael.reardon@mtnsat.com
|
17
33
|
executables:
|