This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3f5cac6
Showing
10 changed files
with
223 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
driver: | ||
name: vagrant | ||
|
||
provisioner: | ||
name: chef_solo | ||
|
||
platforms: | ||
- name: centos-6.5 | ||
driver_config: | ||
box: chef/centos-6.5 | ||
network: | ||
- [public_network, bridge: 'en0: Wi-Fi (AirPort)'] | ||
customize: | ||
cpus: 2 | ||
memory: 3024 | ||
cpuexecutioncap: 100 | ||
|
||
suites: | ||
- name: deployer | ||
run_list: | ||
- recipe[deployer] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
source 'https://api.berkshelf.com' | ||
metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default['deployer']['chef-server'] = 'https://10.111.4.101' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name 'deployer' | ||
maintainer 'Eucalyptus Systems' | ||
maintainer_email '[email protected]' | ||
license 'Apache 2' | ||
description 'Installs/Configures Deployer jenkins instance' | ||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) | ||
version '0.1.0' | ||
depends 'python' | ||
depends 'rbenv' | ||
depends 'ntp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Cookbook Name:: cookbooks/micro-qa | ||
# Recipe:: default | ||
# | ||
# Copyright 2014, Eucalyptus Systems | ||
# | ||
# All rights reserved - Do Not Redistribute | ||
# | ||
|
||
include_recipe "deployer::deploy" | ||
include_recipe "deployer::eutester" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# | ||
# Cookbook Name:: cookbooks/deployer | ||
# Recipe:: deploy | ||
# | ||
# Copyright 2014, Eucalyptus Systems | ||
# | ||
# All rights reserved - Do Not Redistribute | ||
# | ||
include_recipe "python" | ||
|
||
directory "/root/.chef" | ||
|
||
template "/root/.chef/knife.rb" do | ||
source "knife.erb" | ||
end | ||
|
||
package "git" | ||
|
||
if platform?("redhat", "centos", "fedora") | ||
package "libxml2-devel" | ||
package "libxslt-devel" | ||
elsif platform?("ubuntu", "debian") | ||
package "libxml2-dev" | ||
package "libxslt1-dev" | ||
end | ||
|
||
include_recipe "rbenv" | ||
include_recipe "rbenv::ruby_build" | ||
|
||
mb_ruby_version = "2.1.2" | ||
|
||
rbenv_ruby mb_ruby_version do | ||
global true | ||
not_if "ls /opt/rbenv/versions/#{mb_ruby_version}" | ||
end | ||
|
||
rbenv_execute "gem install motherbrain" do | ||
ruby_version mb_ruby_version | ||
timeout 1200 | ||
not_if "ls /opt/rbenv/versions/#{mb_ruby_version}/bin/mb" | ||
end | ||
|
||
directory "/root/.mb" | ||
|
||
template "/root/.mb/config.json" do | ||
source "motherbrain.erb" | ||
end | ||
|
||
python_pip "paramiko" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# | ||
# Cookbook Name:: cookbooks/micro-qa | ||
# Recipe:: eutester | ||
# | ||
# Copyright 2014, Eucalyptus Systems | ||
# | ||
# All rights reserved - Do Not Redistribute | ||
# | ||
include_recipe "ntp" | ||
|
||
pip_options = "" | ||
if platform?("redhat", "centos", "fedora") | ||
# code for only redhat family systems. | ||
%w{python-devel python-setuptools gcc make git unzip ant}.each do |package_name| | ||
package package_name | ||
end | ||
pip_options = "--pre" | ||
elsif platform?("ubuntu", "debian") | ||
# code for debian | ||
%w{python-setuptools gcc python-dev git python-virtualenv | ||
git unzip ant}.each do |package_name| | ||
package package_name | ||
end | ||
end | ||
|
||
directory "/vagrant/jenkins/share" do | ||
only_if "ls /vagrant" | ||
end | ||
|
||
execute "easy_install pip" | ||
python_pip "virtualenv" | ||
|
||
python_virtualenv "/vagrant/jenkins/share/eutester-base" do | ||
owner "root" | ||
group "root" | ||
action :create | ||
only_if "ls /vagrant" | ||
end | ||
|
||
python_pip "eutester" do | ||
virtualenv "/vagrant/jenkins/share/eutester-base" | ||
only_if "ls /vagrant" | ||
options pip_options | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
log_level :info | ||
log_location STDOUT | ||
node_name 'admin' | ||
client_key '/etc/chef-server/admin.pem' | ||
validation_client_name 'chef-validator' | ||
validation_key '/etc/chef-server/chef-validator.pem' | ||
chef_server_url '<%= node['deployer']['chef-server'] %>' | ||
cookbook_path '/root/cookbooks' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"berkshelf": { | ||
"path": "~/.berkshelf" | ||
}, | ||
"chef": { | ||
"api_url": "<%= node['deployer']['chef-server-url'] %>", | ||
"api_client": "admin", | ||
"api_key": "/etc/chef-server/admin.pem", | ||
"validator_client": "chef-validator", | ||
"validator_path": "/etc/chef-server/chef-validator.pem", | ||
"bootstrap_proxy": null, | ||
"encrypted_data_bag_secret_path": null | ||
}, | ||
"ssh": { | ||
"user": "root", | ||
"password": "foobar", | ||
"keys": ["/root/.ssh/id_rsa"], | ||
"sudo": false, | ||
"timeout": 10.0, | ||
"verbose": null | ||
}, | ||
"winrm": { | ||
"user": null, | ||
"password": null, | ||
"port": 5985 | ||
}, | ||
"ssl": { | ||
"verify": false | ||
}, | ||
"log": { | ||
"level": "INFO", | ||
"location": "STDOUT" | ||
}, | ||
"server": { | ||
"daemonize": false, | ||
"pid": "/var/run/motherbrain/mb.pid" | ||
}, | ||
"rest_gateway": { | ||
"enable": false, | ||
"host": "0.0.0.0", | ||
"port": 0 | ||
}, | ||
"plugin_manager": { | ||
"eager_loading": false, | ||
"eager_load_interval": 300, | ||
"async_loading": false | ||
}, | ||
"ef": { | ||
"api_url": null, | ||
"api_key": null | ||
}, | ||
"bootstrap": { | ||
"default_template": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'serverspec' | ||
|
||
include Serverspec::Helper::Exec | ||
include Serverspec::Helper::DetectOS | ||
|
||
RSpec.configure do |c| | ||
c.before :all do | ||
c.path = '/sbin:/usr/sbin' | ||
end | ||
end | ||
|
||
describe "Deployer" do | ||
describe command('ruby -v') do | ||
it { should match /2.1.2/ } | ||
end | ||
|
||
describe command('mb version') do | ||
it { should return_exit_status 0 } | ||
end | ||
end |