Skip to content

Instantly share code, notes, and snippets.

View Sauraus's full-sized avatar
:octocat:
Coding

Antek Baranski Sauraus

:octocat:
Coding
  • Vid Inc
  • Los Angeles, CA
View GitHub Profile
@Sauraus
Sauraus / recipe.rb
Last active January 22, 2016 18:38
wrong number of arguments (2 for 0..1)
include_recipe 'unity::editor'
include_recipe value_for_platform_family(
windows: 'my-jenkins::windows',
mac_os_x: 'my-jenkins::mac_os_x'
)
windows_package 'Visual Studio 2015 Tools for Unity' do
source 'http://my_server/software/microsoft/visualstudio/2015/vstu2015.msi'
checksum 'b326526c02c0142d0a2e7d6fe4f448a96bbebd5b4f8f333dd181d3ada911fbfa'
@Sauraus
Sauraus / memcached_instance.rb
Created August 12, 2013 17:53
Why is the :port not merged into the params hash for the definition?
define :memcached_instance do
include_recipe "runit"
include_recipe "memcached"
opts = params
runit_service "memcached-#{params[:name]}" do
run_template_name "memcached"
default_logger true
cookbook "memcached"
@Sauraus
Sauraus / gist:6127168
Created July 31, 2013 23:29
How to add version attribute here?
pkgs.flatten.each do |pkg|
r = package pkg do
action( node['build_essential']['compiletime'] ? :nothing : :install )
end
r.run_action(:install) if node['build_essential']['compiletime']
end
if provider
# Verify that the given provider matches what the box has.
if box_provider.to_sym != provider
@logger.error("Added box provider doesnt match expected: #{box_provider}")
raise Errors::BoxProviderDoesntMatch, :expected => provider, :actual => box_provider
end
else
# We weren't given a provider, so store this one.
provider = box_provider.to_sym
@Sauraus
Sauraus / gist:5977921
Created July 11, 2013 18:30
Example Multi OS & Multi guest VagrantFile
Vagrant.require_plugin "vagrant-windows"
win2k8_servers = {
:www => {
:hostname => "www",
:rdp_port => 3390,
:winrm_port => 5986
},
:api => {
:hostname => "api",
@Sauraus
Sauraus / gist:774985a7f80b78bbcbd2
Last active November 17, 2015 22:54
Funky berks version constraint
[(xxxxx = 6.1.7) -> (ark = 1.0.1)], [(yyyyyy = 9.0.15) -> (maven = 0.16.4) -> (ark >= 0.0.0)], [(yyyyyy = 9.0.15) -> (maven = {1.1.0,1.3.0}) -> (ark ~> 0.4)], [(yyyyyy = 9.0.15) -> (maven = 2.0.1) -> (ark ~> 0.9)], [(yyyyyy = 9.0.15) -> (groovy = 0.0.1) -> (ark >= 0.0.0)], [(yyyyyy = 9.0.15) -> (ark >= 0.0.0)], [(zzzzzzzzzzzzz = 1.1.7) -> (xxxxx = 6.1.7) -> (ark = 1.0.1)]`
@Sauraus
Sauraus / editor.rb
Last active November 3, 2015 01:57
Unity cookbook
#
# Cookbook Name:: unity
# Library:: editor
#
# Copyright (C) 2015 Disney Consumer Products Interactive
#
# All rights reserved - Do Not Redistribute
#
require 'chef/resource'
@Sauraus
Sauraus / chef-client 12.4.3 output
Last active November 2, 2015 21:39
LWRP silent failure :(
$ kitchen converge editor-macosx-1010
-----> Starting Kitchen (v1.4.2)
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/webagent-cookie.rb:458: warning: already initialized constant HTTPClient::CookieManager
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/cookie.rb:8: warning: previous definition of CookieManager was here
-----> Creating <editor-macosx-1010>...
D, [2015-11-02T12:53:59.964757 #10867] DEBUG -- : Celluloid 0.17.0 is running in BACKPORTED mode. [ http://git.io/vJf3J ]
Bringing machine 'default' up with 'vmware_fusion' provider...
==> default: Cloning VMware VM: 'macosx-10.10'. This can take some time...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
@Sauraus
Sauraus / windows_package
Created October 27, 2015 22:05
only_if vs is on Chef resource
windows_package 'Visual Studio 2015 Tools for Unity' do
source 'http://MY_SECRET_SERVER//visualstudio/2015/vstu2015.msi'
checksum 'b326526c02c0142d0a2e7d6fe4f448a96bbebd5b4f8f333dd181d3ada911fbfa'
installer_type :msi
action :install
# only_if { platform_family?('windows') }
end if platform_family?('windows')
unless tagged?('jenkins_mac_user_created')
bash "Creating jenkins user on Mac OSX" do
user "root"
cwd "/tmp"
code <<-EOH
#!/bin/sh
. /etc/rc.common
dscl . create /Users/jenkins
dscl . create /Users/jenkins RealName "Jenkins user"
dscl . passwd /Users/jenkins L1\\$ten2me