derpy 1.1.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +5 -1
- data/VERSION +1 -1
- data/bin/derpify +5 -47
- data/bin/derpy +84 -1
- data/derpy.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
data.tar.gz:
|
4
|
-
metadata.gz:
|
3
|
+
data.tar.gz: d9077f8b38d3981e7a637cf797e43e2fa3493fd6
|
4
|
+
metadata.gz: 4a158887e27a8c5514f1e94d6e8340764f6f69aa
|
5
5
|
SHA512:
|
6
|
-
data.tar.gz:
|
7
|
-
metadata.gz:
|
6
|
+
data.tar.gz: 6b888e3ed41adef70f3902f71685cfa2b1a9c4c16563c9808b041a720aeab2589a258c21f4066af2477e95fb258699c3b72805dd53a61c2bdabc8b20c3d88536
|
7
|
+
metadata.gz: d49579647e102794960c4ff233d69c10e944b4a847bcd8be4e64b628e19e47743a6191d6594c1d5e7acc74fac2432999f1b7e4898720ff1e46e652e05ff16d95
|
data/README.markdown
CHANGED
@@ -47,7 +47,11 @@ After that you can do incremental updates with: "derpy deploy"
|
|
47
47
|
|
48
48
|
### Derpy
|
49
49
|
|
50
|
-
The command "derpy"
|
50
|
+
The command "derpy build" can be used to install a new Drupal site with the 3SIGN makefile and profile.
|
51
|
+
|
52
|
+
$ derpy build [sitename]
|
53
|
+
|
54
|
+
All other arguments for "derpy" are aliases that call the required Capistrano tasks, just to be fancy.
|
51
55
|
Specify the "-T" parameter to get a list of all available tasks.
|
52
56
|
|
53
57
|
$ derpy -T
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0
|
data/bin/derpify
CHANGED
@@ -36,6 +36,7 @@ def unindent(string)
|
|
36
36
|
end
|
37
37
|
|
38
38
|
dirname = File.basename(File.expand_path(ARGV[0]))
|
39
|
+
source = File.expand_path(File.dirname(__FILE__)) + "/../templates/"
|
39
40
|
|
40
41
|
files = {
|
41
42
|
"Capfile" => unindent(<<-FILE),
|
@@ -44,52 +45,9 @@ files = {
|
|
44
45
|
load 'config/deploy'
|
45
46
|
FILE
|
46
47
|
|
47
|
-
"config/deploy.rb" =>
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
set :application, "' + dirname + '"
|
52
|
-
set :local_database, "' + dirname + '" # optional, used with manage:pull_dump
|
53
|
-
set :repository, "git@git.3sign.com:git/' + dirname + '/' + dirname + '.git"
|
54
|
-
',
|
55
|
-
"config/deploy/staging.rb" => '# SERVER
|
56
|
-
set :user, "staging"
|
57
|
-
set :runner_group, "staging"
|
58
|
-
set :deploy_to, "/home/staging/public_html/' + dirname + '/"
|
59
|
-
server "rd", :app, :web, :db, :primary => true
|
60
|
-
|
61
|
-
# GIT
|
62
|
-
set :branch, "master"
|
63
|
-
|
64
|
-
# STAGING DB
|
65
|
-
set :db_type, "mysql"
|
66
|
-
set :db_name, "staging_' + dirname + '"
|
67
|
-
set :db_username, "staging_' + dirname + '"
|
68
|
-
set :db_password, "####"
|
69
|
-
set :db_host, "localhost"
|
70
|
-
set :push_dump_enabled, true # optional, enables manage:push_dump (dangerous)
|
71
|
-
|
72
|
-
after "deploy:update", "deploy:cleanup"
|
73
|
-
',
|
74
|
-
"config/deploy/production.rb" => '# SERVER
|
75
|
-
set :user, "' + dirname + '"
|
76
|
-
set :runner_group, "' + dirname + '"
|
77
|
-
set :deploy_to, "/home/' + dirname + '/public_html/"
|
78
|
-
server "rd", :app, :web, :db, :primary => true
|
79
|
-
|
80
|
-
# GIT
|
81
|
-
set :branch, "master"
|
82
|
-
|
83
|
-
# PRODUCTION DB
|
84
|
-
set :db_type, "mysql"
|
85
|
-
set :db_name, "' + dirname + '_db"
|
86
|
-
set :db_username, "' + dirname + '_usr"
|
87
|
-
set :db_password, "####"
|
88
|
-
set :db_host, "localhost"
|
89
|
-
set :push_dump_enabled, true # optional, enables manage:push_dump (dangerous)
|
90
|
-
|
91
|
-
after "deploy:update", "deploy:cleanup"
|
92
|
-
'
|
48
|
+
"config/deploy.rb" => File.read(source + "deploy.rb").gsub('[sitename]',dirname),
|
49
|
+
"config/deploy/staging.rb" => File.read(source + "staging.rb").gsub('[sitename]',dirname),
|
50
|
+
"config/deploy/production.rb" => File.read(source + "production.rb").gsub('[sitename]',dirname)
|
93
51
|
}
|
94
52
|
|
95
53
|
base = ARGV.shift
|
@@ -113,4 +71,4 @@ puts "[done] derpified!"
|
|
113
71
|
|
114
72
|
puts ""
|
115
73
|
puts 'After editing your config files just run: "derpy deploy:cold" to setup from scratch.'
|
116
|
-
puts 'After that you can do incremental updates with: "derpy deploy"'
|
74
|
+
puts 'After that you can do incremental updates with: "derpy deploy".'
|
data/bin/derpy
CHANGED
@@ -1,4 +1,87 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'capistrano/cli'
|
4
|
-
|
4
|
+
require 'fileutils'
|
5
|
+
|
6
|
+
def derpy_capistrano
|
7
|
+
Capistrano::CLI.execute
|
8
|
+
end
|
9
|
+
|
10
|
+
def derpy_install
|
11
|
+
# make sure the user provided a target directory
|
12
|
+
if ARGV.length == 1
|
13
|
+
abort "Please specify the target directory."
|
14
|
+
# make sure the user didn't provide too many arguments
|
15
|
+
elsif ARGV.length > 2
|
16
|
+
abort "Too many arguments; please specify only the target directory."
|
17
|
+
end
|
18
|
+
|
19
|
+
# set the target directory
|
20
|
+
site_target_dir = ARGV[1]
|
21
|
+
|
22
|
+
# check if the target directory exists
|
23
|
+
if Dir.exists?(site_target_dir)
|
24
|
+
abort "Error: The target directory already exists."
|
25
|
+
end
|
26
|
+
|
27
|
+
# make remote repos
|
28
|
+
system('ssh git@git.3sign.com "cd git; mkdir [sitename] [sitename]/[sitename].git; cd [sitename]/[sitename].git; git --bare init;"'.gsub('[sitename]',site_target_dir))
|
29
|
+
|
30
|
+
# fetch and execute the drush make file
|
31
|
+
system('git clone git@github.com:3sign/threesign-standard-makefile.git')
|
32
|
+
system('drush make threesign-standard-makefile/threesign.make ' + site_target_dir)
|
33
|
+
|
34
|
+
# remove the drush make file
|
35
|
+
FileUtils.rm_rf 'threesign-standard-makefile'
|
36
|
+
|
37
|
+
Dir.chdir(site_target_dir) do
|
38
|
+
# remove .git directories
|
39
|
+
FileUtils.rm_rf Dir.glob("./**/.git/")
|
40
|
+
|
41
|
+
# create patches and drush directories
|
42
|
+
FileUtils.mkdir('sites/all/patches')
|
43
|
+
FileUtils.mkdir('sites/all/drush')
|
44
|
+
|
45
|
+
# copy the aliases file to the drush dir
|
46
|
+
source = File.expand_path(File.dirname(__FILE__)) + "/../templates/aliases.drushrc.php"
|
47
|
+
FileUtils.cp(source, 'sites/all/drush')
|
48
|
+
# replace [sitename] with site_target_dir
|
49
|
+
text = File.read('sites/all/drush/aliases.drushrc.php')
|
50
|
+
puts = text.gsub('[sitename]',site_target_dir)
|
51
|
+
File.open('sites/all/drush/aliases.drushrc.php', "w") {|file| file << puts}
|
52
|
+
|
53
|
+
# create local .htaccess
|
54
|
+
FileUtils.cp('.htaccess', '.htaccess.local')
|
55
|
+
# alter local .htaccess to use VirtualDocumentRoot
|
56
|
+
text = File.read('.htaccess.local')
|
57
|
+
puts = text.gsub('# RewriteBase /','RewriteBase /')
|
58
|
+
File.open('.htaccess.local', "w") {|file| file << puts}
|
59
|
+
|
60
|
+
# set up the core repo
|
61
|
+
system('git init')
|
62
|
+
system('git remote add origin git@git.3sign.com:git/[sitename]/[sitename].git'.gsub('[sitename]',site_target_dir))
|
63
|
+
File.open('.gitignore', 'a') { |file|
|
64
|
+
file.puts "# Ignore local .htaccess."
|
65
|
+
file.puts ".htaccess.local"
|
66
|
+
file.puts "# Ignore Capistrano config paths."
|
67
|
+
file.puts "Capfile"
|
68
|
+
file.puts "config"
|
69
|
+
file.puts "build"
|
70
|
+
}
|
71
|
+
# initial push
|
72
|
+
system('git add .')
|
73
|
+
system('git commit -am "initial commit"')
|
74
|
+
system('git push origin master')
|
75
|
+
|
76
|
+
puts "Derpy finished installing " + site_target_dir + ", YO!"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
if ARGV.empty?
|
81
|
+
abort "Use 'derpy -T' to display Capistrano tasks.
|
82
|
+
Use 'derpy install [sitename]' to install a new Drupal site."
|
83
|
+
elsif ARGV.first == "install"
|
84
|
+
derpy_install
|
85
|
+
else
|
86
|
+
derpy_capistrano
|
87
|
+
end
|
data/derpy.gemspec
CHANGED
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:
|
4
|
+
version: 2.0.0
|
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-
|
12
|
+
date: 2014-05-14 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|