capcake 2.0.3 → 3.0.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,13 @@
1
+ require 'capistrano/composer'
2
+ require 'capistrano/file-permissions'
3
+ require 'capistrano/cakephp/cake'
4
+
5
+ namespace :load do
6
+ task :defaults do
7
+ load 'capistrano/cakephp/defaults.rb'
8
+ end
9
+ end
10
+
11
+ namespace :deploy do
12
+ after :updated, "cakephp:build"
13
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path("../../tasks/asset_compress.rake", __FILE__)
@@ -0,0 +1 @@
1
+ load File.expand_path("../../tasks/cake.rake", __FILE__)
@@ -0,0 +1,11 @@
1
+ set_if_empty :cakephp_roles, :all
2
+ set_if_empty :cakephp_flags, ''
3
+ set_if_empty :cakephp_user, :local_user
4
+
5
+ set_if_empty :linked_dirs, [
6
+ 'tmp/cache/models',
7
+ 'tmp/cache/persistent',
8
+ 'tmp/cache/views',
9
+ 'tmp/sessions',
10
+ 'tmp/tests'
11
+ ]
@@ -0,0 +1 @@
1
+ load File.expand_path("../../tasks/migrations.rake", __FILE__)
@@ -0,0 +1,25 @@
1
+ namespace :deploy do
2
+ namespace :assets do
3
+ desc <<-DESC
4
+ Builds the assets using markstory/asset_compress plugin
5
+ DESC
6
+ task :build do
7
+ invoke "cakephp:asset_compress", "build"
8
+ end
9
+
10
+ desc <<-DESC
11
+ Clears the assets created using markstory/asset_compress plugin
12
+ DESC
13
+ task :clear do
14
+ invoke "cakephp:asset_compress", "clear"
15
+ end
16
+ end
17
+
18
+ task :asset_compress, :command_name do |t, args|
19
+ # ask only runs if argument is not provided
20
+ ask(:cmd, "list")
21
+ command = args[:command_name] || fetch(:cmd)
22
+
23
+ invoke "cakephp:cake", "AssetCompress.asset_compress", command, *args.extras
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ namespace :cakephp do
2
+ desc <<-DESC
3
+ Executes a cake command
4
+ DESC
5
+ task :cake, :command_name do |t, args|
6
+ # ask only runs if argument is not provided
7
+ ask(:cmd, "list")
8
+ command = args[:command_name] || fetch(:cmd)
9
+
10
+ on roles fetch(:cakephp_roles) do
11
+ within release_path do
12
+ execute :php, :cake, command, *args.extras, fetch(:cakephp_cake_options)
13
+ end
14
+ end
15
+ end
16
+
17
+ task :build do
18
+ on roles fetch(:cakephp_roles) do
19
+ within release_path do
20
+ execute :composer, "install --no-dev"
21
+ end
22
+ end
23
+ end
24
+
25
+ end
@@ -0,0 +1,44 @@
1
+ namespace :deploy do
2
+ namespace :migrations do
3
+ desc <<-DESC
4
+ Migrates database using the cakephp/migrations plugin.
5
+
6
+ This is similar to running:
7
+
8
+ bin/cake Migrations.migrations migrate
9
+
10
+ For help:
11
+
12
+ cap cakephp:help[migrations]
13
+
14
+ DESC
15
+ task :migrate do
16
+ invoke "cakephp:migrations", "migrate"
17
+ end
18
+
19
+ desc <<-DESC
20
+ Rollback database using the cakephp/migrations plugin
21
+
22
+ This is similar to running:
23
+
24
+ bin/cake Migrations.migrations rollback
25
+
26
+ For help:
27
+
28
+ cap cakephp:help[migrations]
29
+
30
+ DESC
31
+ task :rollback do
32
+ invoke "cakephp:migrations", "rollback"
33
+ end
34
+ end
35
+
36
+ task :migrations, :command_name do |t, args|
37
+ # ask only runs if argument is not provided
38
+ ask(:cmd, "list")
39
+ command = args[:command_name] || fetch(:cmd)
40
+
41
+ invoke "cakephp:cake", "Migrations.migrations", command, *args.extras
42
+ end
43
+
44
+ end
metadata CHANGED
@@ -1,81 +1,147 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: capcake
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 2
7
- - 0
8
- - 3
9
- version: 2.0.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Jad Bitar
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2012-02-09 00:00:00 +02:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2014-12-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.0.0
23
+ type: :runtime
22
24
  prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: capistrano-composer
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
25
40
  - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 2
