derpy 1.0.0 → 1.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- data.tar.gz: 58f7a8c72bc4157d3d23022069ad0c3898e7ec63
4
- metadata.gz: a2b754b92c8b0696f040d13373eb65df68d97ed0
3
+ data.tar.gz: c434bd0c43b8d11277912b876606c268a5beca25
4
+ metadata.gz: f1dcdb795886b186e9703296792816a5fa0975fa
5
5
  SHA512:
6
- data.tar.gz: 267d501f86e3e75f348d690e8fe17637cfacf03b896788f2416da4100cdb2ac7478410ee7d265eaefdb824827f3909d981cb3df0b6dfe7e9af480a2ad62a2a2e
7
- metadata.gz: fe5994238bed6c115e306d90561f20b2646aaf1fa17daad159d7c87555fe22c706e4978e4cbb3316f8a7e247d8e235a1b8ff041450401b29af757a6d9724dc68
6
+ data.tar.gz: af3b82e839d34a6f08ab66b8ddc6d7d107ef76f105da7f80524b961cc1f933ff1cb0ef677295166cdca97cd6326586e7d8b69119608faf539857330e5137859a
7
+ metadata.gz: 9c98f87dd96b5e9b072491254e12369ee021e19682fb0efe1fea3c3194832fbbd438601bac5f4bc894ae8116ce99566a4d616e97782172fb3134f84fa7299f2f
data/README.markdown CHANGED
@@ -1,9 +1,17 @@
1
1
  # Derpy
2
2
 
