idlc-sdk-pfm 1.0.15 → 1.0.16

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
- SHA256:
3
- metadata.gz: 1cf02901fb246ecb7aad1e78a5696d62001c19e08adb7187d12db96dd4a21db7
4
- data.tar.gz: 4d3176410fa5853e0da49c18af285627581d24bd6bcea539985fd21ec90e0d44
2
+ SHA1:
3
+ metadata.gz: 368c1332b56c992f8fd1bb17c89ed33e821c5bc1
4
+ data.tar.gz: fb45b6c775d46e17a15e7c2bd31a79b76fdc2d9b
5
5
  SHA512:
6
- metadata.gz: 6bd36ca5cb1e8ab258ef7dc5e5941a1e6a1ef4ebfe66cea7540d76a8d269f48edfac5d44475e5c137ee1c1fffa60f6cc0138f4b9616b5a2335829be9eaf8d621
7
- data.tar.gz: 62392f4912af98cfefc539c6dd18b9f0d0183230206c3de5d46d6facb1d4edfdf17745abfa13d890311299945d920b5fb1391fa76e9532f3ee35c02b90710935
6
+ metadata.gz: 8a6466824157cfc2f5ca4ccc9409fa25cc21632b64162bcdcc4752a69cc804c2ee883327b8c49a8d5487902531d0221d8ae04101cc1077d281737e99f8ac6204
7
+ data.tar.gz: 7f1935f052faba9c0421524cbbdacfbfb38eea10123a562a9b51ede3e6f0144a988447246ecd967c4d50525529193b0a917b312487f91240d76f4bc93dfcd9ac
data/idlc-sdk-pfm.gemspec CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_runtime_dependency 'idlc-sdk-core'
37
37
  spec.add_runtime_dependency 'idlc-sdk-build'
38
38
  spec.add_runtime_dependency 'idlc-sdk-deploy'
39
+ spec.add_runtime_dependency 'aws-sdk-s3'
39
40
  spec.add_runtime_dependency 'berkshelf'
40
41
  spec.add_runtime_dependency 'chefspec'
41
42
  spec.add_runtime_dependency 'foodcritic-junit'
@@ -1,5 +1,7 @@
1
1
  require 'idlc-sdk-pfm/command/base'
2
2
  require 'mixlib/shellout'
3
+ require 'aws-sdk-s3'
4
+ require 'json'
3
5
 
4
6
  module Pfm
5
7
  module Command
@@ -46,10 +48,35 @@ module Pfm
46
48
  workspace.add('backend.tf') if File.exist? 'backend.tf'
47
49
  workspace.add('infraspec.yml') if File.exist? 'infraspec.yml'
48
50
 
49
- dest_zip = "./.pfm/#{@config[:application_name]}.#{REPO_VERSION}.infra.zip"
51
+ package_name = "#{@config[:application_name]}.#{REPO_VERSION}.infra.zip"
52
+ dest_zip = "./.pfm/#{package_name}"
50
53
  FileUtils.rm_rf(dest_zip) if File.exist? dest_zip
51
54
  Idlc::Workspace.zip_folder(workspace.tmp_dir, dest_zip)
52
55
  msg("packaged to #{dest_zip}")
56
+
57
+ # upload to s3
58
+ s3 = Aws::S3::Resource.new(region: SETTINGS['AWS_REGION'])
59
+ obj = s3.bucket('service-build-dev-build-artifacts').object(package_name)
60
+ obj.upload_file(dest_zip)
61
+ msg('Pushed package to S3.')
62
+
63
+ # register with Orchestrate Build
64
+ raise InvalidRepository, 'Missing configuration.schema.json file in root.' unless File.exist? 'configuration.schema.json'
65
+ client = Idlc::AWSRestClient.new()
66
+
67
+ request = {
68
+ service: 'build',
69
+ method: 'PUT',
70
+ path: '/builds',
71
+ body: {
72
+ application_name: @config[:application_name],
73
+ revision: REPO_VERSION,
74
+ artifact_path: "s3://service-build-dev-build-artifacts/#{package_name}",
75
+ configuration_schema: JSON.parse(File.read('configuration.schema.json'))
76
+ }
77
+ }
78
+
79
+ response = client.fetch(request.to_json)
53
80
  end
54
81
 
55
82
  def read_and_validate_params
@@ -1,3 +1,3 @@
1
1
  module Pfm
2
- VERSION = '1.0.15'.freeze
2
+ VERSION = '1.0.16'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idlc-sdk-pfm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Cazell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-29 00:00:00.000000000 Z
11
+ date: 2018-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: aws-sdk-s3
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: berkshelf
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -378,7 +392,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
378
392
  version: '0'
379
393
  requirements: []
380
394
  rubyforge_project:
381
- rubygems_version: 2.7.3
395
+ rubygems_version: 2.6.11
382
396
  signing_key:
383
397
  specification_version: 4
384
398
  summary: IDLC SDK for AWS resources - PFM