iapi-idlc-sdk-pfm 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/.yardopts +3 -0
- data/Gemfile +6 -0
- data/Jenkinsfile +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +37 -0
- data/Rakefile +6 -0
- data/bin/pfm +8 -0
- data/docs/GettingStarted.md +299 -0
- data/iapi-idlc-sdk-pfm.gemspec +50 -0
- data/lib/iapi-idlc-sdk-pfm/builtin_commands.rb +12 -0
- data/lib/iapi-idlc-sdk-pfm/cli.rb +150 -0
- data/lib/iapi-idlc-sdk-pfm/command/apply.rb +86 -0
- data/lib/iapi-idlc-sdk-pfm/command/base.rb +255 -0
- data/lib/iapi-idlc-sdk-pfm/command/build.rb +121 -0
- data/lib/iapi-idlc-sdk-pfm/command/configure.rb +41 -0
- data/lib/iapi-idlc-sdk-pfm/command/destroy.rb +77 -0
- data/lib/iapi-idlc-sdk-pfm/command/exec.rb +24 -0
- data/lib/iapi-idlc-sdk-pfm/command/format.rb +64 -0
- data/lib/iapi-idlc-sdk-pfm/command/generate.rb +83 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/base.rb +50 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/server_build.rb +58 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/Berksfile +3 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/build_cookbook/.kitchen.yml +21 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/build_cookbook/README.md +146 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/build_cookbook/test-fixture-recipe.rb +8 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/chefignore +107 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/cookbook_readmes/README-policy.md +9 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/cookbook_readmes/README.md +54 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/delivery-config.json +12 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/delivery-project.toml +36 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/gitignore +21 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/README.md +24 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/cookbooks/example/README.md +27 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb +7 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/cookbooks/example/metadata.rb +6 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +8 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md +56 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/example/example_item.json +4 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/dot-chef-repo.txt +6 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/environments/README.md +9 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/environments/example.json +13 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/policies/README.md +24 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/roles/README.md +9 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/roles/example.json +13 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/spec_helper.rb +2 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/spec_helper_policyfile.rb +2 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/metadata.rb +7 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/app.rb +89 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/attribute.rb +12 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/build_cookbook.rb +182 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/cookbook.rb +144 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/cookbook_file.rb +24 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/lwrp.rb +23 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/policyfile.rb +8 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/recipe.rb +51 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/repo.rb +67 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/template.rb +32 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/LICENSE.all_rights.erb +3 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/LICENSE.apachev2.erb +201 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/LICENSE.gplv2.erb +339 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/LICENSE.gplv3.erb +674 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/LICENSE.mit.erb +21 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/Policyfile.rb.erb +25 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/README.md.erb +4 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/attribute.rb.erb +0 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/build_cookbook/Berksfile.erb +7 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/build_cookbook/metadata.rb.erb +10 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/build_cookbook/recipe.rb.erb +8 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/cookbook_file.erb +0 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/inspec_default_test.rb.erb +18 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/kitchen.yml.erb +26 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/kitchen_policyfile.yml.erb +33 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/metadata.rb.erb +20 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/provider.rb.erb +0 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/recipe.rb.erb +5 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/recipe_spec.rb.erb +22 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/repo/gitignore.erb +128 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/resource.rb.erb +0 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/template.erb +0 -0
- data/lib/iapi-idlc-sdk-pfm/command/generator_commands.rb +34 -0
- data/lib/iapi-idlc-sdk-pfm/command/package.rb +118 -0
- data/lib/iapi-idlc-sdk-pfm/command/plan.rb +96 -0
- data/lib/iapi-idlc-sdk-pfm/command/templates/app/files/config/client.rb.template +9 -0
- data/lib/iapi-idlc-sdk-pfm/command/templates/app/files/config/init.ps1.userdata +16 -0
- data/lib/iapi-idlc-sdk-pfm/command/templates/base/files/config/client.rb.template +9 -0
- data/lib/iapi-idlc-sdk-pfm/command/templates/base/files/config/init.ps1.userdata +219 -0
- data/lib/iapi-idlc-sdk-pfm/command/validate.rb +85 -0
- data/lib/iapi-idlc-sdk-pfm/command/validator_commands/base.rb +65 -0
- data/lib/iapi-idlc-sdk-pfm/command/validator_commands/infrastructure.rb +46 -0
- data/lib/iapi-idlc-sdk-pfm/command/validator_commands/server_build.rb +135 -0
- data/lib/iapi-idlc-sdk-pfm/command/validator_commands.rb +32 -0
- data/lib/iapi-idlc-sdk-pfm/commands_map.rb +61 -0
- data/lib/iapi-idlc-sdk-pfm/generator.rb +52 -0
- data/lib/iapi-idlc-sdk-pfm/helpers.rb +49 -0
- data/lib/iapi-idlc-sdk-pfm/settings.rb +205 -0
- data/lib/iapi-idlc-sdk-pfm/validator.rb +52 -0
- data/lib/iapi-idlc-sdk-pfm/version.rb +4 -0
- data/lib/iapi-idlc-sdk-pfm.rb +27 -0
- metadata +442 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
module Pfm
|
2
|
+
# Module of common functions that are used frequently in every namespace
|
3
|
+
module Helpers
|
4
|
+
module_function
|
5
|
+
|
6
|
+
# Runs given commands using mixlib-shellout
|
7
|
+
#
|
8
|
+
# @param command_args [String] the system command to run
|
9
|
+
def system_command(*command_args)
|
10
|
+
cmd = Mixlib::ShellOut.new(*command_args)
|
11
|
+
cmd.run_command
|
12
|
+
err(cmd.stderr)
|
13
|
+
msg(cmd.stdout)
|
14
|
+
cmd
|
15
|
+
end
|
16
|
+
|
17
|
+
# Print the given string to stderr
|
18
|
+
#
|
19
|
+
# @param message [String] the string to print
|
20
|
+
def err(message)
|
21
|
+
stderr.print("#{message}\n")
|
22
|
+
end
|
23
|
+
|
24
|
+
# Print the given string to stdout
|
25
|
+
#
|
26
|
+
# @param message [String] the string to print
|
27
|
+
def msg(message)
|
28
|
+
stdout.print("#{message}\n")
|
29
|
+
end
|
30
|
+
|
31
|
+
# Only prints the given string to stdout when the environment variable
|
32
|
+
# DEBUG = true
|
33
|
+
#
|
34
|
+
# @param message [String] the string to print
|
35
|
+
def debug(message)
|
36
|
+
stdout.print("#{message}\n") if ENV['DEBUG']
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def stdout
|
42
|
+
$stdout
|
43
|
+
end
|
44
|
+
|
45
|
+
def stderr
|
46
|
+
$stderr
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,205 @@
|
|
1
|
+
module Pfm
|
2
|
+
# == +PFM+ Settings
|
3
|
+
# Top level settings defined and loaded here. This class loads the user config file
|
4
|
+
# located at +.pfm/config+
|
5
|
+
#
|
6
|
+
# +AWS_REGION+ <em>default -> 'us-east-1'</em>
|
7
|
+
#
|
8
|
+
# * The AWS region to work in. This will eventually become the AWS_REGION environment variable and can be used with other AWS API operations.
|
9
|
+
#
|
10
|
+
# +RUBOCOP_RULES_FILE+ <em>default -> '.rubocop.yml'</em>
|
11
|
+
#
|
12
|
+
# * Set the path to the global +.rubocop.yml+ rules file. This file will be used for all server builds when running syntax checks.
|
13
|
+
#
|
14
|
+
# +FOODCRITIC_RULES_FILE+ <em>default -> '.foodcritic'</em>
|
15
|
+
#
|
16
|
+
# * Set the path to the global +.foodcritic+ rules file. This file will be used for all server builds when running semantics checks.
|
17
|
+
#
|
18
|
+
# +BUILD_BASE_DIR+ <em>default -> 'builds'</em>
|
19
|
+
#
|
20
|
+
# * Set the root path to the builds directory. This should be where top level server builds are located. Ex:
|
21
|
+
# .
|
22
|
+
# ├── builds
|
23
|
+
# │ ├── app-axpdb
|
24
|
+
# │ └── app-axpwa
|
25
|
+
#
|
26
|
+
# +INF_BASE_DIR+ <em>default -> 'inf'</em>
|
27
|
+
#
|
28
|
+
# * Set the path to the top level infrastructure directory. Ex:
|
29
|
+
# .
|
30
|
+
# ├── inf
|
31
|
+
# │ ├── env
|
32
|
+
# │ ├── tasks
|
33
|
+
# │ └── tf
|
34
|
+
#
|
35
|
+
# +PUBLISH_BUCKET+ <em>default -> ''</em>
|
36
|
+
#
|
37
|
+
# * The top level bucket where deployment packages are stored in S3.
|
38
|
+
#
|
39
|
+
# +PUBLISH_PREFIX+ <em>default -> ''</em>
|
40
|
+
#
|
41
|
+
# * The prefix to the deployment package storage location. Ex:
|
42
|
+
# +s3://PUBLISH_BUCKET/PUBLISH_PREFIX/package.name+
|
43
|
+
#
|
44
|
+
# +PACKER_VERSION+ <em>default -> 'default from packer/binary'
|
45
|
+
#
|
46
|
+
# * The version of Hashicorp Packer to use for builds
|
47
|
+
#
|
48
|
+
# +TERRAFORM_VERSION+ <em>default -> 'default from terraform/binary'
|
49
|
+
#
|
50
|
+
# * The version of Hashicorp Terraform to use for deployments
|
51
|
+
#
|
52
|
+
# Note that if you change these settings from the default, be sure you commit
|
53
|
+
# the +.pfm/config+ file.
|
54
|
+
#
|
55
|
+
# == Example Configuration File
|
56
|
+
# An example +.pfm/config+ file might look like this:
|
57
|
+
# ---
|
58
|
+
# AWS_REGION: 'us-east-1'
|
59
|
+
# RUBOCOP_RULES_FILE: '.pfm/.rubocop.yml'
|
60
|
+
# FOODCRITIC_RULES_FILE: '.pfm/.foodcritic'
|
61
|
+
# BUILD_BASE_DIR: 'builds'
|
62
|
+
# INF_BASE_DIR: 'inf'
|
63
|
+
# PUBLISH_BUCKET: 'dev-publish'
|
64
|
+
# PUBLISH_PREFIX: 'axp'
|
65
|
+
# PACKER_VERSION: '1.0.4'
|
66
|
+
# TERRAFORM_VERSION: '0.8.7'
|
67
|
+
class Settings
|
68
|
+
# Defines an individual setting
|
69
|
+
class Setting
|
70
|
+
attr_reader :value
|
71
|
+
|
72
|
+
def initialize(value, required = false)
|
73
|
+
@value = value
|
74
|
+
@required = required
|
75
|
+
end
|
76
|
+
|
77
|
+
def required?
|
78
|
+
@required
|
79
|
+
end
|
80
|
+
|
81
|
+
def defined?
|
82
|
+
!@value.nil?
|
83
|
+
end
|
84
|
+
|
85
|
+
def to_s
|
86
|
+
@value.to_s
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# @return [Map] returns the map of Pfm::Settings::Setting objects
|
91
|
+
attr_reader :settings
|
92
|
+
attr_reader :config_directory
|
93
|
+
attr_reader :run_dir
|
94
|
+
|
95
|
+
def initialize(expand = false)
|
96
|
+
@run_dir = Dir.pwd
|
97
|
+
@config_directory = config_dir
|
98
|
+
@expand = expand
|
99
|
+
|
100
|
+
@settings = {}
|
101
|
+
|
102
|
+
# Required
|
103
|
+
@settings['AWS_REGION'] = Setting.new(ENV['AWS_REGION'], true)
|
104
|
+
@settings['RUBOCOP_RULES_FILE'] = Setting.new('.rubocop.yml', true)
|
105
|
+
@settings['FOODCRITIC_RULES_FILE'] = Setting.new('.foodcritic', true)
|
106
|
+
@settings['BUILD_BASE_DIR'] = Setting.new('builds', true)
|
107
|
+
@settings['INF_BASE_DIR'] = Setting.new('inf', true)
|
108
|
+
@settings['PACKER_VERSION'] = Setting.new(::Packer::Binary.config.version, true)
|
109
|
+
@settings['TERRAFORM_VERSION'] = Setting.new(::Terraform::Binary.config.version, true)
|
110
|
+
|
111
|
+
# Optional Defaults
|
112
|
+
@settings['PUBLISH_BUCKET'] = Setting.new('')
|
113
|
+
@settings['PUBLISH_PREFIX'] = Setting.new('')
|
114
|
+
|
115
|
+
load_config
|
116
|
+
end
|
117
|
+
|
118
|
+
# load the config file and resolve file paths if set
|
119
|
+
def load_config
|
120
|
+
if config_exists?
|
121
|
+
require 'yaml'
|
122
|
+
YAML.load_file(config_file).each do |key, value|
|
123
|
+
msg("WARNING: unrecognized config key: '#{key}'") unless @settings.key? key
|
124
|
+
next unless @settings.key? key
|
125
|
+
|
126
|
+
required = @settings[key].required?
|
127
|
+
@settings[key] = Setting.new(value, required)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Also load each setting into the environment
|
131
|
+
@settings.each { |key, setting| ENV[key] = setting.value }
|
132
|
+
|
133
|
+
# Resolve paths if set
|
134
|
+
resolve_paths if @expand
|
135
|
+
else
|
136
|
+
create_config
|
137
|
+
load_config
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# Saves a new configuration to disk
|
142
|
+
# @param settings [Map<Pfm::Settings::Setting>] a new map of Pfm::Settings::Setting objects
|
143
|
+
def save_config(settings)
|
144
|
+
@settings = settings
|
145
|
+
|
146
|
+
write_config
|
147
|
+
end
|
148
|
+
|
149
|
+
# returns a simple map of Pfm::Settings.settings[key] => Pfm::Settings.setting[key].to_s
|
150
|
+
# @return [Map<String>]
|
151
|
+
def settings_strings
|
152
|
+
map = {}
|
153
|
+
@settings.each do |key, setting|
|
154
|
+
map[key] = setting.to_s
|
155
|
+
end
|
156
|
+
|
157
|
+
map
|
158
|
+
end
|
159
|
+
|
160
|
+
private
|
161
|
+
|
162
|
+
# create the config directory and file if they don't already exist
|
163
|
+
def create_config
|
164
|
+
return if config_exists?
|
165
|
+
|
166
|
+
FileUtils.mkdir_p config_dir
|
167
|
+
FileUtils.touch config_file
|
168
|
+
|
169
|
+
write_config
|
170
|
+
end
|
171
|
+
|
172
|
+
# expands variables like '.' and '~' in settings values paths
|
173
|
+
def resolve_paths
|
174
|
+
@settings.each do |key, setting|
|
175
|
+
required = @settings[key].required?
|
176
|
+
@settings[key] = Setting.new(File.realpath(setting.value), required) if File.exist? setting.value
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# writes the @settings attribute to disk
|
181
|
+
def write_config
|
182
|
+
config_string = '---'
|
183
|
+
|
184
|
+
@settings.each do |key, setting|
|
185
|
+
config_string += "\n#{key}: '#{setting.value}'"
|
186
|
+
end
|
187
|
+
|
188
|
+
config_string += "\n"
|
189
|
+
|
190
|
+
File.open(config_file, 'w') { |file| file.write(config_string) }
|
191
|
+
end
|
192
|
+
|
193
|
+
def config_exists?
|
194
|
+
File.exist? config_file
|
195
|
+
end
|
196
|
+
|
197
|
+
def config_dir
|
198
|
+
"#{@run_dir}/.pfm"
|
199
|
+
end
|
200
|
+
|
201
|
+
def config_file
|
202
|
+
"#{config_dir}/config"
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module Pfm
|
2
|
+
module Validator
|
3
|
+
# This is here to hold attr_accessor data for Validator context variables
|
4
|
+
class Context
|
5
|
+
def self.add_attr(name)
|
6
|
+
@attributes ||= []
|
7
|
+
|
8
|
+
unless @attributes.include?(name)
|
9
|
+
@attributes << name
|
10
|
+
attr_accessor(name)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.reset
|
15
|
+
return if @attributes.nil?
|
16
|
+
|
17
|
+
@attributes.each do |attr|
|
18
|
+
remove_method(attr)
|
19
|
+
end
|
20
|
+
|
21
|
+
@attributes = nil
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.reset
|
26
|
+
@context = nil
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.context
|
30
|
+
@context ||= Context.new
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.add_attr_to_context(name, value = nil)
|
34
|
+
sym_name = name.to_sym
|
35
|
+
Pfm::Validator::Context.add_attr(sym_name)
|
36
|
+
Pfm::Validator::TemplateHelper.delegate_to_app_context(sym_name)
|
37
|
+
context.public_send("#{sym_name}=", value)
|
38
|
+
end
|
39
|
+
|
40
|
+
module TemplateHelper
|
41
|
+
def self.delegate_to_app_context(name)
|
42
|
+
define_method(name) do
|
43
|
+
Pfm::Validator.context.public_send(name)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def year
|
48
|
+
Time.now.year
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'mixlib/cli'
|
2
|
+
require 'mixlib/shellout'
|
3
|
+
require 'packer/binary'
|
4
|
+
require 'terraform/binary'
|
5
|
+
|
6
|
+
require 'iapi-idlc-sdk-core'
|
7
|
+
require 'iapi-idlc-sdk-build'
|
8
|
+
require 'iapi-idlc-sdk-deploy'
|
9
|
+
|
10
|
+
require 'iapi-idlc-sdk-pfm/version'
|
11
|
+
require 'iapi-idlc-sdk-pfm/settings'
|
12
|
+
require 'iapi-idlc-sdk-pfm/helpers'
|
13
|
+
require 'iapi-idlc-sdk-pfm/cli'
|
14
|
+
require 'iapi-idlc-sdk-pfm/commands_map'
|
15
|
+
require 'iapi-idlc-sdk-pfm/builtin_commands'
|
16
|
+
|
17
|
+
# Default region
|
18
|
+
ENV['AWS_REGION'] = 'us-east-1' unless ENV['AWS_REGION']
|
19
|
+
|
20
|
+
# Load config file as mapp of strings ex. SETTINGS[ 'AWS_REGION' ] = 'us-east-1'
|
21
|
+
SETTINGS = Pfm::Settings.new(true).settings_strings
|
22
|
+
|
23
|
+
# Global repository version file
|
24
|
+
REPO_VERSION_FILE = 'version'.freeze
|
25
|
+
|
26
|
+
# Load the current repository version number
|
27
|
+
REPO_VERSION = Idlc::Utility.set_global_version(REPO_VERSION_FILE)
|