Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
2 total  XML / RSS feed 

SMF Manifest for Mongrels on TXD Containers

An SMF manifest that works well on the TXD containers. More here, and also see the related Capistrano config

<?xml version='1.0'?>
DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='mongrel/example'>
  <service name='network/mongrel/example' type='service' version='0'>
    <create_default_instance enabled='true'/>
    <dependency name='fs' grouping='require_all' restart_on='none' type='service'>
      <service_fmri value='svc:/system/filesystem/local'/>
    'mongrel_example' restart_on='none' grouping='optional_all'>
    'start' type='method' exec='/opt/csw/bin/mongrel_rails cluster::start' timeout_seconds='60'>
        'example' group='example' />

    'stop' type='method' exec=':kill' timeout_seconds='60'>


Capistrano for TXD Containers

A mostly-standardized Capistrano deploy.rb file for the TXD containers. Adjust :application, :smf, :repository, :deploy_to as required; adjust the role definitions too if you want to use different hosts.

Copy your database.yml file to /home/example/rails/ and it'll get symlinked into place before the app is restarted.

This works with my SMF manifest here

set :application, ""
set :smf, "mongrel/example"
set :repository, "{application}"
set :deploy_to, "/home/example/rails/#{application}"
role :web, "#{application}", :primary => true
role :app, "#{application}", :primary => true
role :db, "#{application}", :primary => true

set :checkout, "export"
set :svn, "/opt/csw/bin/svn"
set :sudo, "/opt/csw/bin/sudo"
set :rake, "/opt/csw/bin/rake"

task :after_update_code do
  run "ln -s #{deploy_to}/#{shared_dir}/config/database.yml #{current_release}/config/database.yml"
  run "rm -f #{current_path}"

task :spinner, :roles => :app do
  send(run_method, "/usr/sbin/svcadm start #{smf}")

task :restart, :roles => :app do
  send(run_method, "/usr/sbin/svcadm restart #{smf}")
« Newer Snippets
Older Snippets »
2 total  XML / RSS feed