Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Jenkins

The beginnings of memcached
  • Loading branch information...
commit 7e2ce06e76c252450a36034bbeb609271f5484df 1 parent f1689ba
root authored
View
2  manifests/modules.pp
@@ -6,4 +6,4 @@
import "rvm"
import "postgresql"
import "nginx"
-import "god"
View
38 manifests/nodes.pp
@@ -65,15 +65,49 @@
ruby => "1.9.3-p125",
gemset => "copycopter",
ruby_type => "ruby",
+ project => "copycopter",
}
}
-node 'en-tesla-ci' inherits 'ruby-187-web' {
- nginx::unicorn_site { 'edisonnation.com': }
+node 'en-tesla' inherits 'ruby-187-web' {
rvm_gemset {
"ruby-1.8.7-p358@tesla":
ensure => present,
require => Rvm_system_ruby['1.8.7-p358'],
}
+ file {"/var/www":
+ ensure => "directory",
+ owner => "www",
+ group => "www",
+ mode => 750,
+ }
+}
+
+node 'en-tesla-ci' inherits 'en-tesla' {
+ nginx::jenkins_site { 'edisonnation.com': }
include mysql::server
+ include jenkins
+ package {"imagemagick": ensure => installed }
+ package {"libmagick9-dev": ensure => installed }
+}
+
+node 'en-experimental' inherits 'en-tesla' {
+ nginx::unicorn_site { 'edisonnation.com': }
+ package {"imagemagick": ensure => installed }
+ package {"libmysqlclient-dev": ensure => installed }
+ package {"libmagick9-dev": ensure => installed }
+ class { "god":
+ rails_environment => "experimental",
+ role => "app-server",
+ ruby => "1.8.7-p358",
+ gemset => "tesla",
+ ruby_type => "ruby",
+ project => "edisonnation.com",
+ }
+ rvm_gem {
+ 'ruby-1.8.7-p358@tesla/unicorn':
+ ensure => latest,
+ require => Rvm_system_ruby['1.8.7-p358'],
+ }
+
}
View
4 modules/god/manifests/init.pp
@@ -1,5 +1,5 @@
-class god( $rails_environment, $role, $ruby, $ruby_type, $gemset ) {
- $config_location = "GOD_CONFIG=/var/www/$gemset/current/config/god/$rails_environment/$role/all.god"
+class god( $rails_environment, $role, $ruby, $ruby_type, $gemset, $project ) {
+ $config_location = "GOD_CONFIG=/var/www/$project/current/config/god/$rails_environment/$role/all.god"
$gemset_for_rvm = "$ruby@$gemset"
$gemset_path = "${ruby_type}-${gemset_for_rvm}"
View
14 modules/jenkins/manifests/init.pp
@@ -0,0 +1,14 @@
+class jenkins {
+ apt::key {"jenkins":
+ source => "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key",
+ }
+
+ apt::sources_list {"jenkins":
+ ensure => present,
+ content => "deb http://pkg.jenkins-ci.org/debian binary/",
+ require => Apt::Key["jenkins"]
+ }
+
+ package {"jenkins": ensure => installed }
+
+}
View
12 modules/jenkins/manifests/init.pp~
@@ -0,0 +1,12 @@
+class jenkins {
+ apt::key {"jenkins":
+ source => "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key",
+ }
+
+ apt::sources_list {"jenkins":
+ ensure => present,
+ content => "deb http://pkg.jenkins-ci.org/debian binary/",
+ require => Apt::Key["jenkins"]
+ }
+
+}
View
13 modules/memcached/lib/facter/memorysize_mb.rb
@@ -0,0 +1,13 @@
+Facter.add("memorysize_mb") do
+ confine :kernel => :Linux
+ ram = 0
+ # Steal linux's meminfo
+ File.open( "/proc/meminfo" , 'r' ) do |f|
+ f.grep( /^MemTotal:/ ) { |mem|
+ ram = mem.split( / +/ )[1].to_i / 1024
+ }
+ end
+ setcode do
+ ram
+ end
+end
View
2  modules/mysql/manifests/server.pp
@@ -1,5 +1,7 @@
class mysql::server {
package { "mysql-server": ensure => installed }
+ package { "libmysqlclient-dev": ensure => installed }
+
service { "mysql":
enable => true,
ensure => running,
View
19 modules/nginx/manifests/init.pp
@@ -18,6 +18,9 @@
file { "/etc/nginx/sites-enabled/default":
ensure => absent,
}
+ file { "/etc/nginx/sites-available/default":
+ ensure => absent,
+ }
define unicorn_site($domain="", $host="") {
include nginx
@@ -47,4 +50,20 @@
}
}
+
+ define jenkins_site {
+ include nginx
+ file { "/etc/nginx/sites-available/jenkins.conf":
+ content => template("nginx/jenkins_vhost.erb"),
+ require => Package["nginx"],
+ }
+
+ file { "/etc/nginx/sites-enabled/jenkins.conf":
+ ensure => link,
+ target => "/etc/nginx/sites-available/jenkins.conf",
+ require => File["/etc/nginx/sites-available/jenkins.conf"],
+ notify => Exec["reload nginx"],
+ }
+
+ }
}
View
20 modules/nginx/templates/jenkins_vhost.erb
@@ -0,0 +1,20 @@
+upstream app_server {
+ server 127.0.0.1:8080 fail_timeout=0;
+}
+
+server {
+ listen 80;
+ listen [::]:80 default ipv6only=on;
+ server_name ci.yourcompany.com;
+
+ location / {
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $http_host;
+ proxy_redirect off;
+
+ if (!-f $request_filename) {
+ proxy_pass http://app_server;
+ break;
+ }
+ }
+}
View
0  modules/nginx/templates/jenkins_vhost.erb~
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.