This repository has been archived by the owner on Jul 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
d5d22ae
commit 6e9c334
Showing
22 changed files
with
384 additions
and
94 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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name 'rubygems-hubot' | ||
|
||
version '0.0.68' | ||
version '0.0.69' | ||
|
||
depends 'chef-vault' | ||
depends 'hubot', '~> 1.0.2' | ||
|
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
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
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,12 @@ | ||
name 'rubygems-shipit' | ||
|
||
version '0.0.44' | ||
|
||
depends 'apt' | ||
depends 'git' | ||
depends 'logrotate' | ||
depends 'nodejs' | ||
depends 'runit' | ||
depends 'sudo' | ||
|
||
supports 'ubuntu' |
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,50 @@ | ||
# | ||
# Cookbook Name:: rubygems-shipit | ||
# Recipe:: app | ||
# | ||
|
||
current_environment = 'production' | ||
current_app_path = '/applications/shipit/current' | ||
|
||
if File.directory? current_app_path | ||
|
||
1.times do |n| | ||
the_port = 3000 + n | ||
service_name = "shipit-thin-#{the_port}" | ||
|
||
runit_service service_name do | ||
run_template_name 'thin' | ||
default_logger true | ||
options( | ||
deploy_path: current_app_path, | ||
run_as_user: 'shipit', | ||
listen_ip: '127.0.0.1', | ||
listen_port: the_port, | ||
bundle_bin: '/usr/local/bin/bundle', | ||
rack_env: current_environment, | ||
timeout: 30 | ||
) | ||
restart_on_update ::File.exist?("/etc/sv/#{service_name}") | ||
end | ||
end | ||
|
||
1.times do |n| | ||
worker_name = "shipit-resque-#{n+1}" | ||
|
||
runit_service worker_name do | ||
run_template_name 'resque' | ||
default_logger true | ||
restart_on_update false | ||
options( | ||
path: current_app_path, | ||
user: 'shipit', | ||
queue: 'deploys,default,*', | ||
worker_name: worker_name, | ||
num_workers: 1 | ||
) | ||
end | ||
end | ||
|
||
else | ||
Chef::Log.error('You need to deploy the application before we can set up the application servers.') | ||
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,16 @@ | ||
# | ||
# Cookbook Name:: rubygems-shipit | ||
# Recipe:: default | ||
# | ||
|
||
node.default['nodejs']['install_method'] = 'package' | ||
|
||
include_recipe 'apt' | ||
include_recipe 'git' | ||
include_recipe 'nodejs' | ||
include_recipe 'runit' | ||
|
||
include_recipe 'rubygems-people::deploy' | ||
include_recipe 'rubygems-shipit::setup' | ||
include_recipe 'rubygems-shipit::app' | ||
include_recipe 'rubygems-shipit::nginx' |
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,43 @@ | ||
# | ||
# Cookbook Name:: rubygems-shipit | ||
# Recipe:: nginx | ||
# | ||
|
||
node.default['nginx']['server_tokens'] = 'off' | ||
node.default['nginx']['default_site_enabled'] = false | ||
|
||
include_recipe 'nginx' | ||
|
||
directory "#{node['nginx']['dir']}/certs" do | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
end | ||
|
||
item = chef_vault_item('certs', 'production') | ||
|
||
file "#{node['nginx']['dir']}/certs/rubygems.org.key" do | ||
content item['key'] | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
notifies :reload, 'service[nginx]' | ||
end | ||
|
||
file "#{node['nginx']['dir']}/certs/rubygems.org.crt" do | ||
content item['crt'] | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
notifies :reload, 'service[nginx]' | ||
end | ||
|
||
template "#{node['nginx']['dir']}/sites-available/shipit" do | ||
source 'nginx.conf.erb' | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
notifies :reload, 'service[nginx]' | ||
end | ||
|
||
nginx_site 'shipit' |
Oops, something went wrong.