conan_deploy 0.0.6 → 0.0.7

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OGY4ZWNhNGU2MmRmZGY1YmY0OWI0ZDNhZjBmZTBjYzMyMzQ0MTJmNA==
5
+ data.tar.gz: !binary |-
6
+ ZDBmNzgzNzc3YzYzZDc3YzY2ZjMzMjdkZDlkZjI1MDE4ZTM5NDEzNQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZjAwZWU1MjdkMjJiMjBhNjMxODZjNzU1OTFhZWEyYmI3N2RiYWI5ZjUzZmNm
10
+ ODc2YTViZGE4ZjA5ZjVjMGFlNzkwYjIwOTQzNDQ4NmUyMmVhYWEyNDMyZTE1
11
+ NGUzNGJkNTlkNTU0MTE3Y2ZhZmJkNTU4NTMyMWU2ZWIxNThkODI=
12
+ data.tar.gz: !binary |-
13
+ MDVmN2I4ZjViMTQ1MjIwODZlYjNiMWJkOTc0YjhiMDQzODQ0MWI0YWE2ZGNm
14
+ ZDJmNWQwZDliMjlhMmE4ZTdkMGJiOTc0MzI2NjNlYTJiNWUzNGM2MDQ4NGYy
15
+ ZGNhNjlhOTU5OGJhNTU2ZTBhM2Y1NDliZWI2NWIxNjM0ZDhhMGQ=
data/bin/conan CHANGED
@@ -65,6 +65,14 @@ optparse = OptionParser.new do |o|
65
65
  options[:'deploy-shipcloud'] = shipcloud
66
66
  end
67
67
 
68
+ o.on("-n", '--deploy-app-name [APPNAME]', 'Only include deployments for the given application name') do |appname|
69
+ options[:'deploy-app-name'] = appname
70
+ end
71
+
72
+ o.on("-r", '--deploy-app-version [APPVERSION]', 'Only include deployments for the given application version') do |appversion|
73
+ options[:'deploy-app-version'] = appversion
74
+ end
75
+
68
76
  o.on('-D','--dry-run', 'Deployment dry-run. Prints Stackato commands' ) do
69
77
  options[:'dry-run'] = true
70
78
  end
@@ -47,7 +47,7 @@ class Manifest
47
47
  end
48
48
 
49
49
  def pipeline(pipeline_id, &block)
50
- pl = Pipeline.new(pipeline_id, @artifact_repo, @output)
50
+ pl = Pipeline.new(pipeline_id, @artifact_repo, @output, @options)
51
51
  pl.instance_eval(&block)
52
52
  @pipelines[pipeline_id] = pl
53
53
  pl
@@ -151,22 +151,28 @@ class Pipeline
151
151
 
152
152
  attr_accessor :id, :apps
153
153
 
154
- def initialize(id, artifact_repo, output)
154
+ def initialize(id, artifact_repo, output, options)
155
155
  @id = id
156
156
  @artifact_repo = artifact_repo
157
157
  @output = output
158
- @apps = {}
158
+ @apps = {}
159
+ @options = options
159
160
  end
160
161
 
161
162
  def app(app_id, project_name, platform_type)
162
- @apps[app_id] = case platform_type
163
- when :jvm
164
- JvmApp.new(app_id, project_name, @artifact_repo)
165
- when :rails_zip
166
- RailsZipApp.new(app_id, project_name, @artifact_repo)
167
- else
168
- raise "unknown platform type: #{platform_type}"
169
- end
163
+ if (@options[:'deploy-app-name'].nil?) || (@options[:'deploy-app-name'] == app_id.to_s)
164
+ puts "No app specified, or we matched the specified app: #{@options[:'deploy-app-name']}"
165
+ @apps[app_id] = case platform_type
166
+ when :jvm
167
+ JvmApp.new(app_id, project_name, @artifact_repo)
168
+ when :rails_zip
169
+ RailsZipApp.new(app_id, project_name, @artifact_repo)
170
+ else
171
+ raise "unknown platform type: #{platform_type}"
172
+ end
173
+ else
174
+ puts "App #{app_id} doesn't match specified app #{@options[:'deploy-app-name']}, skipping"
175
+ end
170
176
  end
171
177
 
172
178
  def appVersion(app_id)
@@ -174,7 +180,7 @@ class Pipeline
174
180
  end
175
181
 
176
182
  def load!(environment, deploy_shipcloud)
