omeka-recipes 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -11,31 +11,31 @@ Useful Capistrano recipes including:
11
11
 
12
12
  ## Included Tasks
13
13
 
14
- * cap apache:reload # |OmekaRecipes| Reload Apache
15
- * cap apache:restart # |OmekaRecipes| Restart Apache
16
- * cap apache:start # |OmekaRecipes| Start Apache
17
- * cap apache:stop # |OmekaRecipes| Stop Apache
18
- * cap db:create_ini # |OmekaRecipes| Create db.ini in shared pa...
19
- * cap db:mysql:dump # |OmekaRecipes| Performs a compressed data...
20
- * cap db:mysql:fetch_dump # |OmekaRecipes| Downloads the compressed d...
21
- * cap db:mysql:restore # |OmekaRecipes| Restores the database from...
22
- * cap db:mysql:setup # |OmekaRecipes| Create MySQL database and ...
23
- * cap deploy # |OmekaRecipes| Deploy omeka, github-style
24
- * cap deploy:seppuku # |OmekaRecipes| Destroys everything
25
- * cap deploy:setup_dirs # |OmekaRecipes| Create shared dirs
26
- * cap deploy:symlink # |OmekaRecipes| Alias for symlinks:make
27
- * cap log:rotate # |OmekaRecipes| Install log rotation scrip...
28
- * cap log:tail # |OmekaRecipes| Tail all log files
29
- * cap omeka:db_ini # |OmekaRecipes| Add the db.ini to the shar...
30
- * cap omeka:fix_archive_permissions # |OmekaRecipes| Ensure the archive directo...
31
- * cap omeka:get_plugins # |OmekaRecipes| Deploy the plugins defined...
32
- * cap omeka:get_themes # |OmekaRecipes| Deploy the themes defined ...
33
- * cap omeka:link_archive_dir # |OmekaRecipes| Link the archive directoy ...
34
- * cap omeka:maintenance:start # |OmekaRecipes| Add a maitenance page for ...
35
- * cap omeka:move_archive_dir # |OmekaRecipes| Move the archive directory...
36
- * cap omeka:move_files_to_shared # |OmekaRecipes| Move a pristine copy of th...
37
- * cap omeka:rename_files # |OmekaRecipes| Rename files
38
- * cap symlinks:make # |OmekaRecipes| Make all the symlinks in a...`
14
+ * cap apache:reload
15
+ * cap apache:restart
16
+ * cap apache:start
17
+ * cap apache:stop
18
+ * cap db:create_ini
19
+ * cap db:mysql:dump
20
+ * cap db:mysql:fetch_dump
21
+ * cap db:mysql:restore
22
+ * cap db:mysql:setup
23
+ * cap deploy
24
+ * cap deploy:seppuku
25
+ * cap deploy:setup_dirs
26
+ * cap deploy:symlink
27
+ * cap log:rotate
28
+ * cap log:tail
29
+ * cap omeka:db_ini
30
+ * cap omeka:fix_archive_permissions
31
+ * cap omeka:get_plugins
32
+ * cap omeka:get_themes
33
+ * cap omeka:link_archive_dir
34
+ * cap omeka:maintenance:start
35
+ * cap omeka:move_archive_dir
36
+ * cap omeka:move_files_to_shared
37
+ * cap omeka:rename_files
38
+ * cap symlinks:make
39
39
 
40
40
  ## Installation
41
41
 
@@ -32,7 +32,7 @@ Capistrano::Configuration.instance.load do
32
32
  set :rvm_ruby_string, '1.9.3' unless exists?(:rvm_ruby_string)
33
33
  end
34
34
 
35
- set :shared_dirs, %w(archive) unless exists?(:shared_dirs)
35
+ set :shared_dirs, %w(archive system) unless exists?(:shared_dirs)
36
36
 
37
37
  namespace :app do
38
38
  task :setup, :roles => :app do
@@ -1,6 +1,8 @@
1
1
  Capistrano::Configuration.instance.load do
2
2
  set :shared_children, %w(system logs pids config archive)
3
3
 
