ratchetify 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rvmrc +1 -0
- data/lib/ratchetify/php.rb +76 -0
- data/lib/ratchetify/service.rb +1 -1
- data/lib/ratchetify/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afde081629aaaa295943f37ede29bf2490b0766a
|
4
|
+
data.tar.gz: fed743747185f2660f79ffa135aa75bb796bb811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a1c0bb35a467d6092a41a62bc4dc7c688c7b1df6359357b1ee2c6786b8a3d40d6fc9f5815b9acf19211232998fa93d7491f7e084c7b0edcd5a0400a1ea9abbb
|
7
|
+
data.tar.gz: 07d6841650e7e9479c16849fc7c3e0cdec5fcb4a54bcb086dd1b7b5a1e748a862b81a802ad1bd48b43989594fb6ea0de8e6eb87810645c54c06a1a64985cf03d
|
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 2.1.1@ratchetify --create
|
@@ -0,0 +1,76 @@
|
|
1
|
+
|
2
|
+
Capistrano::Configuration.instance.load do
|
3
|
+
|
4
|
+
require 'capistrano'
|
5
|
+
require 'ratchetify/helpers'
|
6
|
+
require 'ratchetify/setup'
|
7
|
+
require 'ratchetify/domain'
|
8
|
+
|
9
|
+
before "create:php", "setup:environment"
|
10
|
+
after "create:php", "domain:add"
|
11
|
+
|
12
|
+
desc "Deploy an app for the first time"
|
13
|
+
namespace :create do
|
14
|
+
|
15
|
+
desc "Deploy an wordpress blog to uberspace"
|
16
|
+
task :php do
|
17
|
+
create_repo
|
18
|
+
create_database
|
19
|
+
finalize
|
20
|
+
end
|
21
|
+
|
22
|
+
task :create_repo do
|
23
|
+
# clone the repo first
|
24
|
+
git_cmd = "cd #{deploy_root} && git clone #{fetch :repo} #{fetch :application}"
|
25
|
+
|
26
|
+
run git_cmd do |channel, stream, out|
|
27
|
+
if out =~ /Password:/
|
28
|
+
channel.send_data("#{fetch :repo_password}\n")
|
29
|
+
else
|
30
|
+
puts out
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# switch to the specified branch
|
35
|
+
run "cd #{deploy_dir} && git checkout -b #{fetch :branch}" unless on_branch? deploy_dir, "#{fetch :branch}"
|
36
|
+
|
37
|
+
end # task :create_repo
|
38
|
+
|
39
|
+
task :create_database do
|
40
|
+
|
41
|
+
# extract user & password
|
42
|
+
my_cnf = capture('cat ~/.my.cnf')
|
43
|
+
|
44
|
+
my_cnf.match(/^user=(\w+)/)
|
45
|
+
mysql_user = $1
|
46
|
+
my_cnf.match(/^password=(\w+)/)
|
47
|
+
mysql_pwd = $1
|
48
|
+
my_cnf.match(/^port=(\w+)/)
|
49
|
+
mysql_port = $1
|
50
|
+
|
51
|
+
# create the database
|
52
|
+
mysql_database = "#{user}_#{application}" # 'application' MUST NOT contain any '-' !!!
|
53
|
+
run "mysql -e 'CREATE DATABASE IF NOT EXISTS #{mysql_database} CHARACTER SET utf8 COLLATE utf8_general_ci;'"
|
54
|
+
|
55
|
+
database_yml = <<-EOF
|
56
|
+
database: #{mysql_database}
|
57
|
+
username: #{mysql_user}
|
58
|
+
password: #{mysql_pwd}
|
59
|
+
host: localhost
|
60
|
+
port: #{mysql_port}
|
61
|
+
|
62
|
+
EOF
|
63
|
+
|
64
|
+
# upload the database.yml file
|
65
|
+
put database_yml, "#{deploy_dir}/database.yml"
|
66
|
+
|
67
|
+
end # task :create_database
|
68
|
+
|
69
|
+
task :finalize do
|
70
|
+
# create symbolic links..
|
71
|
+
run "cd #{webroot_dir} && ln -s #{deploy_dir} #{fetch :host}.#{fetch :domain}"
|
72
|
+
run "cd #{webroot_dir} && ln -s #{deploy_dir} #{fetch :domain}" unless (wildcard_domain == false)
|
73
|
+
end # task :finalize
|
74
|
+
|
75
|
+
end # namespace
|
76
|
+
end
|
data/lib/ratchetify/service.rb
CHANGED
@@ -22,7 +22,7 @@ Capistrano::Configuration.instance.load do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
task :create do
|
25
|
-
|
25
|
+
create_service_unicorn # default option
|
26
26
|
|
27
27
|
# register the service
|
28
28
|
run "uberspace-setup-service #{daemon_service} ~/bin/#{daemon_service}"
|
data/lib/ratchetify/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratchetify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kuehl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -47,6 +47,7 @@ extensions: []
|
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
49
|
- ".gitignore"
|
50
|
+
- ".rvmrc"
|
50
51
|
- Capfile.example
|
51
52
|
- Gemfile
|
52
53
|
- LICENSE
|
@@ -58,6 +59,7 @@ files:
|
|
58
59
|
- lib/ratchetify/domain.rb
|
59
60
|
- lib/ratchetify/help.rb
|
60
61
|
- lib/ratchetify/helpers.rb
|
62
|
+
- lib/ratchetify/php.rb
|
61
63
|
- lib/ratchetify/rails.rb
|
62
64
|
- lib/ratchetify/ruby.rb
|
63
65
|
- lib/ratchetify/service.rb
|