Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Create new deploy-only branch

  • Loading branch information...
commit dcb7dd41657ddadbd84398b62591ab5dab7e840d 0 parents
@mbklein mbklein authored
79 .gitignore
@@ -0,0 +1,79 @@
+## MAC OS
+.DS_Store
+
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+\#*
+.\#*
+
+## VIM
+*.swp
+*.swo
+
+## OSX
+.DS_Store
+nohup.out
+
+## Cucumber
+
+rerun.txt
+
+## rcov
+coverage.data
+coverage/*
+
+## TEST APP
+pkg/
+spec/dummy/db/*.sqlite3
+spec/dummy/log/*.log
+spec/dummy/tmp/
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+/.bundle
+/.rvmrc
+db/*.sqlite3
+**/*.log
+**/*.log.*
+tmp/pids/
+tmp/test_app/
+
+*.sqlite3
+*~
+*.swp
+
+vendor/plugins/haml/init.rb
+vendor/plugins/blacklight/.git
+
+public/plugin_assets
+public/plugin_assets/
+
+tmp/**/*
+tmp/performance
+
+db/schema.rb
+
+.project
+.buildpath
+.rvmrc
+
+/.bundle
+/.yardoc
+/doc
+## PROJECT::SPECIFIC
+config/role_map_development.yml
+config/initializers/rubyhorn.rb
+.rspec
+lib/tasks/cucumber.rake
+cucumber-results/
+.idea
+public/media_objects
+config/avalon.yml
+/dropbox
+public/streams
3  .rspec
@@ -0,0 +1,3 @@
+--format progress
+--format RspecJunitFormatter
+--out rspec.xml
1  .ruby-version
@@ -0,0 +1 @@
+1.9.3-p327-perf
1  .rvmrc
@@ -0,0 +1 @@
+rvm use ruby-1.9.3@avalon --create >/dev/null 2>&1
5 Capfile
@@ -0,0 +1,5 @@
+load 'deploy'
+# Uncomment if you are using Rails' asset pipeline
+ # load 'deploy/assets'
+Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+load 'config/deploy' # remove this line to skip loading any of the default tasks
11 Gemfile
@@ -0,0 +1,11 @@
+ source 'http://rubygems.org'
+
+ gem 'whenever', :require => false
+
+ # For testing. You will probably want to use these to run the tests you write for your hydra head
+ group :development, :test do
+ gem 'capistrano', '~>2.12.0'
+ gem 'rvm-capistrano'
+ gem 'capistrano-unicorn',
+ git: "git://github.com/sosedoff/capistrano-unicorn.git"
+ end # (leave this comment here to catch a stray line inserted by blacklight!)
44 Gemfile.lock
@@ -0,0 +1,44 @@
+GIT
+ remote: git://github.com/sosedoff/capistrano-unicorn.git
+ revision: c9d2b76f986ec74a98a3bc4dc9f655264d720e52
+ specs:
+ capistrano-unicorn (0.1.6)
+ capistrano
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activesupport (3.2.12)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ capistrano (2.12.0)
+ highline
+ net-scp (>= 1.0.0)
+ net-sftp (>= 2.0.0)
+ net-ssh (>= 2.0.14)
+ net-ssh-gateway (>= 1.1.0)
+ chronic (0.9.1)
+ highline (1.6.15)
+ i18n (0.6.4)
+ multi_json (1.6.1)
+ net-scp (1.1.0)
+ net-ssh (>= 2.6.5)
+ net-sftp (2.1.1)
+ net-ssh (>= 2.6.5)
+ net-ssh (2.6.6)
+ net-ssh-gateway (1.2.0)
+ net-ssh (>= 2.6.5)
+ rvm-capistrano (1.2.7)
+ capistrano (>= 2.0.0)
+ whenever (0.8.2)
+ activesupport (>= 2.3.4)
+ chronic (>= 0.6.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ capistrano (~> 2.12.0)
+ capistrano-unicorn!
+ rvm-capistrano
+ whenever
20 README.md
@@ -0,0 +1,20 @@
+# Avalon Media System
+[Something about the purpose of the project]
+
+For more information visit http://wiki.dlib.indiana.edu/display/VarVideo
+
+# Installing Avalon Media System
+Instructions on how to get a local installation of Avalon Media System installed on your system are available for [Linux](https://wiki.dlib.indiana.edu/display/VarVideo/Getting+Started+-+Linux) and [OS X](https://wiki.dlib.indiana.edu/display/VarVideo/Getting+Started+-+Mac).
+# Getting started:
+
+* ```git submodule init```
+* ```git submodule update```
+* Install Mediainfo cli: http://mediainfo.sourceforge.net
+* Copy config/avalon.yml.example to config/avalon.yml and change as necessary
+* ```rake db:migrate```
+* ```rake db:test:prepare```
+* ```rake spec```
+* ```rake avalon:services:start```
+
+# For batch ingest:
+* rake avalon:batch:ingest
7 Rakefile
@@ -0,0 +1,7 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+require 'rake'
+
+Avalon::Application.load_tasks
61 config/deploy.rb
@@ -0,0 +1,61 @@
+require 'bundler/setup'
+require "rvm/capistrano"
+require 'bundler/capistrano'
+require 'whenever/capistrano'
+
+set :application, "avalon"
+set :repository, "git://github.com/avalonmediasystem/avalon.git"
+
+set :stages, %W(dev testing prod)
+set :default_stage, "dev"
+require 'capistrano/ext/multistage'
+
+set(:whenever_command) { "bundle exec whenever" }
+set(:bundle_flags) { "--quiet --path=#{deploy_to}/shared/gems" }
+set :rvm_ruby_string, "1.9.3"
+set :rvm_type, :system
+
+after :bundle_install, "deploy:migrate"
+after "deploy:create_symlink", "deploy:trust_rvmrc"
+
+set(:shared_children) {
+ %{
+ config/authentication.yml
+ config/avalon.yml
+ config/database.yml
+ config/environments
+ config/fedora.yml
+ config/matterhorn.yml
+ config/role_map_#{fetch(:rails_env)}.yml
+ config/solr.yml
+ log
+ tmp/pids
+ }.split
+}
+
+set :scm, :git
+set :use_sudo, false
+set :keep_releases, 3
+
+task :uname do
+ run "uname -a"
+end
+
+namespace :deploy do
+ task :trust_rvmrc do
+ run "/usr/local/rvm/bin/rvm rvmrc trust #{latest_release}"
+ end
+
+ task :start do
+ run "cd #{current_release} && bundle exec rake delayed_job:start"
+ end
+
+ task :stop do
+ run "cd #{current_release} && bundle exec rake delayed_job:stop"
+ end
+
+ task :restart, :roles => :app, :except => { :no_release => true } do
+ run "cd #{current_release} && bundle exec rake delayed_job:restart"
+ run "touch #{File.join(current_path,'tmp','restart.txt')}"
+ end
+end
14 config/deploy/dev.rb
@@ -0,0 +1,14 @@
+# These are the configurable bits
+set(:rails_env) { "development" }
+set(:deployment_host) { "avalonwebdev.library.northwestern.edu" } # Host(s) to deploiy to
+set(:deploy_to) { "/var/www/avalon" } # Directory to deploy into
+set(:user) { 'avalon' } # User to deploy as
+set(:repository) { "git://github.com/nulib/avalon.git" } # If not using the default avalon repo
+set(:branch) { "nu-deploy" } # Git branch to deploy
+ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "id_dsa")] # SSH key used to authenticate as #{ user }
+
+set :bundle_without, [:production]
+
+role :web, deployment_host
+role :app, deployment_host
+role :db, deployment_host, :primary => true
43 config/deploy/production.rb
@@ -0,0 +1,43 @@
+server "pawpaw.dlib.indiana.edu", :app, :web, :db, :primary => true
+
+# if you want to clean up old releases on each deploy uncomment this:
+# after "deploy:restart", "deploy:cleanup"
+
+# if you're still using the script/reaper helper you will need
+# these http://github.com/rails/irs_process_scripts
+
+# If you are using Passenger mod_rails uncomment this:
+# namespace :deploy do
+# task :start do ; end
+# task :stop do ; end
+# task :restart, :roles => :app, :except => { :no_release => true } do
+# run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
+# end
+# end
+
+namespace :deploy do
+ task :start, :roles => :app do
+ run "touch #{current_release}/tmp/restart.txt"
+ end
+
+ task :stop, :roles => :app do
+ # Do nothing.
+ end
+
+ desc "Restart Application"
+ task :restart, :roles => :app do
+ run "touch #{current_release}/tmp/restart.txt"
+ end
+
+ namespace :bundle do
+ task :install, :roles => :app do
+ run "cd #{current_release}; QMAKE=/usr/bin/qmake-qt4 bundle install"
+ end
+ end
+
+ namespace :db do
+ task :setup, roles => :db do
+ run "cd #{current_release}; rake RAILS_ENV=production db:schema:load"
+ end
+ end
+end
136 config/deploy/staging.rb
@@ -0,0 +1,136 @@
+server "lancelot.dlib.indiana.edu", :app, :web, :db, :primary => true
+server "mallorn.dlib.indiana.edu", :app, :web, :db, :primary => true
+
+set :deploy_env, "development"
+set :git_enable_submodules, true
+
+set :dropbox_path, "/srv/avalon/dropbox"
+
+#For capistrano to send the correct rails env to unicorn
+set :unicorn_env, "staging"
+
+# if you want to clean up old releases on each deploy uncomment this:
+# after "deploy:restart", "deploy:cleanup"
+
+# if you're still using the script/reaper helper you will need
+# these http://github.com/rails/irs_process_scripts
+
+# If you are using Passenger mod_rails uncomment this:
+# namespace :deploy do
+# task :start do ; end
+# task :stop do ; end
+# task :restart, :roles => :app, :except => { :no_release => true } do
+# run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
+# end
+# end
+
+namespace :deploy do
+ task :update_code, :roles => :app do
+# run "cd #{current_release}; git stash"
+ run "cd #{current_release}; git checkout Gemfile.lock; git checkout config/role_map_development.yml; git pull origin master"
+ end
+
+ task :update_submodules, :roles => :app do
+ #Make sure that the services are stopped before doing this
+ run "cd #{current_release}/felix; git clean -df .; git checkout HEAD ."
+ run "cd #{current_release}/red5; git clean -df .; git checkout HEAD ."
+ run "cd #{current_release}/jetty; git clean -df .; git checkout HEAD ."
+ run "cd #{current_release}; git submodule update"
+ end
+
+ task :start, :roles => :app do
+ run "cd #{current_release}; rake avalon:services:start"
+ end
+
+ task :stop, :roles => :app do
+ run "cd #{current_release}; rake avalon:services:stop"
+ end
+
+ desc "Restart Application"
+ task :restart, :roles => :app do
+ run "cd #{current_release}; rake avalon:services:stop"
+ run "cd #{current_release}; rake avalon:services:start"
+ end
+
+ task :quick_update, :roles => :app do
+ run "cd #{current_release}; git checkout Gemfile.lock; git checkout config/role_map_development.yml; git pull origin master"
+ end
+
+ namespace :jetty do
+ task :config, :roles => :app do
+ run "cd #{current_release}; rake jetty:config"
+ end
+ task :clear, :roles => :app do
+ run "cd #{current_release}/jetty; git clean -df .; git checkout HEAD ."
+ end
+ end
+
+ namespace :felix do
+ task :clear, :roles => :app do
+ run "cd #{current_release}/felix; git clean -df .; git checkout HEAD ."
+ end
+ end
+
+ namespace :red5 do
+ task :clear, :roles => :app do
+ run "cd #{current_release}/red5; git clean -df .; git checkout HEAD ."
+ end
+ end
+
+ namespace :bundle do
+ task :install, :roles => :app do
+ run "cd #{current_release}; QMAKE=/usr/bin/qmake-qt4 bundle install"
+ end
+ end
+
+ namespace :db do
+ task :setup, roles => :db do
+ run "cd #{current_release}; rake RAILS_ENV=development db:migrate"
+ end
+ end
+
+ namespace :delayed_job do
+ desc "Start delayed_job workers"
+ task :start, :roles => :app do
+ run "cd #{current_release}; rake delayed_job:start "
+ end
+
+ desc "Stop delayed_job workers"
+ task :stop, :roles => :app do
+ run "cd #{current_release}; rake delayed_job:stop"
+ end
+
+ desc "Stop delayed_job workers"
+ task :restart, :roles => :app do
+ run "cd #{current_release}; rake delayed_job:restart"
+ end
+ end
+
+ namespace :avalon do
+ task :load_fixtures, :roles => :app do
+ # This doesn't work
+ #run "rm #{dropbox_path}/demo_fixtures/*.processed"
+ # Suggested as a fix by Michael Klein
+ run "find #{dropbox_path}/demo_fixtures -name '*.processed' -delete"
+
+ #XXX Do something fancy like get dropbox location from the server then scp or local fs copy the whole batch into place from source control
+# run "rails r \"p Avalon::Configuration['dropbox']['path']\"" do |channel, stream, data|
+# dropbox_path = data
+# return if dropbox_path.blank?
+# p "Dropbox path: #{dropbox_path}"
+#
+# #Delete old fixtures batch directory from dropbox
+# run "rm -r #{dropbox_path}/demo_fixtures"
+# #Copy new fixtures batch directory to dropbox
+# run "cp -r #{current_release}/spec/fixtures/demo_fixtures #{dropbox_path}"
+# end
+ end
+ end
+end
+
+before("deploy:update_submodules", "deploy:stop")
+after("deploy:update_code", "deploy:bundle:install")
+after("deploy:update_code", "deploy:update_submodules")
+after("deploy:update_code", "deploy:jetty:config")
+after("deploy:update_code", "deploy:db:setup")
+after('deploy:restart', 'unicorn:restart')
Please sign in to comment.
Something went wrong with that request. Please try again.