sumodev_deploy 0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,50 @@
1
+ configuration = Capistrano::Configuration.respond_to?(:instance) ? Capistrano::Configuration.instance(:must_exist) : Capistrano.configuration(:must_exist)
2
+
3
+ configuration.load do
4
+ def stop(msg)
5
+ puts "\nStopped! \n\treason: #{msg}"
6
+ exit 1
7
+ end
8
+
9
+ def client
10
+ self[:client] || stop("sumodev_deploy requires that you set client and project names in your capfile")
11
+ end
12
+
13
+ def project
14
+ self[:project] || stop("sumodev_deploy requires that you set client and project names in your capfile")
15
+ end
16
+
17
+ def db_name
18
+ fetch(:db_name) { "#{client[0,8]}_#{project[0,7]}"}
19
+ end
20
+
21
+ set :user, 'sites'
22
+ set :application, project
23
+ set :deploy_to,"/home/sites/apps/#{client}/#{application}"
24
+ set :document_root, "/home/sites/#{client}/#{application}"
25
+
26
+ server 'dev.sumocoders.eu', :app, :web, :db, :primary => true
27
+
28
+ namespace :sumodev do
29
+ namespace :db do
30
+ desc "Create the database. Reads :db_name variable, or it is composed from client / project"
31
+ task :create, :roles => :db do
32
+ run "create_db #{db_name}"
33
+ end
34
+
35
+ desc "Get database info"
36
+ task :info, :roles => :db do
37
+ run "info_db #{db_name}"
38
+ end
39
+ end
40
+
41
+ namespace :setup do
42
+ desc "Create the client folder if it doesn't exist yet"
43
+ task :client_folder do
44
+ run "mkdir -p `dirname #{document_root}`"
45
+ end
46
+ end
47
+ end
48
+
49
+ before 'deploy:setup', 'sumodev:setup:client_folder'
50
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "sumodev_deploy"
5
+ s.version = "0.1"
6
+
7
+ s.authors = ["Jan De Poorter"]
8
+ s.date = "2012-04-18"
9
+ s.description = "Deploy to Sumocoders Dev server"
10
+ s.summary = "Deployment for Fork 3.x.x with Capistrano"
11
+ s.email = "info@sumocoders.be"
12
+ # s.extra_rdoc_files = [
13
+ # ]
14
+ s.files = [
15
+ "sumodev_deploy.gemspec",
16
+ "lib/sumodev_deploy.rb",
17
+ ]
18
+ s.homepage = "https://github.com/sumocoders/sumodev_deploy"
19
+ s.require_paths = ["lib"]
20
+ end
21
+
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sumodev_deploy
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jan De Poorter
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-04-18 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Deploy to Sumocoders Dev server
15
+ email: info@sumocoders.be
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - sumodev_deploy.gemspec
21
+ - lib/sumodev_deploy.rb
22
+ homepage: https://github.com/sumocoders/sumodev_deploy
23
+ licenses: []
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 1.8.15
43
+ signing_key:
44
+ specification_version: 3
45
+ summary: Deployment for Fork 3.x.x with Capistrano
46
+ test_files: []