idlc-sdk-pfm 1.0.0.pre.2
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/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/idlc-sdk-pfm.gemspec +44 -0
- data/lib/idlc-sdk-pfm/builtin_commands.rb +11 -0
- data/lib/idlc-sdk-pfm/cli.rb +150 -0
- data/lib/idlc-sdk-pfm/command/apply.rb +71 -0
- data/lib/idlc-sdk-pfm/command/base.rb +195 -0
- data/lib/idlc-sdk-pfm/command/build.rb +120 -0
- data/lib/idlc-sdk-pfm/command/configure.rb +41 -0
- data/lib/idlc-sdk-pfm/command/destroy.rb +61 -0
- data/lib/idlc-sdk-pfm/command/exec.rb +24 -0
- data/lib/idlc-sdk-pfm/command/format.rb +64 -0
- data/lib/idlc-sdk-pfm/command/generate.rb +83 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/base.rb +50 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/server_build.rb +58 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/Berksfile +3 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/build_cookbook/.kitchen.yml +21 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/build_cookbook/README.md +146 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/build_cookbook/test-fixture-recipe.rb +8 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/chefignore +107 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/cookbook_readmes/README-policy.md +9 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/cookbook_readmes/README.md +54 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/delivery-config.json +12 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/delivery-project.toml +36 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/gitignore +21 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/README.md +24 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/cookbooks/example/README.md +27 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb +7 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/cookbooks/example/metadata.rb +6 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +8 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/README.md +56 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/data_bags/example/example_item.json +4 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/dot-chef-repo.txt +6 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/environments/README.md +9 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/environments/example.json +13 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/policies/README.md +24 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/roles/README.md +9 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/repo/roles/example.json +13 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/spec_helper.rb +2 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/files/default/spec_helper_policyfile.rb +2 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/metadata.rb +7 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/app.rb +89 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/attribute.rb +12 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/build_cookbook.rb +182 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/cookbook.rb +144 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/cookbook_file.rb +24 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/lwrp.rb +23 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/policyfile.rb +8 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/recipe.rb +51 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/repo.rb +67 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/recipes/template.rb +32 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/LICENSE.all_rights.erb +3 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/LICENSE.apachev2.erb +201 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/LICENSE.gplv2.erb +339 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/LICENSE.gplv3.erb +674 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/LICENSE.mit.erb +21 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/Policyfile.rb.erb +25 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/README.md.erb +4 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/attribute.rb.erb +0 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/build_cookbook/Berksfile.erb +7 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/build_cookbook/metadata.rb.erb +10 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/build_cookbook/recipe.rb.erb +8 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/cookbook_file.erb +0 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/inspec_default_test.rb.erb +18 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/kitchen.yml.erb +26 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/kitchen_policyfile.yml.erb +33 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/metadata.rb.erb +20 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/provider.rb.erb +0 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/recipe.rb.erb +5 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/recipe_spec.rb.erb +22 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/repo/gitignore.erb +128 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/resource.rb.erb +0 -0
- data/lib/idlc-sdk-pfm/command/generator_commands/skeletons/code_generator/templates/default/template.erb +0 -0
- data/lib/idlc-sdk-pfm/command/generator_commands.rb +34 -0
- data/lib/idlc-sdk-pfm/command/plan.rb +80 -0
- data/lib/idlc-sdk-pfm/command/templates/app/files/config/client.rb.template +9 -0
- data/lib/idlc-sdk-pfm/command/templates/app/files/config/init.ps1.userdata +16 -0
- data/lib/idlc-sdk-pfm/command/templates/base/files/config/client.rb.template +6 -0
- data/lib/idlc-sdk-pfm/command/templates/base/files/config/init.ps1.userdata +219 -0
- data/lib/idlc-sdk-pfm/command/validate.rb +85 -0
- data/lib/idlc-sdk-pfm/command/validator_commands/base.rb +65 -0
- data/lib/idlc-sdk-pfm/command/validator_commands/infrastructure.rb +46 -0
- data/lib/idlc-sdk-pfm/command/validator_commands/server_build.rb +135 -0
- data/lib/idlc-sdk-pfm/command/validator_commands.rb +32 -0
- data/lib/idlc-sdk-pfm/commands_map.rb +61 -0
- data/lib/idlc-sdk-pfm/generator.rb +52 -0
- data/lib/idlc-sdk-pfm/helpers.rb +49 -0
- data/lib/idlc-sdk-pfm/settings.rb +205 -0
- data/lib/idlc-sdk-pfm/validator.rb +52 -0
- data/lib/idlc-sdk-pfm/version.rb +3 -0
- data/lib/idlc-sdk-pfm.rb +24 -0
- metadata +342 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) <%= year %> <%= copyright_holder %>
|
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.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Policyfile.rb - Describe how you want Chef to build your system.
|
2
|
+
#
|
3
|
+
# For more information on the Policyfile feature, visit
|
4
|
+
# https://docs.chef.io/policyfile.html
|
5
|
+
|
6
|
+
# A name that describes what the system you're building with Chef does.
|
7
|
+
name "<%= policy_name %>"
|
8
|
+
|
9
|
+
<% if include_chef_repo_source %>
|
10
|
+
# This lets you source cookbooks from your chef-repo.
|
11
|
+
default_source :chef_repo, "../"
|
12
|
+
|
13
|
+
<% end -%>
|
14
|
+
# Where to find external cookbooks:
|
15
|
+
default_source :supermarket
|
16
|
+
|
17
|
+
# run_list: chef-client will run these recipes in the order specified.
|
18
|
+
run_list "<%= policy_run_list %>"
|
19
|
+
|
20
|
+
# Specify a custom source for a single cookbook:
|
21
|
+
<% if policy_local_cookbook.nil? %>
|
22
|
+
# cookbook "example_cookbook", path: "../cookbooks/example_cookbook"
|
23
|
+
<% else %>
|
24
|
+
cookbook "<%= cookbook_name %>", path: "."
|
25
|
+
<% end %>
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
name 'build_cookbook'
|
2
|
+
maintainer '<%= copyright_holder %>'
|
3
|
+
maintainer_email '<%= email %>'
|
4
|
+
license '<%= license %>'
|
5
|
+
version '0.1.0'
|
6
|
+
chef_version '>= 12.1' if respond_to?(:chef_version)
|
7
|
+
<% if build_cookbook_parent_is_cookbook -%>
|
8
|
+
|
9
|
+
depends 'delivery-truck'
|
10
|
+
<% end -%>
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# # encoding: utf-8
|
2
|
+
|
3
|
+
# Inspec test for recipe <%= cookbook_name %>::<%= recipe_name %>
|
4
|
+
|
5
|
+
# The Inspec reference, with examples and extensive documentation, can be
|
6
|
+
# found at http://inspec.io/docs/reference/resources/
|
7
|
+
|
8
|
+
unless os.windows?
|
9
|
+
# This is an example test, replace with your own test.
|
10
|
+
describe user('root'), :skip do
|
11
|
+
it { should exist }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# This is an example test, replace it with your own test.
|
16
|
+
describe port(80), :skip do
|
17
|
+
it { should_not be_listening }
|
18
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
driver:
|
3
|
+
name: vagrant
|
4
|
+
|
5
|
+
provisioner:
|
6
|
+
name: chef_zero
|
7
|
+
# You may wish to disable always updating cookbooks in CI or other testing environments.
|
8
|
+
# For example:
|
9
|
+
# always_update_cookbooks: <%%= !ENV['CI'] %>
|
10
|
+
always_update_cookbooks: true
|
11
|
+
|
12
|
+
verifier:
|
13
|
+
name: inspec
|
14
|
+
|
15
|
+
platforms:
|
16
|
+
- name: ubuntu-16.04
|
17
|
+
- name: centos-7.3
|
18
|
+
|
19
|
+
suites:
|
20
|
+
- name: default
|
21
|
+
run_list:
|
22
|
+
- recipe[<%= cookbook_name %>::default]
|
23
|
+
verifier:
|
24
|
+
inspec_tests:
|
25
|
+
- test/smoke/default
|
26
|
+
attributes:
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
driver:
|
3
|
+
name: vagrant
|
4
|
+
|
5
|
+
## The forwarded_port port feature lets you connect to ports on the VM guest via
|
6
|
+
## localhost on the host.
|
7
|
+
## see also: https://docs.vagrantup.com/v2/networking/forwarded_ports.html
|
8
|
+
|
9
|
+
# network:
|
10
|
+
# - ["forwarded_port", {guest: 80, host: 8080}]
|
11
|
+
|
12
|
+
provisioner:
|
13
|
+
name: policyfile_zero
|
14
|
+
|
15
|
+
## require_chef_omnibus specifies a specific chef version to install. You can
|
16
|
+
## also set this to `true` to always use the latest version.
|
17
|
+
## see also: https://docs.chef.io/config_yml_kitchen.html
|
18
|
+
|
19
|
+
# require_chef_omnibus: 12.8.1
|
20
|
+
|
21
|
+
verifier:
|
22
|
+
name: inspec
|
23
|
+
|
24
|
+
platforms:
|
25
|
+
- name: ubuntu-16.04
|
26
|
+
- name: centos-7.3
|
27
|
+
|
28
|
+
suites:
|
29
|
+
- name: default
|
30
|
+
verifier:
|
31
|
+
inspec_tests:
|
32
|
+
- test/smoke/default
|
33
|
+
attributes:
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name '<%= cookbook_name %>'
|
2
|
+
maintainer '<%= copyright_holder %>'
|
3
|
+
maintainer_email '<%= email %>'
|
4
|
+
license '<%= @spdx_license %>'
|
5
|
+
description 'Installs/Configures <%= cookbook_name %>'
|
6
|
+
long_description 'Installs/Configures <%= cookbook_name %>'
|
7
|
+
version '0.1.0'
|
8
|
+
chef_version '>= 12.1' if respond_to?(:chef_version)
|
9
|
+
|
10
|
+
# The `issues_url` points to the location where issues for this cookbook are
|
11
|
+
# tracked. A `View Issues` link will be displayed on this cookbook's page when
|
12
|
+
# uploaded to a Supermarket.
|
13
|
+
#
|
14
|
+
# issues_url 'https://github.com/<insert_org_here>/<%= cookbook_name %>/issues'
|
15
|
+
|
16
|
+
# The `source_url` points to the development reposiory for this cookbook. A
|
17
|
+
# `View Source` link will be displayed on this cookbook's page when uploaded to
|
18
|
+
# a Supermarket.
|
19
|
+
#
|
20
|
+
# source_url 'https://github.com/<insert_org_here>/<%= cookbook_name %>'
|
File without changes
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook:: <%= cookbook_name %>
|
3
|
+
# Spec:: default
|
4
|
+
#
|
5
|
+
<%= license_description('#') %>
|
6
|
+
|
7
|
+
require 'spec_helper'
|
8
|
+
|
9
|
+
describe '<%= cookbook_name %>::<%= recipe_name %>' do
|
10
|
+
context 'When all attributes are default, on an Ubuntu 16.04' do
|
11
|
+
let(:chef_run) do
|
12
|
+
# for a complete list of available platforms and versions see:
|
13
|
+
# https://github.com/customink/fauxhai/blob/master/PLATFORMS.md
|
14
|
+
runner = ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04')
|
15
|
+
runner.converge(described_recipe)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'converges successfully' do
|
19
|
+
expect { chef_run }.to_not raise_error
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
## Below are example of common git excludes.
|
2
|
+
## Please note that /cookbooks folder is ignored. This allows users to
|
3
|
+
## clone individual cookbooks into the /cookbook folder of the chef repo
|
4
|
+
## and work on them in parallel. This pattern also allows for chef-workstation
|
5
|
+
## pattern, where base repo also builds out a dynamic chef workstation.
|
6
|
+
## Examples of workstation cookbooks:
|
7
|
+
## https://github.com/mwrock/chef_workstation
|
8
|
+
## https://github.com/Nordstrom/chefdk_bootstrap
|
9
|
+
|
10
|
+
|
11
|
+
## Ignore Chef related files and secrets
|
12
|
+
.chef
|
13
|
+
.chef/*.pem
|
14
|
+
.chef/encrypted_data_bag_secret
|
15
|
+
<%- if policy_only -%>
|
16
|
+
cookbooks/**
|
17
|
+
!cookbooks/README.md
|
18
|
+
<%- end -%>
|
19
|
+
|
20
|
+
## Ignore Chef-Zero files
|
21
|
+
clients
|
22
|
+
nodes
|
23
|
+
|
24
|
+
# ## OS junk files
|
25
|
+
# [Tt]humbs.db
|
26
|
+
# *.DS_Store
|
27
|
+
|
28
|
+
# ## Example of the workstation pattern.
|
29
|
+
# !/cookbooks/chef_workstation/files/default/bundler/Gemfile
|
30
|
+
# !/cookbooks/chef_workstation/files/default/bundler/Gemfile.lock
|
31
|
+
# cookbooks/*
|
32
|
+
# !cookbooks/chef_workstation
|
33
|
+
|
34
|
+
# ##Chef
|
35
|
+
# .kitchen/
|
36
|
+
# .vagrant
|
37
|
+
# nodes
|
38
|
+
# metadata.json
|
39
|
+
|
40
|
+
# ##ruby
|
41
|
+
# *.gem
|
42
|
+
# Gemfile
|
43
|
+
# Gemfile.lock
|
44
|
+
.rake_test_cache
|
45
|
+
|
46
|
+
# ## Rails Heroku and other bits to ignore
|
47
|
+
# *.log
|
48
|
+
# *.sqlite3
|
49
|
+
# db/*.sqlite3
|
50
|
+
# .bundle
|
51
|
+
# log/*
|
52
|
+
# tmp/*
|
53
|
+
# public/system/*
|
54
|
+
|
55
|
+
# ##nodejs
|
56
|
+
# node_modules
|
57
|
+
|
58
|
+
# # Nuget (exclude all exes except for the one in the global build folder)
|
59
|
+
# nuget.exe
|
60
|
+
# !build/nuget/nuget.exe
|
61
|
+
# *.nupkg
|
62
|
+
# # NuGet packages (based on default naming convention)
|
63
|
+
# [Bb]uild/[Pp]ackages/
|
64
|
+
|
65
|
+
# # Build System # common build output folders
|
66
|
+
# build-common/
|
67
|
+
# output/
|
68
|
+
|
69
|
+
# ## Probably not a good idea to be keeing VM inages in source control
|
70
|
+
# *.vhd
|
71
|
+
# *.vhdx
|
72
|
+
|
73
|
+
# ## Pester Test summary
|
74
|
+
# Test.xml
|
75
|
+
|
76
|
+
# ##Webstorm files
|
77
|
+
# *.idea
|
78
|
+
# .idea
|
79
|
+
# .idea/
|
80
|
+
|
81
|
+
# ##Mono (or something?) files
|
82
|
+
# *.pidb
|
83
|
+
# *.userprefs
|
84
|
+
|
85
|
+
# ## Visual Studio files
|
86
|
+
# *.docstates
|
87
|
+
# *.[Oo]bj
|
88
|
+
# *.dat
|
89
|
+
# *.crc
|
90
|
+
# *.dbmdl
|
91
|
+
# *.pdb
|
92
|
+
# *.user
|
93
|
+
# *.aps
|
94
|
+
# *.pch
|
95
|
+
# *.vspscc
|
96
|
+
# *.vssscc
|
97
|
+
# *_i.c
|
98
|
+
# *_p.c
|
99
|
+
# *.ncb
|
100
|
+
# *.suo
|
101
|
+
# *.tlb
|
102
|
+
# *.tlh
|
103
|
+
# *.bak
|
104
|
+
# *.[Cc]ache
|
105
|
+
# *.ilk
|
106
|
+
# *.log
|
107
|
+
# *.lib
|
108
|
+
# *.sbr
|
109
|
+
# *.schemaview
|
110
|
+
# ipch/
|
111
|
+
# [Oo]bj/
|
112
|
+
# [Bb]in/*
|
113
|
+
# [Dd]ebug*/
|
114
|
+
# [Rr]elease*/
|
115
|
+
# Ankh.NoLoad
|
116
|
+
|
117
|
+
# ##Tooling
|
118
|
+
# _ReSharper*/
|
119
|
+
# *.[Rr]e[Ss]harper
|
120
|
+
# [Tt]est[Rr]esult*
|
121
|
+
# .[Jj]ust[Cc]ode
|
122
|
+
# *ncrunch*
|
123
|
+
|
124
|
+
# ##Subversion files
|
125
|
+
# .svn
|
126
|
+
|
127
|
+
# ## Office Temp Files
|
128
|
+
# ~$*
|
File without changes
|
File without changes
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'mixlib/cli'
|
2
|
+
require 'rbconfig'
|
3
|
+
require 'pathname'
|
4
|
+
require 'idlc-sdk-pfm/command/base'
|
5
|
+
require 'idlc-sdk-pfm/generator'
|
6
|
+
|
7
|
+
module Pfm
|
8
|
+
module Command
|
9
|
+
# ## SharedGeneratorOptions
|
10
|
+
#
|
11
|
+
# These CLI options are shared amongst the generator commands
|
12
|
+
module SharedGeneratorOptions
|
13
|
+
include Mixlib::CLI
|
14
|
+
|
15
|
+
# You really want these to have default values, as
|
16
|
+
# they will likely be used all over the place.
|
17
|
+
# option :verbose,
|
18
|
+
# short: '-V',
|
19
|
+
# long: '--verbose',
|
20
|
+
# description: 'Show detailed output from the generator',
|
21
|
+
# boolean: true,
|
22
|
+
# default: false
|
23
|
+
end
|
24
|
+
|
25
|
+
# ## GeneratorCommands
|
26
|
+
#
|
27
|
+
# This module is the namespace for all subcommands of `pfm generate`
|
28
|
+
module GeneratorCommands
|
29
|
+
def self.build(class_name, params)
|
30
|
+
const_get(class_name).new(params)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'idlc-sdk-pfm/command/base'
|
2
|
+
require 'mixlib/shellout'
|
3
|
+
|
4
|
+
module Pfm
|
5
|
+
module Command
|
6
|
+
class Plan < Base
|
7
|
+
banner 'Usage: pfm plan [options]'
|
8
|
+
|
9
|
+
option :app_release,
|
10
|
+
short: '-a VERSION',
|
11
|
+
long: '--app-release VERSION',
|
12
|
+
description: 'Application Version Number to Deploy',
|
13
|
+
default: ''
|
14
|
+
|
15
|
+
option :server_build,
|
16
|
+
short: '-b NUMBER',
|
17
|
+
long: '--server-build NUMBER',
|
18
|
+
description: 'Server Build Number to Deploy',
|
19
|
+
default: ENV['SERVER_BUILD']
|
20
|
+
|
21
|
+
option :landscape,
|
22
|
+
short: '-l',
|
23
|
+
long: '--landscape',
|
24
|
+
description: 'Format the output with the terraform_landscape gem',
|
25
|
+
boolean: true,
|
26
|
+
default: false
|
27
|
+
|
28
|
+
def initialize
|
29
|
+
super
|
30
|
+
@params_valid = true
|
31
|
+
@errors = []
|
32
|
+
end
|
33
|
+
|
34
|
+
def run(params)
|
35
|
+
@params = params
|
36
|
+
read_and_validate_params
|
37
|
+
|
38
|
+
if params_valid?
|
39
|
+
deploy_setup
|
40
|
+
plan
|
41
|
+
# @workspace.cleanup causing bundler issues
|
42
|
+
0
|
43
|
+
else
|
44
|
+
@errors.each { |error| err("Error: #{error}") }
|
45
|
+
parse_options(params)
|
46
|
+
msg(opt_parser)
|
47
|
+
1
|
48
|
+
end
|
49
|
+
rescue DeploymentFailure => e
|
50
|
+
err("ERROR: #{e.message}\n")
|
51
|
+
1
|
52
|
+
end
|
53
|
+
|
54
|
+
def plan
|
55
|
+
begin
|
56
|
+
Terraform::Binary.get("-update #{@workspace.tmp_dir}")
|
57
|
+
Terraform::Binary.plan(@workspace.tmp_dir) unless @config[:landscape]
|
58
|
+
Terraform::Binary.plan("#{@workspace.tmp_dir} | landscape") if @config[:landscape]
|
59
|
+
rescue
|
60
|
+
raise DeploymentFailure, 'Finished with errors'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def read_and_validate_params
|
65
|
+
arguments = parse_options(@params)
|
66
|
+
|
67
|
+
case arguments.size
|
68
|
+
when 0
|
69
|
+
@params_valid = true
|
70
|
+
else
|
71
|
+
@params_valid = false
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def params_valid?
|
76
|
+
@params_valid
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<powershell>
|
2
|
+
$logfile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Logs\\packer-build-userdata.log"
|
3
|
+
# Allow script execution
|
4
|
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
|
5
|
+
#PS Remoting and & winrm.cmd basic config
|
6
|
+
Enable-PSRemoting -Force -SkipNetworkProfileCheck
|
7
|
+
& winrm.cmd set winrm/config '@{MaxTimeoutms="1800000"}' >> $logfile
|
8
|
+
& winrm.cmd set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}' >> $logfile
|
9
|
+
& winrm.cmd set winrm/config/winrs '@{MaxShellsPerUser="50"}' >> $logfile
|
10
|
+
#Server settings - support username/password login
|
11
|
+
& winrm.cmd set winrm/config/service/auth '@{Basic="true"}' >> $logfile
|
12
|
+
& winrm.cmd set winrm/config/service '@{AllowUnencrypted="true"}' >> $logfile
|
13
|
+
& winrm.cmd set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}' >> $logfile
|
14
|
+
#Firewall Config
|
15
|
+
& netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" profile=public protocol=tcp localport=5985 remoteip=localsubnet new remoteip=any >> $logfile
|
16
|
+
</powershell>
|