177
- eachAppDeployment(environment) { |app, deploy|
183
+ eachAppDeployment(environment) { |app, deploy|
178
184
  # load the persisted meta-data
179
185
  @output.loadAppMetadataFromDeploymentIfExists(app, deploy)
180
186
  }
@@ -184,8 +190,11 @@ class Pipeline
184
190
  def update(environment, from_upstream_env)
185
191
  @apps.values.each { |app|
186
192
  puts ''
187
- # promote versions from an upstream deploy
188
- if (from_upstream_env)
193
+ if !(@options[:'deploy-app-version'].nil?)
194
+ puts "Using version from options: #{@options[:'deploy-app-version']}"
195
+ app.findRequestedVersion(@options[:'deploy-app-version'])
196
+ elsif (from_upstream_env)
197
+ # promote versions from an upstream deploy
189
198
  # TODO: this needs improving
190
199
  puts "Promote #{app.id} from #{from_upstream_env.id} to #{environment.id}"
191
200
  upstream_deploy = from_upstream_env.deployments.select { |d| d.app_ids.select {|x| x == app.id }.size > 0 }.first
@@ -193,7 +202,7 @@ class Pipeline
193
202
  else
194
203
  puts "Find latest #{app.artifact_id}"
195
204
  # lookup most recent from repo
196
- app.findLatestVersion()
205
+ app.findRequestedVersion('LATEST')
197
206
  end
198
207
  @output.clean(app, environment)
199
208
  # download artifacts
@@ -272,7 +281,8 @@ class Application
272
281
  @artifact_id = mvn_id[1]
273
282
  end
274
283
 
275
- def findLatestVersion
284
+ def findRequestedVersion(requested_version='LATEST')
285
+ puts("Finding requested version: #{requested_version}")
276
286
  extension = case platform_type
277
287
  when :jvm
278
288
  "jar"
@@ -281,8 +291,8 @@ class Application
281
291
  else
282
292
  raise "Unsupported platform type: #{platform_type}"
283
293
  end
284
- readArtifactMetadata(@artifact_repo.resolveArtifact(group_id, artifact_id, extension))
285
- puts "- Found latest #{@id} artifact\n"+
294
+ readArtifactMetadata(@artifact_repo.resolveArtifact(group_id, artifact_id, extension, requested_version))
295
+ puts "- Found version #{version} #{@id} artifact\n"+
286
296
  " Artifact: #{self}\n" +
287
297
  " Checksum: #{@sha1}"
288
298
  end
data/lib/conan/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Conan
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conan_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
5
- prerelease:
4
+ version: 0.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mike Reardon
@@ -10,12 +9,11 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-04-26 00:00:00.000000000 Z
12
+ date: 2014-04-28 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: daphne_util
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - '='
21
19
  - !ruby/object:Gem::Version
@@ -23,7 +21,6 @@ dependencies:
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - '='
29
26
  - !ruby/object:Gem::Version
@@ -35,6 +32,7 @@ executables:
35
32
  extensions: []
36
33
  extra_rdoc_files: []
37
34
  files:
35
+ - README.md
38
36
  - bin/conan
39
37
  - lib/conan/application_helper.rb
40
38
  - lib/conan/deploy.rb
@@ -46,29 +44,27 @@ files:
46
44
  - lib/conan/stackato.rb
47
45
  - lib/conan/templates.rb
48
46
  - lib/conan/version.rb
49
- - README.md
50
47
  homepage: http://github.com/MTNSatelliteComm/conan/README.md
51
48
  licenses: []
49
+ metadata: {}
52
50
  post_install_message:
53
51
  rdoc_options: []
54
52
  require_paths:
55
53
  - lib
56
54
  required_ruby_version: !ruby/object:Gem::Requirement
57
- none: false
58
55
  requirements:
59
56
  - - ! '>='
60
57
  - !ruby/object:Gem::Version
61
58
  version: '0'
62
59
  required_rubygems_version: !ruby/object:Gem::Requirement
63
- none: false
64
60
  requirements:
65
61
  - - ! '>='
66
62
  - !ruby/object:Gem::Version
67
63
  version: '0'
68
64
  requirements: []
69
65
  rubyforge_project:
70
- rubygems_version: 1.8.23
66
+ rubygems_version: 2.2.2
71
67
  signing_key:
72
- specification_version: 3
68
+ specification_version: 4
73
69
  summary: Conan da Deployer
74
70
  test_files: []