capistrano-alchemy 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/capistrano/alchemy/version.rb +1 -1
- data/lib/capistrano/tasks/alchemy.rake +2 -53
- data/lib/capistrano/tasks/alchemy_capistrano_hooks.rake +0 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cac5fa83da30feb19219a4daac90869cc62041d
|
4
|
+
data.tar.gz: 2edbd3c3b6669ab45dec01f0e8abb1fff6654611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f3fb820cdb646bd302bed4d9404818555cd744e769b23403c056b2764795ef2dda0ec3da1aa108dfab90b38df68344e204b5a728a51c95db3fcbf4046aa97fb
|
7
|
+
data.tar.gz: 66e328cba1f60d1218391e1a2252fca5819c5fd23ef165ec76762b0f79824012df7097f0bf7135a938ea26a51e22ac355ca57bdbdba33bdbc3e79613347a631b
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Capistrano Tasks for Alchemy CMS
|
2
2
|
|
3
|
-
Capistrano::Alchemy adds four folders to Capistranos `
|
3
|
+
Capistrano::Alchemy adds four folders to Capistranos `linked_dirs` array: `uploads/pictures`, `uploads/attachments`, and Alchemy's picture cache folder.
|
4
4
|
|
5
|
-
In addition, it offers several tasks to synchronize your
|
5
|
+
In addition, it offers several tasks to synchronize your uploads folder and your database between environments.
|
6
6
|
|
7
7
|
|
8
8
|
## Installation
|
@@ -1,66 +1,17 @@
|
|
1
1
|
namespace :alchemy do
|
2
2
|
|
3
|
-
#
|
4
|
-
# once on every deploy
|
5
|
-
desc "Prepare Alchemy for deployment."
|
3
|
+
# Prepare Alchemy for deployment
|
6
4
|
task :default_paths do
|
7
5
|
set :alchemy_picture_cache_path,
|
8
6
|
-> { File.join('public', Alchemy::MountPoint.get, 'pictures') }
|
9
|
-
|
10
7
|
set :linked_dirs, fetch(:linked_dirs, []) + [
|
11
8
|
"uploads/pictures",
|
12
9
|
"uploads/attachments",
|
13
|
-
fetch(:alchemy_picture_cache_path)
|
14
|
-
"tmp/cache/assets"
|
10
|
+
fetch(:alchemy_picture_cache_path)
|
15
11
|
]
|
16
|
-
|
17
|
-
# TODO: Check, if this is the right approach to ensure that we don't overwrite existing settings?
|
18
|
-
# Or does Capistrano already handle this for us?
|
19
|
-
set :linked_files, fetch(:linked_files, []) + %w(config/database.yml)
|
20
|
-
end
|
21
|
-
|
22
|
-
# TODO: Do we really need this in Alchemy or should we release an official Capistrano plugin for that?
|
23
|
-
namespace :database_yml do
|
24
|
-
desc "Creates the database.yml file"
|
25
|
-
task create: ['alchemy:default_paths', 'deploy:check'] do
|
26
|
-
set :db_environment, ask("the environment", fetch(:rails_env, 'production'))
|
27
|
-
set :db_adapter, ask("database adapter (mysql or postgresql)", 'mysql')
|
28
|
-
set :db_adapter, fetch(:db_adapter).gsub(/\Amysql\z/, 'mysql2')
|
29
|
-
set :db_name, ask("database name", nil)
|
30
|
-
set :db_username, ask("database username", nil)
|
31
|
-
set :db_password, ask("database password", nil)
|
32
|
-
default_db_host = fetch(:db_adapter) == 'mysql2' ? 'localhost' : '127.0.0.1'
|
33
|
-
set :db_host, ask("database host", default_db_host)
|
34
|
-
db_config = ERB.new <<-EOF
|
35
|
-
#{fetch(:db_environment)}:
|
36
|
-
adapter: #{fetch(:db_adapter)}
|
37
|
-
encoding: utf8
|
38
|
-
reconnect: false
|
39
|
-
pool: 5
|
40
|
-
database: #{fetch(:db_name)}
|
41
|
-
username: #{fetch(:db_username)}
|
42
|
-
password: #{fetch(:db_password)}
|
43
|
-
host: #{fetch(:db_host)}
|
44
|
-
EOF
|
45
|
-
on roles :app do
|
46
|
-
execute :mkdir, '-p', "#{shared_path}/config"
|
47
|
-
upload! StringIO.new(db_config.result), "#{shared_path}/config/database.yml"
|
48
|
-
end
|
49
|
-
end
|
50
12
|
end
|
51
13
|
|
52
14
|
namespace :db do
|
53
|
-
desc "Seeds the database with essential data."
|
54
|
-
task seed: ['alchemy:default_paths', 'deploy:check'] do
|
55
|
-
on roles :db do
|
56
|
-
within release_path do
|
57
|
-
with rails_env: fetch(:rails_env, 'production') do
|
58
|
-
execute :rake, 'db:seed'
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
15
|
desc "Dumps the database into 'db/dumps' on the server."
|
65
16
|
task dump: ['alchemy:default_paths', 'deploy:check'] do
|
66
17
|
on roles :db do
|
@@ -164,5 +115,3 @@ EOF
|
|
164
115
|
end
|
165
116
|
end
|
166
117
|
end
|
167
|
-
|
168
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-alchemy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Meyerhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano-rails
|