4
+ after 'deploy:finalize', 'deploy:like_a_boss'
5
+
4
6
  namespace :deploy do
5
7
  desc '|OmekaRecipes| Deploy omeka, github-style'
6
8
  task :default, :roles => :app, :except => { :no_release => true } do
@@ -26,5 +28,20 @@ Capistrano::Configuration.instance.load do
26
28
  symlinks.make
27
29
  end
28
30
 
31
+ task :like_a_boss, :roles => :app, :except => { :no_release => true } do
32
+ message = <<-eos
33
+ ______________________
34
+ < Deployed like a boss >
35
+ ----------------------
36
+ \\ ^__^
37
+ \\ (oo)\_______
38
+ (__)\ )\\/\\
39
+ ||----w |
40
+ || ||
41
+ eos
42
+ puts message
43
+
44
+ end
45
+
29
46
  end
30
47
  end
@@ -1,14 +1,19 @@
1
1
  Capistrano::Configuration.instance.load do
2
2
 
3
3
  set :omeka_branch, "master" unless exists?(:omeka_branch)
4
+ set :sync_directories, %w(archive) unless exists?(:sync_directories)
4
5
 
5
6
  def git_clone(hash, directory)
6
7
  hash.each do |name, location|
7
8
  run "cd #{current_path}/#{directory} && rm -rf #{name}"
8
- run "cd #{current_path}/#{directory} && git clone #{location} --quiet"
9
+ run "cd #{current_path}/#{directory} && git clone #{location} #{name} --quiet"
9
10
  end
10
11
  end
11
12
 
13
+ def host_and_port
14
+ return roles[:web].servers.first.host, ssh_options[:port] || roles[:web].servers.first.port || 22
15
+ end
16
+
12
17
  namespace :omeka do
13
18
  desc '|OmekaRecipes| Ensure the archive directory has write permissions'
14
19
  task :fix_archive_permissions do
@@ -17,6 +22,30 @@ Capistrano::Configuration.instance.load do
17
22
  run "chmod -R 777 #{current_path}/archive"
18
23
  end
19
24
 
25
+ desc '|OmekaRecipes| Sync the assets directory to your local system'
26
+ task :sync_assets, :roles => :web, :once => true, :except => { :no_release => true } do
27
+ desc <<-DESC
28
+ OmekaRecipes Sync declared files from the selected multi_stage environment to
29
+ the local development environment. The synced directories must be declared as
30
+ an array of Strings with the sync_directories variable. The path is relative to
31
+ the root.
32
+ DESC
33
+
34
+ server, port = host_and_port
35
+ Array(fetch(:sync_directories, [])).each do |syncdir|
36
+ puts syncdir
37
+ unless File.directory? "#{syncdir}"
38
+ logger.info "creating local '#{syncdir}' folder"
39
+ FileUtils.mkdir_p "#{syncdir}"
40
+ end
41
+
42
+ logger.info "sync #{syncdir} from #{server}:#{port} to local"
43
+ destination, base = Pathname.new(syncdir).split
44
+ system "rsync --verbose --archive --compress --copy-links --delete --stats --rsh='ssh -p #{port}' #{user}@#{server}:#{current_path}/#{syncdir} #{destination.to_s}"
45
+ end
46
+ logger.important "sync filesystem from the stage '#{stage}' to local complete."
47
+ end
48
+
20
49
  desc '|OmekaRecipes| Rename files'
21
50
  # Omeka stages these files in its repo
22
51
  task :rename_files do
@@ -1,5 +1,5 @@
1
1
  module Omeka
2
2
  module Recipes
3
- RECIPES_VERSION = "0.3.0"
3
+ RECIPES_VERSION = "0.5.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omeka-recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-28 00:00:00.000000000 Z
12
+ date: 2012-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -139,7 +139,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  segments:
141
141
  - 0
142
- hash: 4283888623917739916
142
+ hash: 375015090587082992
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  none: false
145
145
  requirements:
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  segments:
150
150
  - 0
151
- hash: 4283888623917739916
151
+ hash: 375015090587082992
152
152
  requirements: []
153
153
  rubyforge_project:
154
154
  rubygems_version: 1.8.24