capistrano-helpers 0.3.2 → 0.4.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.
@@ -0,0 +1,16 @@
1
+ # Capistrano-Helpers Changelog
2
+
3
+ ## 0.4.0
4
+
5
+ New:
6
+
7
+ * Wrote new helpers for SkylineCMS. See http://skylinecms.nl
8
+
9
+ * Changes permissions on folders. Some things like Sprockets require folders to be writable.
10
+ * Creates the needed cache directories, with appropriate permissions.
11
+ * Creates upload folder if it doesn't exist, then creates the symlink to it.
12
+ * Runs skyline's migrations on the remote server.
13
+
14
+ ## Pre-0.4.0
15
+
16
+ * CHANGELOG was just created. Please see git commit history for more information.
data/README.rdoc CHANGED
@@ -138,6 +138,12 @@ This will create two symbolic links on the production server:
138
138
  #{release_path}/public/uploads -> #{shared_path}/public/uploads
139
139
  #{release_path}/public/downloads/huge_files -> #{shared_path}/public/downloads/huge_files
140
140
 
141
+ === skylinecms
142
+
143
+ This is for the SkylineCMS gem. Skyline requires certain permissions and folders to operate,
144
+ and this helper insures they exist. Remember to run this *after* the rest of your symlinks exist
145
+ (eg. config/database.yml) and *before* anything loads the environment (eg. rake gems:install).
146
+
141
147
  === privates
142
148
 
143
149
  This works much like the shared helper above, except the symbolic link will
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.4.0
@@ -1,12 +1,15 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
1
4
  # -*- encoding: utf-8 -*-
2
5
 
3
6
  Gem::Specification.new do |s|
4
7
  s.name = %q{capistrano-helpers}
5
- s.version = "0.3.2"
8
+ s.version = "0.4.0"
6
9
 
7
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
11
  s.authors = ["Scott Woods"]
9
- s.date = %q{2009-11-04}
12
+ s.date = %q{2010-05-10}
10
13
  s.description = %q{A set of optional extensions to capistrano to make common tasks easier.}
11
14
  s.email = %q{scott@westarete.com}
