kcapifony 2.1.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of kcapifony might be problematic. Click here for more details.

data/CHANGELOG ADDED
@@ -0,0 +1,118 @@
1
+ == 2.1.3 / September 27, 2011
2
+
3
+ * propel support for Symfony2 (by @willdurand)
4
+ * cache warmup and assets install configurable (by @gigo6000)
5
+ * always use --no-debug with assetic (by @fernanDOTdo)
6
+ * fixed assetic bug (by @mbontemps)
7
+
8
+ == 2.1.2 / August 11, 2011
9
+
10
+ * fix for vendors install
11
+
12
+ == 2.1.1 / July 13, 2011
13
+
14
+ * support for rubygems 1.8
15
+
16
+ == 2.1.0 / June 24, 2011
17
+
18
+ * fully support different app path
19
+
20
+ == 2.0.9 / June 15, 2011
21
+
22
+ * migrations fixed in Symfony2
23
+
24
+ == 2.0.8 / June 14, 2011
25
+
26
+ * update_vendors functionality support (via @weaverryan)
27
+
28
+ == 2.0.7 / June 9, 2011
29
+
30
+ * more modular behavior (thanks Alif Rachmawadi)
31
+ * cache:clear command fix (thanks Marijn Huizendveld)
32
+
33
+ == 2.0.6 / May 4, 2011
34
+
35
+ * add write access to cache folder for deployer's usergroup
36
+
37
+ == 2.0.5 / May 3, 2011
38
+
39
+ * made the Symfony2 console command configurable (symfony_console) (thanks @ruudk)
40
+ * added --env=#{symfony_env_prod} to every Symfony2 console command (thanks @ruudk)
41
+
42
+ == 2.0.4 / April 23, 2011
43
+
44
+ * shared lib support in symfony1 (thanks @jakzal)
45
+
46
+ == 2.0.3 / April 16, 2011
47
+
48
+ * windows support for symfony1 database: tasks (thanks @akloboucnik)
49
+
50
+ == 2.0.2 / April 6, 2011
51
+
52
+ * db migration task refactoring (thanks @schmittjoh)
53
+
54
+ == 2.0.1 / March 30, 2011
55
+
56
+ * fixed wrong assetic command
57
+
58
+ == 2.0.0 / March 22, 2011
59
+
60
+ * optimized shared commands in symfony1 scripts
61
+ * added symfony2 deployment strategy
62
+ * added `use_orm` option to symfony1 recipes. Turn it off if you don't use ORM
63
+
64
+ == 0.4.2 / September 23, 2010
65
+
66
+ * added `symfony:doctrine:compile` task
67
+
68
+ == 0.4.1 / June 17, 2010
69
+
70
+ * added `symfony_env_local` variable, specifying local symfony environment to work with
71
+ * added third parameter (blocks) to `prompt_with_default` (as in `ask`)
72
+ * hided password from input & logs in `symfony:configure:database` task
73
+ * added confirmation dialogs to destructive ORM tasks
74
+ * run `project:clear-controllers` only on `prod` environment
75
+
76
+ == 0.4.0 / June 16, 2010
77
+
78
+ * added propel tasks (thanks to http://github.com/arlo)
79
+ * added orm abstraction
80
+ * added doctrine/symfony tasks
81
+ * huge refactoring of mostly everything (thanks to http://github.com/arlo)
82
+
83
+ == 0.3.3 / June 13, 2010
84
+
85
+ * added ability to change called php binary (thanks to http://github.com/xgorse)
86
+
87
+ == 0.3.2 / June 12, 2010
88
+
89
+ * fixed :finalize_update hooks (clear_controllers task now runs)
90
+
91
+ == 0.3.1 / June 11, 2010
92
+
93
+ * fixed deployment bug with new shared link instruction
94
+
95
+ == 0.3.0 / June 11, 2010
96
+
97
+ * fixed incorrect links bug (thanks to arlo)
98
+ * added database dumpers tasks
99
+ * database:move:* now uses database dumpers to actually dump
100
+
101
+ == 0.2.2 / June 6, 2010
102
+
103
+ * deployment bug with `mkdir shared/config` fixed
104
+
105
+ == 0.2.1 / June 5, 2010
106
+
107
+ * dependency fix
108
+
109
+ == 0.2.0 / June 5, 2010
110
+
111
+ * some fixes
112
+ * symfony:check_configuration task
113
+ * database move tasks
114
+ * shared folder tasks (move to_local, move to_remote)
115
+
116
+ == 0.1.0 / June 3, 2010
117
+
118
+ First ever working version.
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2010 Konstantin Kudryashov <ever.zet@gmail.com>
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # Capifony
2
+
3
+ This is a forked version of the original [Capifony][capifony] which makes it work with the server setup at [Kunstmaan][kunstmaan]. You can install this using the gem install kCapifony command.
4
+ The following things are changed:
5
+
6
+ * Every command is using try_sudo in stead of the regular run command. This way we can define the admin_runner in the [Capistrano][capistrano] deployment config and every [Capifony][capifony] command will be ran as this user.
7
+ * Added some extra commands:
8
+ * load:fixtures
9
+ * schema:update
10
+ * Changed the flow after deploy finalize update a bit.
11
+
12
+ # Prerequisites
13
+
14
+ * SSH access to the server you are deploying to
15
+ * Must have a working [Ruby][ruby] and [RubyGems][rubygems] installed on your local machine
16
+ * When you still need to install [Ruby][ruby], take a look at [Ruby Version Manager][rvm], which makes installing ruby super easy!
17
+
18
+ # Installing [Capifony][capifony]
19
+
20
+ * Download the Gem file from the [downloads page on Github](https://github.com/Kunstmaan/capifony/downloads).
21
+ * Install the Gem
22
+
23
+ ```bash
24
+ gem install capifony-2.1.3.gem
25
+ ```
26
+
27
+ # Configuring your project
28
+
29
+ ```bash
30
+ cd to/your/project/path
31
+ capifony .
32
+ ```
33
+
34
+ [capistrano]: https://github.com/capistrano/capistrano "Capistrano"
35
+ [ruby]: http://www.ruby-lang.org/ "Ruby"
36
+ [rubygems]: http://rubygems.org/ "RubyGems"
37
+ [rvm]: http://beginrescueend.com/ "Ruby Version Manager"
38
+ [symfony]: http://symfony.com/ "Symfony"
39
+ [capifony]: https://github.com/everzet/capifony "Capifony"
40
+ [kunstmaan]: http://www.kunstmaan.be "Kunstmaan"
data/bin/kcapifony ADDED
@@ -0,0 +1,122 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'fileutils'
5
+
6
+ symfony_version = nil
7
+ symfony_app_path = 'app'
8
+
9
+ OptionParser.new do |opts|
10
+ opts.banner = "Usage: #{File.basename($0)} [path]"
11
+
12
+ opts.on("-h", "--help", "Displays this help info") do
13
+ puts opts
14
+ exit 0
15
+ end
16
+
17
+ opts.on("-s", "--symfony VERSION", "Capify specific symfony verion (1|2)") do |version|
18
+ symfony_version = version.to_i
19
+ end
20
+
21
+ opts.on("-p", "--app NAME", "Specify app name (folder) to capify") do |path|
22
+ symfony_app_path = path
23
+ end
24
+
25
+ begin
26
+ opts.parse!(ARGV)
27
+ rescue OptionParser::ParseError => e
28
+ warn e.message
29
+ puts opts
30
+ exit 1
31
+ end
32
+ end
33
+
34
+ if ARGV.empty?
35
+ abort "Please specify the directory to capifony, e.g. `#{File.basename($0)} .'"
36
+ elsif !File.exists?(ARGV.first)
37
+ abort "`#{ARGV.first}' does not exist."
38
+ elsif !File.directory?(ARGV.first)
39
+ abort "`#{ARGV.first}' is not a directory."
40
+ elsif ARGV.length > 1
41
+ abort "Too many arguments; please specify only the directory to capify."
42
+ end
43
+
44
+ def unindent(string)
45
+ indentation = string[/\A\s*/]
46
+ string.strip.gsub(/^#{indentation}/, "")
47
+ end
48
+
49
+ base = ARGV.shift
50
+ symfony_version = symfony_version || ((File.directory? File.join(base, 'config')) ? 1 : 2)
51
+
52
+ if symfony_version == 2
53
+ files = {
54
+ "Capfile" => unindent(<<-FILE),
55
+ load 'deploy' if respond_to?(:namespace) # cap2 differentiator
56
+ Dir['vendor/bundles/*/*/recipes/*.rb'].each { |bundle| load(bundle) }
57
+ load Gem.find_files('ksymfony2.rb').last.to_s
58
+ load '#{symfony_app_path}/config/deploy'
59
+ FILE
60
+
61
+ "#{symfony_app_path}/config/deploy.rb" => unindent(<<-FILE)
62
+ set :application, "set your application name here"
63
+ set :domain, "\#{application}.com"
64
+ set :deploy_to, "/var/www/\#{domain}"
65
+ set :app_path, "#{symfony_app_path}"
66
+
67
+ set :repository, "\#{domain}:/var/repos/\#{application}.git"
68
+ set :scm, :git
69
+ # Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, `subversion` or `none`
70
+
71
+ set :model_manager, "doctrine"
72
+ # Or: `propel`
73
+
74
+ role :web, domain # Your HTTP server, Apache/etc
75
+ role :app, domain # This may be the same as your `Web` server
76
+ role :db, domain, :primary => true # This is where Rails migrations will run
77
+
78
+ set :keep_releases, 3
79
+ FILE
80
+ }
81
+ else
82
+ files = {
83
+ "Capfile" => unindent(<<-FILE),
84
+ load 'deploy' if respond_to?(:namespace) # cap2 differentiator
85
+ Dir['plugins/*/lib/recipes/*.rb'].each { |plugin| load(plugin) }
86
+ load Gem.find_files('ksymfony1.rb').last.to_s
87
+ load 'config/deploy'
88
+ FILE
89
+
90
+ "config/deploy.rb" => 'set :application, "set your application name here"
91
+ set :domain, "#{application}.com"
92
+ set :deploy_to, "/var/www/#{domain}"
93
+
94
+ set :repository, "#{domain}:/var/repos/#{application}.git"
95
+ set :scm, :git
96
+ # Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, `subversion` or `none`
97
+
98
+ role :web, domain # Your HTTP server, Apache/etc
99
+ role :app, domain # This may be the same as your `Web` server
100
+ role :db, domain, :primary => true # This is where Rails migrations will run
101
+
102
+ set :keep_releases, 3'
103
+ }
104
+ end
105
+
106
+ files.each do |file, content|
107
+ file = File.join(base, file)
108
+ if File.exists?(file)
109
+ warn "[skip] '#{file}' already exists"
110
+ elsif File.exists?(file.downcase)
111
+ warn "[skip] '#{file.downcase}' exists, which could conflict with `#{file}'"
112
+ else
113
+ unless File.exists?(File.dirname(file))
114
+ puts "[add] making directory '#{File.dirname(file)}'"
115
+ FileUtils.mkdir(File.dirname(file))
116
+ end
117
+ puts "[add] writing '#{file}'"
118
+ File.open(file, "w") { |f| f.write(content) }
119
+ end
120
+ end
121
+
122
+ puts "[done] Symfony#{symfony_version.to_s} project kCapifonied!"
data/lib/kcapifony.rb ADDED
@@ -0,0 +1,26 @@
1
+ # Symfony environment on local
2
+ set :symfony_env_local, "dev"
3
+
4
+ # Symfony environment
5
+ set :symfony_env_prod, "prod"
6
+
7
+ # PHP binary to execute
8
+ set :php_bin, "php"
9
+
10
+ def prompt_with_default(var, default, &block)
11
+ set(var) do
12
+ Capistrano::CLI.ui.ask("#{var} [#{default}] : ", &block)
13
+ end
14
+ set var, default if eval("#{var.to_s}.empty?")
15
+ end
16
+
17
+ namespace :deploy do
18
+ desc "Overwrite the start task because symfony doesn't need it."
19
+ task :start do ; end
20
+
21
+ desc "Overwrite the restart task because symfony doesn't need it."
22
+ task :restart do ; end
23
+
24
+ desc "Overwrite the stop task because symfony doesn't need it."
25
+ task :stop do ; end
26
+ end