idlc-sdk-build 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/.yardopts +1 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +37 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/idlc-sdk-build.gemspec +38 -0
- data/lib/idlc-sdk-build/config.rb +34 -0
- data/lib/idlc-sdk-build/httpd.rb +50 -0
- data/lib/idlc-sdk-build/metadata.rb +114 -0
- data/lib/idlc-sdk-build/template.rb +26 -0
- data/lib/idlc-sdk-build/templates/app/build.json.erb +70 -0
- data/lib/idlc-sdk-build/templates/base/build.json.erb +61 -0
- data/lib/idlc-sdk-build/version.rb +5 -0
- data/lib/idlc-sdk-build.rb +20 -0
- metadata +204 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 40e2f1e201b7e961809bd06374cbd4c6f4fadfe6
|
4
|
+
data.tar.gz: bc4f1685aecdec00c7fa6ef62847dc0053211415
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 043a583716007df31111e171cbbb0739468bcd01393b7626cb7e23fe927de2726da916b0b62b2a11a04cf409b3e4bd4515de9a61a34978e88a8cf9c26c5d1f84
|
7
|
+
data.tar.gz: f64962b51efb2f8d4feaf8df115ab72fef23aec2da88abf515dc54a3b4b54d0450d33b8739a1997ad2bcd8ea0d8d3bd8f0f2b62d5adcccf44f30133cda12bc0f
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
-m markdown
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Nathan Cazell
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Idlc::Sdk::Build
|
2
|
+
|
3
|
+
Provides build libraries for idlc-sdk. This gem is part of the IDLC SDK
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'idlc-sdk-build'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install idlc-sdk-build
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
require 'idlc-sdk-build'
|
24
|
+
|
25
|
+
## Development
|
26
|
+
|
27
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
28
|
+
|
29
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
30
|
+
|
31
|
+
## Contributing
|
32
|
+
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/nathantcz/idlc-sdk-build.
|
34
|
+
|
35
|
+
## License
|
36
|
+
|
37
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "idlc/sdk/build"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "idlc-sdk-build/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "idlc-sdk-build"
|
8
|
+
spec.version = Idlc::Build::VERSION
|
9
|
+
spec.authors = ["Nathan Cazell"]
|
10
|
+
spec.email = ["nathan.cazell@imageapi.com"]
|
11
|
+
|
12
|
+
spec.summary = 'IDLC SDK for AWS resources - Build'
|
13
|
+
spec.description = 'Provides core libraries for idlc-sdk. This gem is part of the IDLC SDK'
|
14
|
+
spec.homepage = 'https://github.com/nathantcz/idlc-sdk'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.metadata = {
|
18
|
+
'source_code_uri' => 'https://github.com/nathantcz/idlc-sdk-build'
|
19
|
+
}
|
20
|
+
|
21
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
22
|
+
f.match(%r{^(test|spec|features)/})
|
23
|
+
end
|
24
|
+
|
25
|
+
spec.require_paths = ['lib']
|
26
|
+
|
27
|
+
spec.add_development_dependency 'bundler', '~> 1.15'
|
28
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
29
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
30
|
+
spec.add_development_dependency 'rubocop', '0.48.1'
|
31
|
+
spec.add_development_dependency 'pry'
|
32
|
+
spec.add_development_dependency 'yard'
|
33
|
+
|
34
|
+
spec.add_runtime_dependency 'idlc-sdk-core'
|
35
|
+
spec.add_runtime_dependency 'net-telnet'
|
36
|
+
spec.add_runtime_dependency 'packer-binary'
|
37
|
+
spec.add_runtime_dependency 'rubocop', '0.48.1'
|
38
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Idlc::Build
|
2
|
+
class Config
|
3
|
+
include Idlc::Helpers
|
4
|
+
|
5
|
+
class << self
|
6
|
+
include Idlc::Helpers
|
7
|
+
|
8
|
+
def add_build_var(key, value)
|
9
|
+
ENV[key] = value
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def initialize(region)
|
14
|
+
@region = region
|
15
|
+
@build_vars = []
|
16
|
+
|
17
|
+
Idlc::Utility.check_for_creds
|
18
|
+
|
19
|
+
rescue Idlc::Utility::MissingCredentials => e
|
20
|
+
err("ERROR: #{e.message}\n")
|
21
|
+
exit 1
|
22
|
+
end
|
23
|
+
|
24
|
+
def dump_build_vars
|
25
|
+
@build_vars.join(' ')
|
26
|
+
end
|
27
|
+
|
28
|
+
def add_build_var_v2(key, value)
|
29
|
+
ENV[key] = value
|
30
|
+
|
31
|
+
@build_vars << "-var '#{key}=#{value}'"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Idlc
|
2
|
+
module Build
|
3
|
+
module Httpd
|
4
|
+
class << self
|
5
|
+
def private_ip
|
6
|
+
Socket.ip_address_list.detect(&:ipv4_private?).ip_address
|
7
|
+
end
|
8
|
+
|
9
|
+
def start(root_dir, sleep_time = 3)
|
10
|
+
httpd = server(root_dir)
|
11
|
+
|
12
|
+
pid = Process.fork
|
13
|
+
if pid.nil?
|
14
|
+
# In child
|
15
|
+
exec((
|
16
|
+
trap('INT') { httpd.shutdown }
|
17
|
+
httpd.start
|
18
|
+
# ignore the nil excpetion here, this happens when the child process exits
|
19
|
+
)) rescue nil
|
20
|
+
else
|
21
|
+
# In parent
|
22
|
+
Process.detach(pid)
|
23
|
+
end
|
24
|
+
|
25
|
+
sleep sleep_time
|
26
|
+
|
27
|
+
# Return process id
|
28
|
+
pid
|
29
|
+
end
|
30
|
+
|
31
|
+
def stop(pid)
|
32
|
+
Process.kill('INT', pid) unless pid.nil?
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def server(root)
|
38
|
+
# get a random port number
|
39
|
+
port = Random.rand(49_152...65_535)
|
40
|
+
ENV['HTTPD_PORT'] = port.to_s
|
41
|
+
|
42
|
+
WEBrick::HTTPServer.new(
|
43
|
+
Port: port,
|
44
|
+
DocumentRoot: root
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
module Idlc
|
2
|
+
module Build
|
3
|
+
class MissingMetadataFile < StandardError; end
|
4
|
+
class MissingRequiredMetadataAttribute < StandardError; end
|
5
|
+
|
6
|
+
class Metadata
|
7
|
+
class MetadataAttribute
|
8
|
+
attr_reader :key
|
9
|
+
attr_reader :value
|
10
|
+
|
11
|
+
def initialize(value, required = false)
|
12
|
+
@value = value
|
13
|
+
@required = required
|
14
|
+
end
|
15
|
+
|
16
|
+
def required?
|
17
|
+
@required
|
18
|
+
end
|
19
|
+
|
20
|
+
def defined?
|
21
|
+
!@value.nil?
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
attr_reader :attributes
|
26
|
+
|
27
|
+
def initialize(name, file = 'metadata')
|
28
|
+
@name = name
|
29
|
+
@file = file
|
30
|
+
@attributes = {}
|
31
|
+
|
32
|
+
# Required
|
33
|
+
@attributes['build_stage'] = MetadataAttribute.new(nil, true)
|
34
|
+
@attributes['chef_run_list'] = MetadataAttribute.new(nil, true)
|
35
|
+
@attributes['instance_type'] = MetadataAttribute.new(nil, true)
|
36
|
+
@attributes['os_type'] = MetadataAttribute.new(nil, true)
|
37
|
+
@attributes['role'] = MetadataAttribute.new(nil, true)
|
38
|
+
@attributes['source_ami_name'] = MetadataAttribute.new(nil, true)
|
39
|
+
@attributes['source_ami_owner'] = MetadataAttribute.new(nil, true)
|
40
|
+
@attributes['version'] = MetadataAttribute.new(REPO_VERSION, true)
|
41
|
+
|
42
|
+
# Optional Defaults
|
43
|
+
@attributes['block_device_mapping'] = MetadataAttribute.new('[]')
|
44
|
+
@attributes['job_code'] = MetadataAttribute.new('998')
|
45
|
+
@attributes['chef_dir'] = MetadataAttribute.new('c:/windows/temp/packer-chef-client')
|
46
|
+
@attributes['security_group_id'] = MetadataAttribute.new('sg-420b4a39')
|
47
|
+
@attributes['vpc_id'] = MetadataAttribute.new('vpc-e346f484')
|
48
|
+
@attributes['vpc_subnet'] = MetadataAttribute.new('subnet-18b5ed40')
|
49
|
+
end
|
50
|
+
|
51
|
+
def load
|
52
|
+
raise MissingMetadataFile, "Expected metadata file at: #{metadata_file}" unless File.exist? metadata_file
|
53
|
+
|
54
|
+
YAML.load_file(metadata_file).each do |key, value|
|
55
|
+
value = nested_json(value) if key == 'block_device_mapping'
|
56
|
+
|
57
|
+
value = strip_trailing_dash(value) if key == 'source_ami_name'
|
58
|
+
|
59
|
+
puts "WARNING: unrecognized metadata key: '#{key}'" unless @attributes.key? key
|
60
|
+
next unless @attributes.key? key
|
61
|
+
|
62
|
+
required = @attributes[key].required?
|
63
|
+
@attributes[key] = MetadataAttribute.new(value, required)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def strip_trailing_dash(value)
|
68
|
+
return value[0..-2] if dash? value[-1]
|
69
|
+
|
70
|
+
value
|
71
|
+
end
|
72
|
+
|
73
|
+
def dash?(char)
|
74
|
+
char == '-'
|
75
|
+
end
|
76
|
+
|
77
|
+
def nested_json(value)
|
78
|
+
total_block = []
|
79
|
+
value.each do |block|
|
80
|
+
total_block.push(block)
|
81
|
+
end
|
82
|
+
|
83
|
+
total_block.to_json
|
84
|
+
end
|
85
|
+
|
86
|
+
def requirements_satisfied?
|
87
|
+
begin
|
88
|
+
@attributes['version'] = MetadataAttribute.new(YAML.load_file(version_file)['version'], true) unless @attributes['version'].defined?
|
89
|
+
rescue
|
90
|
+
puts('WARNING: \'version\' not specified in environment, metadata, or version file')
|
91
|
+
end
|
92
|
+
|
93
|
+
@attributes.each do |key, att|
|
94
|
+
raise MissingRequiredMetadataAttribute, "Missing required key: '#{key}' in metadata file" if att.required? && att.value.nil?
|
95
|
+
raise MissingRequiredMetadataAttribute, "Metadata key: '#{key}' cannot be nil" if att.required? && att.value.strip.empty?
|
96
|
+
end
|
97
|
+
|
98
|
+
true
|
99
|
+
end
|
100
|
+
|
101
|
+
def metadata_file
|
102
|
+
"#{Dir.pwd}/#{base_dir}/#{@file}"
|
103
|
+
end
|
104
|
+
|
105
|
+
def version_file
|
106
|
+
"#{Dir.pwd}/#{base_dir}/version"
|
107
|
+
end
|
108
|
+
|
109
|
+
def base_dir
|
110
|
+
"builds/#{@name}"
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Idlc
|
2
|
+
module Build
|
3
|
+
class Template
|
4
|
+
def initialize(metadata, output_file)
|
5
|
+
@metadata = metadata
|
6
|
+
@output_file = output_file
|
7
|
+
end
|
8
|
+
|
9
|
+
def templates_dir
|
10
|
+
"#{__dir__}/templates/#{@metadata['build_stage'].value}"
|
11
|
+
end
|
12
|
+
|
13
|
+
def render
|
14
|
+
tpl = File.read("#{templates_dir}/build.json.erb")
|
15
|
+
|
16
|
+
renderer = ERB.new(tpl)
|
17
|
+
renderer.result(binding)
|
18
|
+
end
|
19
|
+
|
20
|
+
def write
|
21
|
+
# Write rendered template to output_file
|
22
|
+
File.open(@output_file, 'w') { |file| file.write(render) }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"builders": [
|
3
|
+
{
|
4
|
+
"type": "amazon-ebs",
|
5
|
+
"region": "{{ user `aws_region` }}",
|
6
|
+
"communicator": "winrm",
|
7
|
+
"winrm_username": "Administrator",
|
8
|
+
"winrm_use_ssl": true,
|
9
|
+
"winrm_insecure": true,
|
10
|
+
"vpc_id": "{{ user `vpc_id` }}",
|
11
|
+
"subnet_id": "{{ user `vpc_subnet` }}",
|
12
|
+
"security_group_id": "{{ user `security_group_id` }}",
|
13
|
+
"iam_instance_profile": "packer_build",
|
14
|
+
"source_ami_filter": {
|
15
|
+
"filters": {
|
16
|
+
"name": "{{ user `source_ami_name` }}-*"
|
17
|
+
},
|
18
|
+
"owners": ["{{ user `source_ami_owner` }}"],
|
19
|
+
"most_recent": true
|
20
|
+
},
|
21
|
+
"instance_type": "{{ user `instance_type` }}",
|
22
|
+
"ami_name": "{{ user `build_stage` }}-{{ user `role` }}-{{ user `version` }}.{{ user `build_number` }}{{ user `build_metadata` }}",
|
23
|
+
"ami_users": ["404093710949"],
|
24
|
+
"user_data_file": "files/config/init.ps1.userdata",
|
25
|
+
"launch_block_device_mappings": <%= @metadata['block_device_mapping'].value %>,
|
26
|
+
"run_tags": {
|
27
|
+
"job_code": "{{ user `job_code` }}",
|
28
|
+
"Name": "Packer_Builder-{{ user `build_stage` }}-{{ user `role` }}-{{ user `version` }}.{{ user `build_number` }}{{ user `build_metadata` }}"
|
29
|
+
},
|
30
|
+
"run_volume_tags": {
|
31
|
+
"job_code": "{{ user `job_code` }}",
|
32
|
+
"Name": "Packer_Builder-{{ user `build_stage` }}-{{ user `role` }}-{{ user `version` }}.{{ user `build_number` }}{{ user `build_metadata` }}"
|
33
|
+
},
|
34
|
+
"tags": {
|
35
|
+
"job_code": "{{ user `job_code` }}",
|
36
|
+
"version": "{{ user `version` }}",
|
37
|
+
"build": "{{ user `build_number`}}",
|
38
|
+
"build_metadata": "{{ user `build_metadata`}}",
|
39
|
+
"build_uuid": "{{ user `build_uuid` }}",
|
40
|
+
"os": "{{ user `os_type` }}",
|
41
|
+
"build_stage": "{{ user `build_stage` }}",
|
42
|
+
"Name": "{{ user `build_stage` }}-{{ user `role` }}-{{ user `version` }}.{{ user `build_number` }}{{ user `build_metadata` }}",
|
43
|
+
"app_release": "{{ user `app_release` }}{{ user `build_metadata` }}"
|
44
|
+
}
|
45
|
+
}
|
46
|
+
],
|
47
|
+
|
48
|
+
"provisioners": [
|
49
|
+
{
|
50
|
+
"type": "powershell",
|
51
|
+
"inline": [
|
52
|
+
"Invoke-WebRequest http://{{user `httpd_server`}}:{{user `httpd_port`}}/cookbooks.zip -OutFile c:/chef/cookbooks.zip -Verbose",
|
53
|
+
"Expand-Archive c:/chef/cookbooks.zip -DestinationPath c:/chef"
|
54
|
+
]
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"type": "chef-client",
|
58
|
+
"guest_os_type": "windows",
|
59
|
+
"server_url": "http://localhost:8889",
|
60
|
+
"config_template": "./files/config/client.rb.template",
|
61
|
+
"run_list": [ "{{ user `chef_run_list` }}" ],
|
62
|
+
"skip_clean_node": true,
|
63
|
+
"skip_clean_client": true,
|
64
|
+
"skip_install": true,
|
65
|
+
"json": {
|
66
|
+
"app_release": "{{user `app_release`}}"
|
67
|
+
}
|
68
|
+
}
|
69
|
+
]
|
70
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
{
|
2
|
+
"builders": [
|
3
|
+
{
|
4
|
+
"type": "amazon-ebs",
|
5
|
+
"region": "{{ user `aws_region` }}",
|
6
|
+
"communicator": "winrm",
|
7
|
+
"winrm_username": "Administrator",
|
8
|
+
"winrm_password": "Aut0m@t0r",
|
9
|
+
"winrm_use_ssl": true,
|
10
|
+
"winrm_insecure": true,
|
11
|
+
"vpc_id": "{{ user `vpc_id` }}",
|
12
|
+
"subnet_id": "{{ user `vpc_subnet` }}",
|
13
|
+
"security_group_id": "{{ user `security_group_id` }}",
|
14
|
+
"iam_instance_profile": "packer_build",
|
15
|
+
"source_ami_filter": {
|
16
|
+
"filters": {
|
17
|
+
"name": "{{ user `source_ami_name` }}*"
|
18
|
+
},
|
19
|
+
"owners": ["{{ user `source_ami_owner` }}"],
|
20
|
+
"most_recent": true
|
21
|
+
},
|
22
|
+
"instance_type": "{{ user `instance_type` }}",
|
23
|
+
"ami_name": "{{ user `build_stage` }}-{{ user `role` }}-{{ user `version` }}.{{ user `build_number` }}",
|
24
|
+
"user_data_file": "files/config/init.ps1.userdata",
|
25
|
+
"run_tags": {
|
26
|
+
"job_code": "{{ user `job_code` }}",
|
27
|
+
"Name": "Packer Builder"
|
28
|
+
},
|
29
|
+
"run_volume_tags": {
|
30
|
+
"job_code": "{{ user `job_code` }}",
|
31
|
+
"Name": "Packer Builder"
|
32
|
+
},
|
33
|
+
"tags": {
|
34
|
+
"job_code": "{{ user `job_code` }}",
|
35
|
+
"version": "{{ user `version` }}",
|
36
|
+
"build": "{{ user `build_number`}}",
|
37
|
+
"build_uuid": "{{ user `build_uuid` }}",
|
38
|
+
"os": "{{ user `os_type` }}",
|
39
|
+
"build_stage": "{{ user `build_stage` }}",
|
40
|
+
"Name": "{{ user `build_stage` }}-{{ user `role` }}-{{ user `version` }}.{{ user `build_number` }}",
|
41
|
+
"source_ami": "{{ user `source_ami_name` }}"
|
42
|
+
}
|
43
|
+
}
|
44
|
+
],
|
45
|
+
|
46
|
+
"provisioners": [
|
47
|
+
{ "type": "powershell", "inline": [ "mkdir {{user `chef_dir`}}" ] },
|
48
|
+
{ "type": "file", "source": "./chef/bake/cookbooks", "destination": "{{user `chef_dir`}}/cookbooks" },
|
49
|
+
{ "type": "file", "source": "./chef/vendor/cookbooks", "destination": "{{user `chef_dir`}}/vendor/cookbooks" },
|
50
|
+
{
|
51
|
+
"type": "chef-client",
|
52
|
+
"guest_os_type": "windows",
|
53
|
+
"install_command": "powershell.exe -Command \"(New-Object System.Net.WebClient).DownloadFile('https://packages.chef.io/files/stable/chef/12.19.36/windows/2012r2/chef-client-12.19.36-1-x64.msi', 'C:\\Windows\\Temp\\chef.msi');Start-Process 'msiexec' -ArgumentList '/qb /i C:\\Windows\\Temp\\chef.msi' -NoNewWindow -Wait\"",
|
54
|
+
"server_url": "http://localhost:8889",
|
55
|
+
"config_template": "./files/config/client.rb.template",
|
56
|
+
"run_list": [ "{{ user `chef_run_list` }}" ],
|
57
|
+
"skip_clean_node": true,
|
58
|
+
"skip_clean_client": true
|
59
|
+
}
|
60
|
+
]
|
61
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'packer/binary'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
require 'securerandom'
|
6
|
+
require 'tmpdir'
|
7
|
+
require 'webrick'
|
8
|
+
|
9
|
+
# Use the packer-binary gem to provide the executable
|
10
|
+
Packer::Binary.configure do |config|
|
11
|
+
config.version = '0.12.3'
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'idlc-sdk-core'
|
15
|
+
|
16
|
+
require 'idlc-sdk-build/version'
|
17
|
+
require 'idlc-sdk-build/config'
|
18
|
+
require 'idlc-sdk-build/httpd'
|
19
|
+
require 'idlc-sdk-build/metadata'
|
20
|
+
require 'idlc-sdk-build/template'
|
metadata
ADDED
@@ -0,0 +1,204 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: idlc-sdk-build
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.rc1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nathan Cazell
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-09-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.15'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.15'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.48.1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.48.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: yard
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: idlc-sdk-core
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: net-telnet
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: packer-binary
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.48.1
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - '='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.48.1
|
153
|
+
description: Provides core libraries for idlc-sdk. This gem is part of the IDLC SDK
|
154
|
+
email:
|
155
|
+
- nathan.cazell@imageapi.com
|
156
|
+
executables: []
|
157
|
+
extensions: []
|
158
|
+
extra_rdoc_files: []
|
159
|
+
files:
|
160
|
+
- ".gitignore"
|
161
|
+
- ".rspec"
|
162
|
+
- ".travis.yml"
|
163
|
+
- ".yardopts"
|
164
|
+
- Gemfile
|
165
|
+
- LICENSE.txt
|
166
|
+
- README.md
|
167
|
+
- Rakefile
|
168
|
+
- bin/console
|
169
|
+
- bin/setup
|
170
|
+
- idlc-sdk-build.gemspec
|
171
|
+
- lib/idlc-sdk-build.rb
|
172
|
+
- lib/idlc-sdk-build/config.rb
|
173
|
+
- lib/idlc-sdk-build/httpd.rb
|
174
|
+
- lib/idlc-sdk-build/metadata.rb
|
175
|
+
- lib/idlc-sdk-build/template.rb
|
176
|
+
- lib/idlc-sdk-build/templates/app/build.json.erb
|
177
|
+
- lib/idlc-sdk-build/templates/base/build.json.erb
|
178
|
+
- lib/idlc-sdk-build/version.rb
|
179
|
+
homepage: https://github.com/nathantcz/idlc-sdk
|
180
|
+
licenses:
|
181
|
+
- MIT
|
182
|
+
metadata:
|
183
|
+
source_code_uri: https://github.com/nathantcz/idlc-sdk-build
|
184
|
+
post_install_message:
|
185
|
+
rdoc_options: []
|
186
|
+
require_paths:
|
187
|
+
- lib
|
188
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
193
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
|
+
requirements:
|
195
|
+
- - ">"
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: 1.3.1
|
198
|
+
requirements: []
|
199
|
+
rubyforge_project:
|
200
|
+
rubygems_version: 2.6.11
|
201
|
+
signing_key:
|
202
|
+
specification_version: 4
|
203
|
+
summary: IDLC SDK for AWS resources - Build
|
204
|
+
test_files: []
|