12
15
  s.extra_rdoc_files = [
@@ -16,6 +19,7 @@ Gem::Specification.new do |s|
16
19
  s.files = [
17
20
  ".document",
18
21
  ".gitignore",
22
+ "CHANGELOG.markdown",
19
23
  "LICENSE",
20
24
  "README.rdoc",
21
25
  "Rakefile",
@@ -33,6 +37,7 @@ Gem::Specification.new do |s|
33
37
  "lib/capistrano-helpers/preflight.rb",
34
38
  "lib/capistrano-helpers/privates.rb",
35
39
  "lib/capistrano-helpers/shared.rb",
40
+ "lib/capistrano-helpers/skylinecms.rb",
36
41
  "lib/capistrano-helpers/specs.rb",
37
42
  "lib/capistrano-helpers/version.rb",
38
43
  "test/capistrano-helpers_test.rb",
@@ -41,7 +46,7 @@ Gem::Specification.new do |s|
41
46
  s.homepage = %q{http://github.com/westarete/capistrano-helpers}
42
47
  s.rdoc_options = ["--charset=UTF-8"]
43
48
  s.require_paths = ["lib"]
44
- s.rubygems_version = %q{1.3.5}
49
+ s.rubygems_version = %q{1.3.6}
45
50
  s.summary = %q{A set of optional extensions to capistrano to make common tasks easier.}
46
51
  s.test_files = [
47
52
  "test/capistrano-helpers_test.rb",
@@ -61,3 +66,4 @@ Gem::Specification.new do |s|
61
66
  s.add_dependency(%q<capistrano>, [">= 2.0.0"])
62
67
  end
63
68
  end
69
+
@@ -5,7 +5,7 @@ CapistranoHelpers.with_configuration do
5
5
  namespace :deploy do
6
6
  desc 'Restart passenger'
7
7
  task :restart, :roles => :app do
8
- run "touch #{release_path}/tmp/restart.txt"
8
+ run "touch #{current_path}/tmp/restart.txt"
9
9
  end
10
10
  end
11
11
 
@@ -0,0 +1,49 @@
1
+ require File.dirname(__FILE__) + '/../capistrano-helpers' if ! defined?(CapistranoHelpers)
2
+
3
+ CapistranoHelpers.with_configuration do
4
+
5
+ namespace :deploy do
6
+ namespace :skylinecms do
7
+
8
+ desc "Make certain directories writeable."
9
+ task :make_writeable, :roles => :app do
10
+ # Make this directory writeable so sprockets can compress the javascript.
11
+ run "sudo chown passenger #{release_path}/public/skylinecms/javascripts"
12
+ end
13
+
14
+ desc "Create cache directories on the remote server."
15
+ task :create_cache_dirctories, :roles => :app do
16
+ cache_paths = [
17
+ "#{release_path}/tmp/cache/media_files/cache",
18
+ "#{release_path}/tmp/cache/rss_sections/cache"
19
+ ]
20
+ cache_paths.each do |cache_path|
21
+ run "if [ ! -d #{cache_path} ] ; then mkdir -p #{cache_path} && sudo chown passenger #{cache_path} ; fi"
22
+ end
23
+ end
24
+
25
+ desc "Create upload directory on the remote server."
26
+ task :create_upload_directory, :roles => :app do
27
+ shared_upload_path = "#{shared_path}/tmp/upload"
28
+ release_upload_path = "#{release_path}/tmp/upload"
29
+ # Ensure that the shared directory exists
30
+ run "if [ ! -d #{shared_upload_path} ] ; then mkdir -p #{shared_upload_path} && sudo chown passenger #{shared_upload_path} ; fi"
31
+ # Delete the upload directory that came with the source
32
+ run "rm -rf #{release_upload_path}"
33
+ # Symlink the release directory to the shared directory
34
+ run "ln -s #{shared_upload_path} #{release_upload_path}"
35
+ end
36
+
37
+ desc "Run skylinecms migrations on the remote server."
38
+ task :migrate, :roles => :app do
39
+ rails_env = fetch(:rails_env, "production")
40
+ run "cd #{release_path} && #{sudo} rake skylinecms:db:migrate RAILS_ENV=#{rails_env}"
41
+ end
42
+
43
+ end
44
+ end
45
+
46
+ # Always run migrations.
47
+ after "deploy:update_code", "deploy:skylinecms:make_writeable", "deploy:skylinecms:create_cache_dirctories", "deploy:skylinecms:create_upload_directory", "deploy:skylinecms:migrate"
48
+
49
+ end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 4
8
+ - 0
9
+ version: 0.4.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Scott Woods
@@ -9,19 +14,23 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-11-04 00:00:00 -05:00
17
+ date: 2010-05-10 00:00:00 -04:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: capistrano
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 2
29
+ - 0
30
+ - 0
23
31
  version: 2.0.0
24
- version:
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  description: A set of optional extensions to capistrano to make common tasks easier.
26
35
  email: scott@westarete.com
27
36
  executables: []
@@ -34,6 +43,7 @@ extra_rdoc_files:
34
43
  files:
35
44
  - .document
36
45
  - .gitignore
46
+ - CHANGELOG.markdown
37
47
  - LICENSE
38
48
  - README.rdoc
39
49
  - Rakefile
@@ -51,6 +61,7 @@ files:
51
61
  - lib/capistrano-helpers/preflight.rb
52
62
  - lib/capistrano-helpers/privates.rb
53
63
  - lib/capistrano-helpers/shared.rb
64
+ - lib/capistrano-helpers/skylinecms.rb
54
65
  - lib/capistrano-helpers/specs.rb
55
66
  - lib/capistrano-helpers/version.rb
56
67
  - test/capistrano-helpers_test.rb
@@ -68,18 +79,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
79
  requirements:
69
80
  - - ">="
70
81
  - !ruby/object:Gem::Version
82
+ segments:
83
+ - 0
71
84
  version: "0"
72
- version:
73
85
  required_rubygems_version: !ruby/object:Gem::Requirement
74
86
  requirements:
75
87
  - - ">="
76
88
  - !ruby/object:Gem::Version
89
+ segments:
90
+ - 0
77
91
  version: "0"
78
- version:
79
92
  requirements: []
80
93
 
81
94
  rubyforge_project:
82
- rubygems_version: 1.3.5
95
+ rubygems_version: 1.3.6
83
96
  signing_key:
84
97
  specification_version: 3
85
98
  summary: A set of optional extensions to capistrano to make common tasks easier.