29
- - 5
30
- version: "2.5"
41
+ - !ruby/object:Gem::Version
42
+ version: 0.0.3
31
43
  type: :runtime
32
- version_requirements: *id001
33
- description: Deploy CakePHP applications using Capistrano
34
- email: jadbitar@mac.com
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 0.0.3
53
+ - !ruby/object:Gem::Dependency
54
+ name: capistrano-file-permissions
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 0.0.1
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 0.0.1
73
+ - !ruby/object:Gem::Dependency
74
+ name: bundler
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '1.3'
80
+ type: :development
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: '1.3'
87
+ - !ruby/object:Gem::Dependency
88
+ name: rake
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ type: :development
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - "~>"
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ description: CakePHP deployment for Capistrano 3.x
102
+ email:
103
+ - bitarjad@gmail.com
35
104
  executables: []
36
-
37
105
  extensions: []
38
-
39
- extra_rdoc_files:
106
+ extra_rdoc_files: []
107
+ files:
108
+ - ".gitignore"
109
+ - Gemfile
40
110
  - LICENSE
41
- - README.markdown
42
- files:
111
+ - README.md
112
+ - Rakefile
113
+ - capcake.gemspec
43
114
  - lib/capcake.rb
44
- - lib/templates/create_database.rsql
45
- - lib/templates/database.rphp
46
- - lib/templates/deploy.rb.default
47
- - lib/templates/maintenance.rhtml
48
- - LICENSE
49
- - README.markdown
50
- has_rdoc: true
51
- homepage: http://github.com/jadb/capcake
52
- licenses: []
53
-
115
+ - lib/capistrano/cakephp.rb
116
+ - lib/capistrano/cakephp/asset_compress.rb
117
+ - lib/capistrano/cakephp/cake.rb
118
+ - lib/capistrano/cakephp/defaults.rb
119
+ - lib/capistrano/cakephp/migrations.rb
120
+ - lib/capistrano/tasks/asset_compress.rake
121
+ - lib/capistrano/tasks/cake.rake
122
+ - lib/capistrano/tasks/migrations.rake
123
+ homepage: https://github.com/jadb/capcake
124
+ licenses:
125
+ - MIT
126
+ metadata: {}
54
127
  post_install_message:
55
128
  rdoc_options: []
56
-
57
- require_paths:
129
+ require_paths:
58
130
  - lib
59
- required_ruby_version: !ruby/object:Gem::Requirement
60
- requirements:
131
+ required_ruby_version: !ruby/object:Gem::Requirement
132
+ requirements:
61
133
  - - ">="
62
- - !ruby/object:Gem::Version
63
- segments:
64
- - 0
65
- version: "0"
66
- required_rubygems_version: !ruby/object:Gem::Requirement
67
- requirements:
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ required_rubygems_version: !ruby/object:Gem::Requirement
137
+ requirements:
68
138
  - - ">="
69
- - !ruby/object:Gem::Version
70
- segments:
71
- - 0
72
- version: "0"
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
73
141
  requirements: []
74
-
75
142
  rubyforge_project:
76
- rubygems_version: 1.3.6
143
+ rubygems_version: 2.2.2
77
144
  signing_key:
78
- specification_version: 3
79
- summary: Deploy CakePHP applications using Capistrano
145
+ specification_version: 4
146
+ summary: Native integration with popular CakePHP plugins (i.e. AssetCompress, Migrations)
80
147
  test_files: []
