alchemy_cms 2.1.rc3 → 2.1.rc4
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.
- data/app/controllers/alchemy/base_controller.rb +5 -1
- data/bin/alchemy +128 -242
- data/lib/alchemy/capistrano.rb +20 -20
- data/lib/alchemy/version.rb +1 -1
- data/lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb +31 -0
- data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +72 -0
- data/lib/rails/templates/alchemy.rb +2 -2
- metadata +32 -30
@@ -76,7 +76,11 @@ module Alchemy
|
|
76
76
|
|
77
77
|
def set_language_to_default
|
78
78
|
@language = Language.get_default
|
79
|
-
|
79
|
+
if @language
|
80
|
+
store_language_in_session(@language)
|
81
|
+
else
|
82
|
+
raise "No Default Language found! Did you run `rake alchemy:db:seed` task?"
|
83
|
+
end
|
80
84
|
end
|
81
85
|
|
82
86
|
def store_language_in_session(language)
|
data/bin/alchemy
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
# encoding: UTF-8
|
2
3
|
|
3
|
-
#!/usr/bin/env ruby
|
4
4
|
begin
|
5
5
|
require "rubygems"
|
6
6
|
require 'rails/version'
|
@@ -13,168 +13,125 @@ begin
|
|
13
13
|
end
|
14
14
|
|
15
15
|
class AlchemyInstaller < Thor
|
16
|
-
|
17
|
-
include Thor::Actions
|
18
16
|
|
19
|
-
|
17
|
+
include Thor::Actions
|
18
|
+
|
19
|
+
map "-v" => :version
|
20
20
|
map "--version" => :version
|
21
21
|
|
22
22
|
desc "version", "Prints current Alchemy CMS version", :hide => true
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
def version
|
24
|
+
puts Alchemy::VERSION
|
25
|
+
end
|
26
26
|
|
27
|
-
|
28
|
-
|
27
|
+
desc "new PROJECT", "Creates a new Alchemy CMS project."
|
28
|
+
method_option :scm, :type => :string, :aliases => "-s", :desc => "Type of scm to use for this project. Leave blank for none."
|
29
29
|
method_option :database, :type => :string, :default => 'mysql', :aliases => "-d", :desc => "Type of database to use for this project. Default mysql."
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
with_standard_set = yes?("\nDo you want to copy the files of Alchemy´s Standardset into your App? (y/N)")
|
41
|
-
|
42
|
-
%x[
|
43
|
-
cd ./#{@application}
|
44
|
-
rails g alchemy:scaffold#{' --with-standard-set' if with_standard_set}
|
45
|
-
rm ./public/index.html
|
46
|
-
rm ./app/assets/images/rails.png
|
47
|
-
]
|
48
|
-
|
30
|
+
def new(project)
|
31
|
+
@application = project.downcase.strip.gsub(/ /, '_')
|
32
|
+
if yes?("Install Alchemy CMS into ./#{@application}? (y/N)")
|
33
|
+
|
34
|
+
say "Generating new Rails App...", :yellow
|
35
|
+
|
36
|
+
if system("rails _#{RAILS_VERSION}_ new #{@application} -m #{File.join(File.dirname(__FILE__), '..', 'lib', 'rails', 'templates', 'alchemy.rb')} -d #{options[:database]} -JT")
|
37
|
+
|
38
|
+
create_database_yml if options[:database] == 'mysql'
|
39
|
+
|
49
40
|
mountpoint = ask "\nWhere do you want to mount Alchemy CMS? (/)"
|
50
41
|
mountpoint = "/" if mountpoint.empty?
|
51
42
|
sentinel = /\.routes\.draw do(?:\s*\|map\|)?\s*$/
|
52
43
|
inject_into_file "#{@application}/config/routes.rb", "\n mount Alchemy::Engine => '#{mountpoint}'\n", { :after => sentinel, :verbose => true }
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
say "Error while importing!", :red
|
145
|
-
end
|
146
|
-
|
147
|
-
when 'git'
|
148
|
-
gitignore = <<-GIT
|
149
|
-
log/*
|
150
|
-
tmp/*
|
151
|
-
.DS_Store
|
152
|
-
upload/*
|
153
|
-
index/*
|
154
|
-
public/**/alchemy
|
155
|
-
public/pictures
|
156
|
-
public/assets
|
157
|
-
config/database.yml
|
158
|
-
GIT
|
159
|
-
%x[
|
160
|
-
cd #{@application}
|
161
|
-
echo #{gitignore} > #{@application}/.gitignore
|
162
|
-
touch ./index/.gitkeep
|
163
|
-
touch ./uploads/.gitkeep
|
164
|
-
git init .
|
165
|
-
git commit -am 'inital commit'
|
166
|
-
]
|
167
|
-
end
|
168
|
-
|
169
|
-
end
|
170
|
-
|
171
|
-
%x[
|
172
|
-
cd ./#{@application}
|
173
|
-
rake db:create alchemy:install:migrations db:migrate alchemy:db:seed
|
174
|
-
]
|
175
|
-
|
176
|
-
readme = <<-EOF
|
177
|
-
\nSuccessfully installed Alchemy CMS into ./#{@application}
|
44
|
+
|
45
|
+
with_standard_set = yes?("\nDo you want to copy the files of Alchemy´s Standardset into your App? (y/N)")
|
46
|
+
|
47
|
+
%x[
|
48
|
+
cd ./#{@application}
|
49
|
+
rails g alchemy:scaffold#{' --with-standard-set' if with_standard_set}
|
50
|
+
rm ./public/index.html
|
51
|
+
rm ./app/assets/images/rails.png
|
52
|
+
]
|
53
|
+
|
54
|
+
if !options[:scm].nil? && !options[:scm].empty?
|
55
|
+
|
56
|
+
clean_mountpoint = mountpoint.gsub('/', '')
|
57
|
+
|
58
|
+
%x[
|
59
|
+
cd ./#{@application}
|
60
|
+
rm -rf ./tmp/*
|
61
|
+
rm -rf ./log/*
|
62
|
+
mkdir -p ./index
|
63
|
+
mkdir -p ./uploads
|
64
|
+
]
|
65
|
+
|
66
|
+
if yes?("\nDo you want to generate a deploy script for Capistrano? (y/N)")
|
67
|
+
system "cd #{@application} && rails g alchemy:deploy_script --scm=#{options[:scm]} --db=#{options[:database]}"
|
68
|
+
say "\nCapifying...", :yellow
|
69
|
+
system "cd #{@application} && capify ."
|
70
|
+
end
|
71
|
+
|
72
|
+
case options[:scm]
|
73
|
+
when 'svn'
|
74
|
+
server = ask("\nURL of your svn server:")
|
75
|
+
repository = ask("\nName of the repository (#{@application}):")
|
76
|
+
repository = @application if repository.empty?
|
77
|
+
|
78
|
+
say "\nImporting #{@application} into #{server}/#{repository} ...", :yellow
|
79
|
+
output = %x[svn import ./#{@application} #{server}/#{repository} -m 'initial import by Alchemy installer']; imported = $?.success?
|
80
|
+
|
81
|
+
if imported
|
82
|
+
|
83
|
+
say "Removing and checking out again...", :yellow
|
84
|
+
%x[
|
85
|
+
rm -rf ./#{@application}
|
86
|
+
svn co #{server}/#{repository} #{@application}
|
87
|
+
]
|
88
|
+
|
89
|
+
say "Committing ignores...", :yellow
|
90
|
+
%x[
|
91
|
+
cd ./#{@application}
|
92
|
+
svn propset svn:ignore '*' tmp/ log/ index/ uploads/
|
93
|
+
svn propset svn:ignore '#{clean_mountpoint.empty? ? 'pictures' : clean_mountpoint}' ./public
|
94
|
+
svn propset svn:ignore 'assets' ./public
|
95
|
+
svn propset svn:ignore 'database.yml' ./config
|
96
|
+
svn commit -m 'set ignores'
|
97
|
+
]
|
98
|
+
|
99
|
+
else
|
100
|
+
say "Error while importing!", :red
|
101
|
+
end
|
102
|
+
|
103
|
+
when 'git'
|
104
|
+
gitignore = <<-GIT
|
105
|
+
log/*
|
106
|
+
tmp/*
|
107
|
+
.DS_Store
|
108
|
+
upload/*
|
109
|
+
index/*
|
110
|
+
public/#{clean_mountpoint.empty? ? 'pictures' : clean_mountpoint}
|
111
|
+
public/assets
|
112
|
+
config/database.yml
|
113
|
+
GIT
|
114
|
+
%x[
|
115
|
+
cd #{@application}
|
116
|
+
echo "#{gitignore}" > .gitignore
|
117
|
+
touch ./index/.gitkeep
|
118
|
+
touch ./uploads/.gitkeep
|
119
|
+
git init .
|
120
|
+
git add .
|
121
|
+
git commit -am 'inital commit'
|
122
|
+
]
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
126
|
+
|
127
|
+
%x[
|
128
|
+
cd ./#{@application}
|
129
|
+
rake db:create alchemy:install:migrations db:migrate alchemy:db:seed
|
130
|
+
]
|
131
|
+
|
132
|
+
readme = <<-EOF
|
133
|
+
|
134
|
+
Successfully installed Alchemy CMS into ./#{@application}
|
178
135
|
|
179
136
|
Next steps:
|
180
137
|
|
@@ -196,25 +153,24 @@ Thank you for using Alchemy CMS!
|
|
196
153
|
http://alchemy-cms.com
|
197
154
|
|
198
155
|
EOF
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
156
|
+
say readme, :green
|
157
|
+
else
|
158
|
+
say "\nError while installation!\n", :red
|
159
|
+
end
|
160
|
+
|
161
|
+
else
|
162
|
+
return
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
210
166
|
private
|
211
167
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
168
|
+
def create_database_yml
|
169
|
+
@db_root_password = ask("\nPlease provide your local root password for mysql (Leave blank for none):")
|
170
|
+
local_standard_socket = '/tmp/mysql.sock'
|
171
|
+
@db_local_socket = ask("\nPlease provide your local mysql socket (#{local_standard_socket}):")
|
172
|
+
@db_local_socket = local_standard_socket if @db_local_socket.empty?
|
173
|
+
create_file "./#{@application}/config/database.yml", :force => true do
|
218
174
|
<<-DATABASE
|
219
175
|
development:
|
220
176
|
adapter: mysql2
|
@@ -249,79 +205,9 @@ production:
|
|
249
205
|
password: #{@db_root_password}
|
250
206
|
socket: #{@db_local_socket}
|
251
207
|
DATABASE
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
def create_deploy_rb
|
256
|
-
create_file "./#{@application}/config/deploy.rb" do
|
257
|
-
<<-DEPLOY
|
258
|
-
# set the applicationname here
|
259
|
-
set :application, "#{@application}"
|
260
|
-
|
261
|
-
# set the apps repository url
|
262
|
-
set :repository_url, "#{@repository_url}"
|
263
|
-
|
264
|
-
# ssh user settings. please change to customers
|
265
|
-
set :user, "#{@ssh_user}"
|
266
|
-
set :password, "#{@ssh_password}"
|
267
|
-
set :port, #{@ssh_port}
|
268
|
-
set :use_sudo, false
|
269
|
-
|
270
|
-
# domain names
|
271
|
-
role :app, "#{@server}"
|
272
|
-
role :web, "#{@server}"
|
273
|
-
role :db, "#{@server}", :primary => true
|
274
|
-
|
275
|
-
# set the public webserver path
|
276
|
-
set :deploy_to, "#{@deploy_path}"
|
277
|
-
|
278
|
-
set :scm, :subversion
|
279
|
-
set :scm_user, "#{@scm_user}"
|
280
|
-
set :scm_password, "#{@scm_password}"
|
281
|
-
|
282
|
-
set :repository, Proc.new{ "--username \#{scm_user} --password \#{scm_password} \#{repository_url}" }
|
283
|
-
|
284
|
-
after "deploy:setup", "alchemy:database_yml:create"
|
285
|
-
|
286
|
-
before "deploy:start", "deploy:seed"
|
287
|
-
|
288
|
-
after "deploy:symlink", "alchemy:database_yml:symlink"
|
289
|
-
|
290
|
-
before "deploy:restart", "deploy:migrate"
|
291
|
-
|
292
|
-
after "deploy", "deploy:cleanup"
|
293
|
-
|
294
|
-
namespace :logs do
|
295
|
-
desc "show last 50 lines of production.log"
|
296
|
-
task :tail do
|
297
|
-
run "tail -n50 \#{shared_path}/log/production.log"
|
298
|
-
end
|
299
|
-
|
300
|
-
desc "watch tail of production.log and wait for additional data to be appended to the input"
|
301
|
-
task :watch do
|
302
|
-
stream("tail -f \#{shared_path}/log/production.log")
|
303
|
-
end
|
304
|
-
end
|
305
|
-
|
306
|
-
namespace :deploy do
|
307
|
-
desc "Overwrite for the internal Capistrano deploy:start task."
|
308
|
-
task :start, :roles => :app do
|
309
|
-
end
|
310
|
-
|
311
|
-
desc "Restart the server"
|
312
|
-
task :restart, :roles => :app do
|
313
|
-
run "touch \#{current_path}/tmp/restart.txt"
|
314
|
-
end
|
208
|
+
end
|
209
|
+
end
|
315
210
|
|
316
|
-
desc 'Seeds the database'
|
317
|
-
task :seed, :roles => :app, :except => { :no_release => true } do
|
318
|
-
run "cd \#{current_path} && RAILS_ENV=production rake db:seed"
|
319
|
-
end
|
320
|
-
end
|
321
|
-
DEPLOY
|
322
|
-
end
|
323
|
-
end
|
324
|
-
|
325
211
|
end
|
326
212
|
|
327
213
|
AlchemyInstaller.start
|
data/lib/alchemy/capistrano.rb
CHANGED
@@ -4,11 +4,11 @@ require "rails"
|
|
4
4
|
require "alchemy/mount_point"
|
5
5
|
|
6
6
|
Capistrano::Configuration.instance(:must_exist).load do
|
7
|
-
|
7
|
+
|
8
8
|
after "deploy:setup", "alchemy:shared_folders:create"
|
9
9
|
after "deploy:symlink", "alchemy:shared_folders:symlink"
|
10
10
|
before "deploy:start", "alchemy:db:seed"
|
11
|
-
|
11
|
+
|
12
12
|
namespace :alchemy do
|
13
13
|
|
14
14
|
namespace :shared_folders do
|
@@ -20,7 +20,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
20
20
|
run "mkdir -p #{shared_path}/index"
|
21
21
|
run "mkdir -p #{shared_path}/uploads/pictures"
|
22
22
|
run "mkdir -p #{shared_path}/uploads/attachments"
|
23
|
-
run "mkdir -p #{File.join(shared_path, 'cache', Capistrano::CLI.ui.ask("Where is Alchemy CMS mounted at? (/)"), 'pictures')}"
|
23
|
+
run "mkdir -p #{File.join(shared_path, 'cache', Capistrano::CLI.ui.ask("Where is Alchemy CMS mounted at? ('/')"), 'pictures')}"
|
24
24
|
end
|
25
25
|
|
26
26
|
# This task sets the symlinks for uploads, picture cache and ferret index folder.
|
@@ -38,7 +38,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
38
38
|
|
39
39
|
desc "Upgrades production database to current Alchemy CMS version"
|
40
40
|
task :upgrade do
|
41
|
-
run "cd #{current_path} && RAILS_ENV
|
41
|
+
run "cd #{current_path} && RAILS_ENV=#{fetch(:rails_env, 'production')} #{rake} alchemy:upgrade"
|
42
42
|
end
|
43
43
|
|
44
44
|
namespace :database_yml do
|
@@ -46,22 +46,22 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
46
46
|
desc "Creates the database.yml file"
|
47
47
|
task :create do
|
48
48
|
db_config = ERB.new <<-EOF
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
49
|
+
production:
|
50
|
+
adapter: mysql
|
51
|
+
encoding: utf8
|
52
|
+
reconnect: false
|
53
|
+
pool: 5
|
54
|
+
database: #{ Capistrano::CLI.ui.ask("Database name: ") }
|
55
|
+
username: #{ Capistrano::CLI.ui.ask("Database username: ") }
|
56
|
+
password: #{ Capistrano::CLI.ui.ask("Database password: ") }
|
57
|
+
socket: #{ Capistrano::CLI.ui.ask("Database socket: ") }
|
58
|
+
host: #{ Capistrano::CLI.ui.ask("Database host: ") }
|
59
|
+
EOF
|
60
60
|
run "mkdir -p #{shared_path}/config"
|
61
61
|
put db_config.result, "#{shared_path}/config/database.yml"
|
62
62
|
end
|
63
63
|
|
64
|
-
desc "Symlinks the database.yml file from shared folder into config folder"
|
64
|
+
desc "[internal] Symlinks the database.yml file from shared folder into config folder"
|
65
65
|
task :symlink, :except => { :no_release => true } do
|
66
66
|
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
|
67
67
|
end
|
@@ -74,21 +74,21 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
74
74
|
|
75
75
|
desc "Seeds the database with essential data."
|
76
76
|
task :seed, :roles => :app do
|
77
|
-
run "cd #{current_path} && RAILS_ENV
|
77
|
+
run "cd #{current_path} && RAILS_ENV=#{fetch(:rails_env, 'production')} #{rake} alchemy:db:seed"
|
78
78
|
end
|
79
79
|
|
80
80
|
end
|
81
81
|
|
82
82
|
namespace :ferret do
|
83
|
-
|
83
|
+
|
84
84
|
# This task rebuilds the ferret index for the EssenceText and EssenceRichtext Models.
|
85
85
|
# Call it before deploy:restart like +before "deploy:restart", "alchemy:rebuild_index"+ in your +deploy.rb+.
|
86
86
|
# It uses the +alchemy:rebuild_index+ rake task found in +vendor/plugins/alchemy/lib/tasks+.
|
87
87
|
desc "Rebuild the ferret index. Call before deploy:restart"
|
88
88
|
task :rebuild_index, :roles => :app do
|
89
|
-
run "cd #{current_path} && RAILS_ENV
|
89
|
+
run "cd #{current_path} && RAILS_ENV=#{fetch(:rails_env, 'production')} #{rake} ferret:rebuild_index"
|
90
90
|
end
|
91
91
|
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
94
|
end
|
data/lib/alchemy/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Alchemy
|
4
|
+
module Generators
|
5
|
+
class DeployScriptGenerator < ::Rails::Generators::Base
|
6
|
+
|
7
|
+
desc "This generator generates a Capistrano deploy script."
|
8
|
+
class_option :scm, :type => :string, :desc => "Set the type of scm you use for deployment.", :default => 'svn'
|
9
|
+
class_option :db, :type => :string, :desc => "Set the type of database you use on your server.", :default => 'mysql'
|
10
|
+
source_root File.expand_path('templates', File.dirname(__FILE__))
|
11
|
+
|
12
|
+
def copy_script
|
13
|
+
@ssh_user = ask('Please enter SSH username:')
|
14
|
+
@ssh_password = ask('Please enter SSH password:')
|
15
|
+
port = ask('Please enter SSH port (22):')
|
16
|
+
@ssh_port = port.blank? ? 22 : port
|
17
|
+
@server = ask('Please enter server ip or domain:')
|
18
|
+
@deploy_path = ask('Please enter the path to the public html folder:')
|
19
|
+
@scm = options[:scm]
|
20
|
+
@repository_url = ask('Please enter the URL to your projects repository:')
|
21
|
+
if @scm == "svn" && yes?('Is your repository private? (y/N)')
|
22
|
+
@scm_user = ask('Please enter the username for your repository:')
|
23
|
+
@scm_password = ask('Please enter the password to your repository:')
|
24
|
+
end
|
25
|
+
@database_type = options[:db]
|
26
|
+
template "deploy.rb.tt", Rails.root.join('config', 'deploy.rb')
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'bundler/capistrano'
|
2
|
+
require 'alchemy/capistrano'
|
3
|
+
load 'deploy/assets'
|
4
|
+
|
5
|
+
# ssh user settings. please change to customers
|
6
|
+
set :user, "<%= @ssh_user %>"
|
7
|
+
set :password, "<%= @ssh_password %>"
|
8
|
+
set :port, <%= @ssh_port %>
|
9
|
+
set :use_sudo, false
|
10
|
+
|
11
|
+
# domain names
|
12
|
+
role :app, "<%= @server %>"
|
13
|
+
role :web, "<%= @server %>"
|
14
|
+
role :db, "<%= @server %>", :primary => true
|
15
|
+
|
16
|
+
# set the public webserver path
|
17
|
+
set :deploy_to, "<%= @deploy_path %>"
|
18
|
+
|
19
|
+
set :rails_env, "production"
|
20
|
+
|
21
|
+
<%- if @scm == "svn" -%>
|
22
|
+
set :repository_url, "<%= @repository_url %>"
|
23
|
+
set :scm, "subversion"
|
24
|
+
set :scm_user, "<%= @scm_user %>"
|
25
|
+
set :scm_password, "<%= @scm_password %>"
|
26
|
+
<%- if @scm_user && @scm_password -%>
|
27
|
+
set :repository, Proc.new { "--username #{scm_user} --password #{scm_password} #{repository_url}" }
|
28
|
+
<%- else -%>
|
29
|
+
set :repository, "<%= @repository_url %>"
|
30
|
+
<%- end -%>
|
31
|
+
<%- elsif @scm == "git" -%>
|
32
|
+
set :scm, "git"
|
33
|
+
set :repository, "<%= @repository_url %>"
|
34
|
+
set :branch, "master"
|
35
|
+
<%- end -%>
|
36
|
+
|
37
|
+
before "deploy:start", "deploy:seed"
|
38
|
+
before "deploy:restart", "deploy:migrate"
|
39
|
+
|
40
|
+
<%- if @database_type == "mysql" -%>
|
41
|
+
after "deploy:setup", "alchemy:database_yml:create"
|
42
|
+
after "deploy:symlink", "alchemy:database_yml:symlink"
|
43
|
+
<%- end -%>
|
44
|
+
after "deploy", "deploy:cleanup"
|
45
|
+
|
46
|
+
namespace :logs do
|
47
|
+
desc "show last 100 lines of log"
|
48
|
+
task :tail do
|
49
|
+
run "tail -n100 #{shared_path}/log/#{rails_env}.log"
|
50
|
+
end
|
51
|
+
|
52
|
+
desc "watch tail of log and wait for additional data to be appended to the input"
|
53
|
+
task :watch do
|
54
|
+
stream("tail -f #{shared_path}/log/#{rails_env}.log")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
namespace :deploy do
|
59
|
+
|
60
|
+
task :start do ; end
|
61
|
+
task :stop do ; end
|
62
|
+
|
63
|
+
task :restart, :roles => :app, :except => { :no_release => true } do
|
64
|
+
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
|
65
|
+
end
|
66
|
+
|
67
|
+
desc 'Seeds the database'
|
68
|
+
task :seed, :roles => :app, :except => { :no_release => true } do
|
69
|
+
run "cd #{release_path} && RAILS_ENV=#{rails_env} #{rake} db:seed"
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
@@ -7,8 +7,8 @@ gem 'alchemy_cms', "~> #{Alchemy::VERSION}"
|
|
7
7
|
gem 'ruby-debug', :group => :development, :platform => :ruby_18
|
8
8
|
gem 'ruby-debug19', :group => :development, :platform => :ruby_19
|
9
9
|
|
10
|
-
if yes?("
|
11
|
-
|
10
|
+
if yes?("\nDo you want to use Capistrano for deployment? (y/N)")
|
11
|
+
gem 'capistrano', :group => :development
|
12
12
|
end
|
13
13
|
|
14
14
|
run 'bundle install'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.rc4
|
5
5
|
prerelease: 4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -15,7 +15,7 @@ date: 2012-01-18 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
18
|
-
requirement: &
|
18
|
+
requirement: &70214478485880 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: '3.1'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70214478485880
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: authlogic
|
29
|
-
requirement: &
|
29
|
+
requirement: &70214478485160 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: '0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *70214478485160
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: awesome_nested_set
|
40
|
-
requirement: &
|
40
|
+
requirement: &70214478484460 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: '2.0'
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *70214478484460
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: declarative_authorization
|
51
|
-
requirement: &
|
51
|
+
requirement: &70214478483780 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ~>
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: 0.5.4
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *70214478483780
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: tvdeyen-fleximage
|
62
|
-
requirement: &
|
62
|
+
requirement: &70214478483180 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ~>
|
@@ -67,10 +67,10 @@ dependencies:
|
|
67
67
|
version: 1.0.9
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *70214478483180
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: will_paginate
|
73
|
-
requirement: &
|
73
|
+
requirement: &70214478482600 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ~>
|
@@ -78,10 +78,10 @@ dependencies:
|
|
78
78
|
version: '3.0'
|
79
79
|
type: :runtime
|
80
80
|
prerelease: false
|
81
|
-
version_requirements: *
|
81
|
+
version_requirements: *70214478482600
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: acts_as_ferret
|
84
|
-
requirement: &
|
84
|
+
requirement: &70214478481900 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
86
86
|
requirements:
|
87
87
|
- - ~>
|
@@ -89,10 +89,10 @@ dependencies:
|
|
89
89
|
version: '0.5'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
|
-
version_requirements: *
|
92
|
+
version_requirements: *70214478481900
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: acts_as_list
|
95
|
-
requirement: &
|
95
|
+
requirement: &70214478480640 !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
97
97
|
requirements:
|
98
98
|
- - ~>
|
@@ -100,10 +100,10 @@ dependencies:
|
|
100
100
|
version: '0.1'
|
101
101
|
type: :runtime
|
102
102
|
prerelease: false
|
103
|
-
version_requirements: *
|
103
|
+
version_requirements: *70214478480640
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: magiclabs-userstamp
|
106
|
-
requirement: &
|
106
|
+
requirement: &70214478479260 !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
109
109
|
- - ~>
|
@@ -111,10 +111,10 @@ dependencies:
|
|
111
111
|
version: 2.0.2
|
112
112
|
type: :runtime
|
113
113
|
prerelease: false
|
114
|
-
version_requirements: *
|
114
|
+
version_requirements: *70214478479260
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: dynamic_form
|
117
|
-
requirement: &
|
117
|
+
requirement: &70214478511660 !ruby/object:Gem::Requirement
|
118
118
|
none: false
|
119
119
|
requirements:
|
120
120
|
- - ~>
|
@@ -122,10 +122,10 @@ dependencies:
|
|
122
122
|
version: '1.1'
|
123
123
|
type: :runtime
|
124
124
|
prerelease: false
|
125
|
-
version_requirements: *
|
125
|
+
version_requirements: *70214478511660
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: jquery-rails
|
128
|
-
requirement: &
|
128
|
+
requirement: &70214478510520 !ruby/object:Gem::Requirement
|
129
129
|
none: false
|
130
130
|
requirements:
|
131
131
|
- - ~>
|
@@ -133,10 +133,10 @@ dependencies:
|
|
133
133
|
version: 1.0.16
|
134
134
|
type: :runtime
|
135
135
|
prerelease: false
|
136
|
-
version_requirements: *
|
136
|
+
version_requirements: *70214478510520
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: attachment_magic
|
139
|
-
requirement: &
|
139
|
+
requirement: &70214478509380 !ruby/object:Gem::Requirement
|
140
140
|
none: false
|
141
141
|
requirements:
|
142
142
|
- - ~>
|
@@ -144,10 +144,10 @@ dependencies:
|
|
144
144
|
version: 0.2.1
|
145
145
|
type: :runtime
|
146
146
|
prerelease: false
|
147
|
-
version_requirements: *
|
147
|
+
version_requirements: *70214478509380
|
148
148
|
- !ruby/object:Gem::Dependency
|
149
149
|
name: rspec-rails
|
150
|
-
requirement: &
|
150
|
+
requirement: &70214478508660 !ruby/object:Gem::Requirement
|
151
151
|
none: false
|
152
152
|
requirements:
|
153
153
|
- - ~>
|
@@ -155,10 +155,10 @@ dependencies:
|
|
155
155
|
version: '2.8'
|
156
156
|
type: :development
|
157
157
|
prerelease: false
|
158
|
-
version_requirements: *
|
158
|
+
version_requirements: *70214478508660
|
159
159
|
- !ruby/object:Gem::Dependency
|
160
160
|
name: sqlite3
|
161
|
-
requirement: &
|
161
|
+
requirement: &70214478507840 !ruby/object:Gem::Requirement
|
162
162
|
none: false
|
163
163
|
requirements:
|
164
164
|
- - ! '>='
|
@@ -166,7 +166,7 @@ dependencies:
|
|
166
166
|
version: '0'
|
167
167
|
type: :development
|
168
168
|
prerelease: false
|
169
|
-
version_requirements: *
|
169
|
+
version_requirements: *70214478507840
|
170
170
|
description: Alchemy is an awesome Rails CMS with an extremely flexible content storing
|
171
171
|
architecture.
|
172
172
|
email:
|
@@ -578,6 +578,8 @@ files:
|
|
578
578
|
- lib/extensions/array.rb
|
579
579
|
- lib/extensions/hash.rb
|
580
580
|
- lib/middleware/flash_session_cookie.rb
|
581
|
+
- lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
|
582
|
+
- lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt
|
581
583
|
- lib/rails/generators/alchemy/elements/elements_generator.rb
|
582
584
|
- lib/rails/generators/alchemy/elements/templates/editor.html.erb
|
583
585
|
- lib/rails/generators/alchemy/elements/templates/view.html.erb
|
@@ -791,7 +793,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
791
793
|
version: '0'
|
792
794
|
segments:
|
793
795
|
- 0
|
794
|
-
hash:
|
796
|
+
hash: 4031528361938782580
|
795
797
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
796
798
|
none: false
|
797
799
|
requirements:
|