Helm and kubctl installed
brew install helm
brew install kubectl
Kubernetes docker-destkop enabled and 8gb
of memory configured in preferences
``` | |
Running Start-ChocolateyProcessAsAdmin -statements '& C:\ProgramData\chocolatey\lib\win10-initial-setup-script\tools\Win | |
10-Initial-Setup-Script-2.7\Win10.ps1 -preset C:\ProgramData\chocolatey\lib\win10-initial-setup-script\tools\Win10-Initi | |
al-Setup-Script-2.7\test\WinServer2016-ApplyAll.preset' | |
Test-ProcessAdminRights: returning True | |
Elevating permissions and running powershell block: | |
$noSleep = $False | |
#$env:ChocolateyEnvironmentDebug='false' | |
#$env:ChocolateyEnvironmentVerbose='false' | |
& import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1' -Verbose:$false | Out-Null; |
conf = {}.merge(node['cookbook']['conf']) # a workaround for Chef dsl not supporting clone or deep copy
ruby_block 'keep sensitive values separate from conf attributes' do
block do
data_bag_app = node['cookbook']['data_bag']
mysql_bag = Chef::EncryptedDataBagItem.load(data_bag_app, 'mysql')
aws_bag = Chef::EncryptedDataBagItem.load(data_bag_app, 'aws')
conf.merge!(
Here is how to pass sensitive data to a template and yet make it easy to dynamically add non-sensitive attributes.
Have non-sensitive attributes follow this pattern: node[‘cookbook’][‘collection’][‘value_1’] = ‘value1’
where collection contains a collection of one or more attributes (one level deep). e.g.,
default['mycookbook']['conf']['db_driver'] = 'com.mysql.jdbc.Driver'
default['mycookbook']['conf']['db_user'] = 'db_user'
default['mycookbook']['conf']['db_pass'] = nil
Next step is create a separate hash, e.g.,
git merge --no-commit <merge-branch> | |
git reset HEAD .travis.yml | |
git checkout -- .travis.yml | |
git commit -m 'merged <merge-branch>' |
Sonar not only doesn't follow semantic versioning with their plugins, their documentation is also poor, and the beauty of simply selecting sonar as post-build action to get reports is gone (sorry Jenkins users!).
Here are the steps to get SonarQube to work today:
clean org.jacoco:jacoco-maven-plugin:prepare-agent install
You can use Ohai's node['platform_version']
version to determine the version,
or use Windows Helpers (https://docs.chef.io/windows.html#helpers) to
determine platform information. I would recommend using Ohai vs Windows Helpers
because helpers will cause rspec testing issues. If you do use helpers, wrap the
require 'open-uri' | |
require 'open_uri_redirections' | |
require 'openssl' | |
def fetch(url, file, limit = 5) | |
fail ArgumentError, "too many download failures from #{url}" if limit == 0 | |
load_open_uri_redirections | |
uri = URI(url) | |
begin | |
open(uri, |
I borrowed this script from Scott Bradley's wonderful blog "Provision and Bootstrap Windows EC2 Instances With Chef," making the following changes:
To make compatible with Windows Server 2012 R2
, I added the following firewall rule to the powershell script section:
netsh advfirewall firewall add rule name="WinRM in" protocol=TCP dir=in profile=any localport=5985 remoteip=any localip=any action=allow
Used knife.rb
instead of using AWS API credentials
Added security-group-ids
and subnet
flags to provision to ec2 VPC
require 'json' | |
require 'oliver/logging' | |
require 'chef/knife/bootstrap' | |
class Dep | |
class << self | |
include Logging | |
def list(deployment_name, knife_config_path, instance_details, options) |