81
-
data/README.markdown DELETED
@@ -1,126 +0,0 @@
1
- # capcake ![Project status](http://stillmaintained.com/jadb/capcake.png)
2
-
3
- Looking to deploy a [CakePHP](http://cakephp.org) application you've built? Capcake extends [Capistrano](http://capify.org), removing the *rails-ism*, replacing them by more *cake-ish* ones.
4
-
5
- ## Installation
6
-
7
- If you don't have Capistrano and/or Capcake already installed (basically, just the 1st time):
8
-
9
- # gem install capistrano
10
- # gem install capcake -s http://gemcutter.org
11
-
12
- For every application you'll want to deploy:
13
-
14
- # cd /path/to/app && capify .
15
-
16
- This will create the following files in your project (don't forget to commit them!):
17
-
18
- capfile
19
- config/deploy.rb
20
-
21
- Prepend your config/deploy.rb with the following lines:
22
-
23
- require 'rubygems'
24
- require 'capcake'
25
-
26
- And make sure you start capcake on the last line of that same file:
27
-
28
- capcake
29
-
30
- You should then be able to proceed as you usually would. To familiarize yourself with the now modified list of tasks, you can get a full list with:
31
-
32
- $ cap -T
33
-
34
- ## Configuration
35
-
36
- Before continuing, some changes to config/deploy.rb are necessary. First, your project's name:
37
-
38
- set :application, "your_app_name"
39
-
40
- Next, setting up the Git repository (make sure it's accessible by both your local machine and server your are deploying to):
41
-
42
- set :repository, "git@domain.com:path/to/repo"
43
-
44
- Now, to deploy from Git, and by following [GitHub's suggestion](http://github.com/guides/deploying-with-capistrano) (they must know what they are talking about), add a user (defaults to *deployer* by capcake's recipe) to your server(s) just for deployments. In this example, I will be using SSH keys instead of getting a Git password prompt. Local user's SSH key must be added to *deployer*'s ~/.ssh/authorized_keys for this to work as described.
45
-
46
- ssh_options[:forward_agent] = true
47
-
48
- We need to tell it where to deploy, using what methods:
49
-
50
- server "www.domain.tld", :app, :db, :primary => true
51
-
52
- And finally, some CakePHP related settings (if omitted, Capcake will NOT handle deploying CakePHP):
53
-
54
- set :cake_branch, " "
55
-
56
- You can change the default values for the following variables also:
57
-
58
- set :cake_branch, "1.2"
59
- set :cake_path, "/path/to"
60
- set :user, "your_username"
61
- set :branch, "tag"
62
-
63
- Append the following lines to your .git/info/exclude file:
64
-
65
- .DS_Store
66
- tmp/*
67
-
68
- ## Alternative Easy Configuration
69
-
70
- Simply replace your deploy.rb configuration file with the one provided in the template directory, and change all variables on the lines that have comments with your values.
71
-
72
- This configuration file is meant to work with [Multiple Stages Without Multistage Extension](https://github.com/capistrano/capistrano/wiki/2.x-Multiple-Stages-Without-Multistage-Extension) so every cap command will have to contain the stage you want to deploy to. For instance:
73
-
74
- $ cap staging deploy:setup
75
- $ cap staging deploy
76
-
77
- ## Deployment
78
-
79
- The first time you are deploying, you need to run:
80
-
81
- # cap deploy:setup
82
-
83
- That should create on your server the following directory structure:
84
-
85
- [deploy_to]
86
- [deploy_to]/releases
87
- [deploy_to]/shared
88
- [deploy_to]/shared/cakephp
89
- [deploy_to]/shared/system
90
- [deploy_to]/shared/tmp
91
-
92
- Finally, deploy:
93
-
94
- # cap deploy
95
-
96
- Which will change the directory structure to become:
97
-
98
- [deploy_to]
99
- [deploy_to]/current -> [deploy_to]/releases/20091013001122
100
- [deploy_to]/releases
101
- [deploy_to]/releases/20091013001122
102
- [deploy_to]/releases/20091013001122/system -> [deploy_to]/shared/system
103
- [deploy_to]/releases/20091013001122/tmp -> [deploy_to]/shared/tmp
104
- [deploy_to]/shared
105
- [deploy_to]/shared/cakephp
106
- [deploy_to]/shared/system
107
- [deploy_to]/shared/tmp
108
-
109
- ## Credits
110
-
111
- * Jamis Buck ([Capistrano's](https://github.com/capistrano) original author)
112
- * [Jad Bitar](http://github.com/jadb) (capcake code)
113
- * [damusnet](https://github.com/damusnet) (capcake code)
114
- * [Michael Franze](http://github.com/franzem) (capcake wiki)
115
-
116
- ## Patches & Features
117
-
118
- * Fork
119
- * Mod, fix
120
- * Test - this is important, so it's not unintentionally broken
121
- * Commit - do not mess with license, todo, version, etc. (if you do change any, make them into commits of their own that I can ignore when I pull)
122
- * Pull request - bonus point for topic branches
123
-
124
- ## Bugs & Feedback
125
-
126
- http://github.com/jadb/capcake/issues