Skip to content

Commit 81693f6

Browse files
committed
capifony now leaves on RubyGems.com
1 parent dc03558 commit 81693f6

9 files changed

+139
-46
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
README
2+
*.gem

CHANGELOG

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
== 0.1.0 / June 3, 2010
2+
3+
First ever working version.

Capfile

-4
This file was deleted.

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2010 Konstantin Kudryashov <[email protected]>
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.

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ Capistrano is an open source tool for running scripts on multiple servers. It’
88
- Must have SSH access to the server you are deploying to.
99
- Must have Ruby and RubyGems installed on your machine (not required for deployment server)’
1010

11-
### Installing Capistrano ###
11+
### Installing Capifony ###
1212

13-
sudo gem install capistrano
13+
sudo gem install capifony
1414

15-
### Setup your project to use Capistrano ###
15+
### Setup your project to use Capifony ###
1616

17-
Place files & folders from this repository into appropriate folders in your project:
17+
CD to your project directory & run:
1818

19-
- `Capfile` &rarr; `/sf/proj/Capfile`
20-
- `config/capifony.rb` &rarr; `/sf/proj/config/capifony.rb`
21-
- `config/deploy.rb` &rarr; `/sf/proj/config/deploy.rb`
19+
capifony .
2220

23-
Fill up `/sf/proj/config/deploy.rb` with your server connection data (REQUIRED VARIABLES & SCM OPTIONS)
21+
This will create `Capfile` in your project root & `deploy.rb` config file in `config` directory
22+
23+
Fill up your `config/deploy.rb` with your server connection data
2424

2525
### Server Setup ###
2626

bin/capifony

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'optparse'
4+
require 'fileutils'
5+
6+
OptionParser.new do |opts|
7+
opts.banner = "Usage: #{File.basename($0)} [path]"
8+
9+
opts.on("-h", "--help", "Displays this help info") do
10+
puts opts
11+
exit 0
12+
end
13+
14+
begin
15+
opts.parse!(ARGV)
16+
rescue OptionParser::ParseError => e
17+
warn e.message
18+
puts opts
19+
exit 1
20+
end
21+
end
22+
23+
if ARGV.empty?
24+
abort "Please specify the directory to capifony, e.g. `#{File.basename($0)} .'"
25+
elsif !File.exists?(ARGV.first)
26+
abort "`#{ARGV.first}' does not exist."
27+
elsif !File.directory?(ARGV.first)
28+
abort "`#{ARGV.first}' is not a directory."
29+
elsif ARGV.length > 1
30+
abort "Too many arguments; please specify only the directory to capifony."
31+
end
32+
33+
def unindent(string)
34+
indentation = string[/\A\s*/]
35+
string.strip.gsub(/^#{indentation}/, "")
36+
end
37+
38+
files = {
39+
"Capfile" => unindent(<<-FILE),
40+
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
41+
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
42+
load Gem.required_location('capifony', 'capifony.rb')
43+
load 'config/deploy' # remove this line to skip loading any of the default tasks
44+
FILE
45+
46+
"config/deploy.rb" => 'set :application, "set your application name here"
47+
set :domain, "#{application}.com"
48+
set :deploy_to, "/path/to/www/#{domain}"
49+
50+
set :repository, "#{domain}:/reps/#{application}.git"
51+
set :scm, :git
52+
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, `subversion` or `none`
53+
54+
role :web, domain # Your HTTP server, Apache/etc
55+
role :app, domain # This may be the same as your `Web` server
56+
role :db, domain, :primary => true # This is where Rails migrations will run
57+
58+
set :keep_releases, 3'}
59+
60+
base = ARGV.shift
61+
files.each do |file, content|
62+
file = File.join(base, file)
63+
if File.exists?(file)
64+
warn "[skip] '#{file}' already exists"
65+
elsif File.exists?(file.downcase)
66+
warn "[skip] '#{file.downcase}' exists, which could conflict with `#{file}'"
67+
else
68+
unless File.exists?(File.dirname(file))
69+
puts "[add] making directory '#{File.dirname(file)}'"
70+
FileUtils.mkdir(File.dirname(file))
71+
end
72+
puts "[add] writing '#{file}'"
73+
File.open(file, "w") { |f| f.write(content) }
74+
end
75+
end
76+
77+
puts "[done] capifonied!"

capifony.gemspec

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Gem::Specification.new do |spec|
2+
3+
spec.name = 'capifony'
4+
spec.version = '0.1.0'
5+
spec.platform = Gem::Platform::RUBY
6+
spec.description = <<-DESC
7+
Capistrano is an open source tool for running scripts on multiple servers. It’s primary use is for easily deploying applications. While it was built specifically for deploying Rails apps, it’s pretty simple to customize it to deploy other types of applications. This package is a deployment “recipe” to work with symfony PHP applications.
8+
DESC
9+
spec.summary = <<-DESC.strip.gsub(/\n\s+/, " ")
10+
Deploying symfony PHP applications with Capistrano.
11+
DESC
12+
13+
spec.files = Dir.glob("{bin,lib}/**/*") + %w(README LICENSE CHANGELOG)
14+
spec.require_path = 'lib'
15+
spec.has_rdoc = false
16+
17+
spec.bindir = "bin"
18+
spec.executables << "capifony"
19+
20+
spec.add_dependency 'capistrano', ">= 2.5.10"
21+
22+
spec.author = "Konstantin Kudryashov"
23+
spec.email = "[email protected]"
24+
spec.homepage = "http://everzet.com/projects/symfony-helpers/capifony"
25+
spec.rubyforge_project = "capifony"
26+
27+
end

config/deploy.rb

-34
This file was deleted.

config/capifony.rb lib/capifony.rb

File renamed without changes.

0 commit comments

Comments
 (0)