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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23b06236d8630f276cc6449283e6ed27b8f4bc87
4
- data.tar.gz: 64dc5c41fc122c2e272b2a2aa8243da990c34dfc
3
+ metadata.gz: 7cac5fa83da30feb19219a4daac90869cc62041d
4
+ data.tar.gz: 2edbd3c3b6669ab45dec01f0e8abb1fff6654611
5
5
  SHA512:
6
- metadata.gz: a4360e229f218c1813783cfe50ce07ef866758a2234aaea8ead73d038a15110bdb604887c9e5ebf5c884e124ab242214f62fe662e975d887610869a2395a652e
7
- data.tar.gz: 66939c594c735184266cf6e58033b2d6b2c8376f43497a5e37e97f518cb546ddb7b3e12bbf847b7d65d4a7c339d58a5762f39d625e9769b361c86cd8482ab5ea
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 `shared_folders` array: `uploads/pictures`, `uploads/attachments`, `tmp/cache/assets`, and Alchemy's picture cache. It also runs Alchemy's Seeder after migrating the database.
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 shared folders and your database between environments.
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,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Alchemy
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -1,66 +1,17 @@
1
1
  namespace :alchemy do
2
2
 
3
- # TODO: split up this namespace into something that runs once on `cap install` and
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
-
@@ -3,8 +3,3 @@ namespace :load do
3
3
  invoke 'alchemy:default_paths'
4
4
  end
5
5
  end
6
-
7
- namespace :deploy do
8
- after :migrate, 'alchemy:db:seed'
9
- end
10
-
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.1.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-01 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano-rails