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 +5 -5
- data/idlc-sdk-pfm.gemspec +1 -0
- data/lib/idlc-sdk-pfm/command/package.rb +28 -1
- data/lib/idlc-sdk-pfm/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 368c1332b56c992f8fd1bb17c89ed33e821c5bc1
|
4
|
+
data.tar.gz: fb45b6c775d46e17a15e7c2bd31a79b76fdc2d9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/idlc-sdk-pfm/version.rb
CHANGED
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.
|
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:
|
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.
|
395
|
+
rubygems_version: 2.6.11
|
382
396
|
signing_key:
|
383
397
|
specification_version: 4
|
384
398
|
summary: IDLC SDK for AWS resources - PFM
|