3
- This gem provides a number of tasks which are useful for deploying Drupal projects with [Capistrano](https://github.com/capistrano/capistrano).
3
+ This gem provides a number of tasks which are useful for deploying Drupal projects with [Capistrano](https://github.com/capistrano/capistrano).
4
4
 
5
+ ## Derpy features
6
+
7
+ * deploy Drupal project from scratch
8
+ * update Drupal project with the latest code
9
+ * pull/push databases
10
+ * pull/push files
11
+ * NO support for Drupal multi-site configurations!
5
12
 
6
13
  ## Installation
14
+
7
15
  [gems](http://rubygems.org) must be installed on your system first.
8
16
 
9
17
  ### From RubyGems.org
@@ -15,4 +23,71 @@ This gem provides a number of tasks which are useful for deploying Drupal projec
15
23
  $ git clone git://github.com/3sign/derpy.git
16
24
  $ cd derpy
17
25
  $ gem build derpy.gemspec
18
- $ gem install derpy-{version}.gem
26
+ $ gem install derpy-{version}.gem
27
+
28
+ ## Configuration
29
+
30
+ ### Derpify
31
+
32
+ The command "derpify" will setup the necessary configuration files for a new Drupal project. You can alter these config files to suit your needs.
33
+ Beware that some of these settings are specific to 3SIGN's workflow.
34
+
35
+ $ derpify .
36
+
37
+ [add] writing './Capfile'
38
+ [add] making directory './config'
39
+ [add] writing './config/deploy.rb'
40
+ [add] making directory './config/deploy'
41
+ [add] writing './config/deploy/staging.rb'
42
+ [add] writing './config/deploy/production.rb'
43
+ [done] derpified!
44
+
45
+ After editing your config files just run: "derpy deploy:cold" to setup from scratch.
46
+ After that you can do incremental updates with: "derpy deploy"
47
+
48
+ ### Derpy
49
+
50
+ The command "derpy" is an alias that calls the required Capistrano task, just to be fancy.
51
+ Specify the "-T" parameter to get a list of all available tasks.
52
+
53
+ $ derpy -T
54
+
55
+ cap deploy # Deploys your Drupal site, runs drush:update.
56
+ cap deploy:check # Test deployment dependencies.
57
+ cap deploy:cleanup # Removes old releases and corresponding DB backups.
58
+ cap deploy:cold # Setup a drupal site from scratch
59
+ cap deploy:create_symlink # Updates the symlink to the most recently deployed...
60
+ cap deploy:pending # Displays the commits since your last deploy.
61
+ cap deploy:pending:diff # Displays the `diff' since your last deploy.
62
+ cap deploy:rollback # Go back to the previous release (code and database)
63
+ cap deploy:rollback:code # Rolls back to the previously deployed version.
64
+ cap deploy:setup # Prepares one or more servers for deployment.
65
+ cap deploy:symlink # Deprecated API.
66
+ cap deploy:update # Copies your project and updates the symlink.
67
+ cap deploy:update_code # Copies your project to the remote servers.
68
+ cap deploy:upload # Copy files to the currently deployed version.
69
+ cap drush:backupdb # Backup the database
70
+ cap drush:cache_clear # Clear the drupal cache
71
+ cap drush:feature_revert # Revert feature
72
+ cap drush:get # Gets drush and installs it
73
+ cap drush:site_offline # Set the site offline
74
+ cap drush:site_online # Set the site online
75
+ cap drush:updatedb # Run Drupal database migrations if required
76
+ cap files:pull # Pull drupal sites files (from remote to local)
77
+ cap files:push # Push drupal sites files (from local to remote)
78
+ cap git:push_deploy_tag # Place release tag into Git and push it to origin ...
79
+ cap invoke # Invoke a single command on the remote servers.
80
+ cap manage:block_robots # Block bots via robots.txt
81
+ cap manage:pull_dump # Dump remote database and restore locally
82
+ cap manage:push_dump # Dump local database and restore remote
83
+ cap multistage:prepare # Stub out the staging config files.
84
+ cap production # Set the target stage to `production'.
85
+ cap shell # Begin an interactive Capistrano session.
86
+ cap staging # Set the target stage to `staging'.
87
+
88
+
89
+ ## Credits
90
+
91
+ Inspired by [capdrupal](https://github.com/antistatique/capdrupal) and [didi](https://github.com/koenvw/didi).
92
+
93
+ Made by [3SIGN](http://www.3sign.com).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.1
data/bin/derpify ADDED
@@ -0,0 +1,129 @@
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 derpify, 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 didify."
31
+ end
32
+
33
+ def unindent(string)
34
+ indentation = string[/\A\s*/]
35
+ string.strip.gsub(/^#{indentation}/, "")
36
+ end
37
+
38
+ dirname = File.basename(File.expand_path(ARGV[0]))
39
+
40
+ files = {
41
+ "Capfile" => unindent(<<-FILE),
42
+ require 'rubygems'
43
+ require 'derpy'
44
+ load 'config/deploy'
45
+ FILE
46
+
47
+ "config/deploy.rb" => 'set :stages, %w(staging production)
48
+ set :default_stage, "staging"
49
+ require "capistrano/ext/multistage"
50
+
51
+ set :application, "' + dirname + '"
52
+ set :repository, "git@git.3sign.com:git/' + dirname + '/' + dirname + '.git"
53
+ ',
54
+ "config/deploy/staging.rb" => '# SERVER
55
+ set :user, "staging"
56
+ set :runner_group, "staging"
57
+ server "rd", :app, :web, :db, :primary => true
58
+
59
+ # APP
60
+ set :app_path, ""
61
+ set :domain, "default"
62
+ set :deploy_to, "/home/staging/public_html/' + dirname + '/"
63
+
64
+ # GIT
65
+ set :branch, "master"
66
+
67
+ # STAGE DB
68
+ set :db_type, "mysql"
69
+ set :db_name, "staging_' + dirname + '"
70
+ set :db_username, "staging_' + dirname + '"
71
+ set :db_password, "####"
72
+ set :db_host, "localhost"
73
+
74
+ # LOCAL DB
75
+ set :local_database, "' + dirname + '" # optional, used with manage:pull_dump
76
+ set :push_dump_enabled, true # optional, enables manage:push_dump (dangerous)
77
+
78
+ after "deploy:update", "deploy:cleanup"
79
+ ',
80
+ "config/deploy/production.rb" => '# SERVER
81
+ set :user, "' + dirname + '"
82
+ set :runner_group, "' + dirname + '"
83
+ server "rd", :app, :web, :db, :primary => true
84
+
85
+ # APP
86
+ set :app_path, ""
87
+ set :domain, "default"
88
+ set :deploy_to, "/home/' + dirname + '/public_html/"
89
+
90
+ # GIT
91
+ set :branch, "master"
92
+
93
+ # PRODUCTION DB
94
+ set :db_type, "mysql"
95
+ set :db_name, "' + dirname + '_db"
96
+ set :db_username, "' + dirname + '_usr"
97
+ set :db_password, "####"
98
+ set :db_host, "localhost"
99
+
100
+ # LOCAL DB
101
+ set :local_database, "' + dirname + '" # optional, used with manage:pull_dump
102
+ set :push_dump_enabled, true # optional, enables manage:push_dump (dangerous)
103
+
104
+ after "deploy:update", "deploy:cleanup"
105
+ '
106
+ }
107
+
108
+ base = ARGV.shift
109
+ files.each do |file, content|
110
+ file = File.join(base, file)
111
+ if File.exists?(file)
112
+ warn "[skip] '#{file}' already exists"
113
+ elsif File.exists?(file.downcase)
114
+ warn "[skip] '#{file.downcase}' exists, which could conflict with `#{file}'"
115
+ else
116
+ unless File.exists?(File.dirname(file))
117
+ puts "[add] making directory '#{File.dirname(file)}'"
118
+ FileUtils.mkdir_p(File.dirname(file))
119
+ end
120
+ puts "[add] writing '#{file}'"
121
+ File.open(file, "w") { |f| f.write(content) }
122
+ end
123
+ end
124
+
125
+ puts "[done] derpified!"
126
+
127
+ puts ""
128
+ puts 'After editing your config files just run: "derpy deploy:cold" to setup from scratch.'
129
+ puts 'After that you can do incremental updates with: "derpy deploy"'
data/bin/derpy ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'capistrano/cli'
4
+ Capistrano::CLI.execute
data/derpy.gemspec CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'derpy'
5
- s.version = '1.0.0'
5
+ s.version = '1.1.1'
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.description = <<-DESC
8
- A set of tasks for deploying Drupal projects with Capistrano and the help of Drush.
8
+ Derpy contains a set of tasks for deploying Drupal projects with Capistrano.
9
9
  DESC
10
- s.summary = 'A set of tasks for deploying Drupal projects with Capistrano'
10
+ s.summary = 'Deploying Drupal projects with Capistrano'
11
11
 
12
12
  s.extra_rdoc_files = [
13
13
  "README.markdown"
@@ -16,8 +16,11 @@ Gem::Specification.new do |s|
16
16
  "README.markdown",
17
17
  "VERSION",
18
18
  "derpy.gemspec",
19
+ "bin/derpify",
20
+ "bin/derpy",
19
21
  "lib/derpy.rb"
20
22
  ]
23
+ s.executables = ["derpify", "derpy"]
21
24
  s.require_path = 'lib'
22
25
 
23
26
  s.add_dependency 'capistrano', ">= 2.13.5","<= 2.15.4"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: derpy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin De Langhe
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2014-03-17 00:00:00 Z
12
+ date: 2014-03-19 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -34,10 +34,11 @@ dependencies:
34
34
  version: 1.1.2
35
35
  type: :runtime
36
36
  version_requirements: *id002
37
- description: " A set of tasks for deploying Drupal projects with Capistrano and the help of Drush.\n"
37
+ description: " Derpy contains a set of tasks for deploying Drupal projects with Capistrano.\n"
38
38
  email: robin@3sign.com
39
- executables: []
40
-
39
+ executables:
40
+ - derpify
41
+ - derpy
41
42
  extensions: []
42
43
 
43
44
  extra_rdoc_files:
@@ -46,6 +47,8 @@ files:
46
47
  - README.markdown
47
48
  - VERSION
48
49
  - derpy.gemspec
50
+ - bin/derpify
51
+ - bin/derpy
49
52
  - lib/derpy.rb
50
53
  homepage: http://github.com/3sign/derpy/
51
54
  licenses: []
@@ -72,6 +75,6 @@ rubyforge_project:
72
75
  rubygems_version: 2.0.4
73
76
  signing_key:
74
77
  specification_version: 4
75
- summary: A set of tasks for deploying Drupal projects with Capistrano
78
+ summary: Deploying Drupal projects with Capistrano
76
79
  test_files: []
77
80