Deploy process

44 просмотра
Перейти к первому непрочитанному сообщению

Nuno Brito

не прочитано,
1 июн. 2015 г., 15:12:4101.06.2015
– alche...@googlegroups.com
Hello all, I am facing some issues on the deployment... by the way, Alchemy CMS is great, and I think your work is awesome... thank you :)

So, I need to run the following tasks so the capistrano can create the required shared folders for the shared assets:

  • after "deploy:setup", "alchemy:shared_folders:create"
  • after "deploy:finalize_update", "alchemy:shared_folders:symlink"

However it gives an error in the end of the deployment process:

  • the task `alchemy:shared_folders:symlink' does not exist

Then I tried to add in the beggining of the deploy.rb file:
  • require 'alchemy/capistrano'

but it gives the error as soon as I execute the cap:deploy:
  • in `require': cannot load such file -- alchemy/capistrano (LoadError)

What am I doing wrong? Shouldn't the cap script load those alchemy files with the available functions?

Thank you for your help

Thomas von Deyen

не прочитано,
1 июн. 2015 г., 16:18:0201.06.2015
– alche...@googlegroups.com
Hi. 

Please use the new capistrano-alchemy Gem (https://github.com/AlchemyCMS/capistrano-alchemy) that supports latest Capistrano 3.x version. The build in Capistrano receipt is for Capistrano 2.x and will be removed soon. 

Best


Thomas
--
You received this message because you are subscribed to the Google Groups "Alchemy CMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alchemy-cms...@googlegroups.com.
To post to this group, send email to alche...@googlegroups.com.
Visit this group at http://groups.google.com/group/alchemy-cms.
To view this discussion on the web visit https://groups.google.com/d/msgid/alchemy-cms/815e2a96-9a0e-431f-a026-20dd5bbb29a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nuno Brito

не прочитано,
2 июн. 2015 г., 04:55:5002.06.2015
– alche...@googlegroups.com
Hi tvdeyen,
I will try it.
However, how should I use my own deploy script and add just those lines?
What is the usual delpoy.rb file? I have some paperclip shared folders that I also need to create and symlink.
Is there any complete app deploy example I can look at?
Thank you for your help ;)
Nuno

Thomas von Deyen

не прочитано,
2 июн. 2015 г., 06:17:2502.06.2015
– alche...@googlegroups.com
Hi. Capistrano is the go-to deploy solution for any kind of rails app. 

Please have a look at the official documentation. 


Thomas

Nuno Brito

не прочитано,
2 июн. 2015 г., 11:47:1102.06.2015
– alche...@googlegroups.com
Hi Thomas,
I changed to capistrano 3.1.0
I was able to make a first deploy with that... 
Now I tried to add the alchemy tasks to create the shared and symlinks:

gemfile:
group :development do
  gem 'capistrano-alchemy', github: 'AlchemyCMS/capistrano-alchemy', branch: 'master', require: false
  gem 'capistrano', '~> 3.1.0', require: false
  gem 'capistrano-rails', '~> 1.1.0', require: false
  gem 'capistrano-bundler', require: false
  gem 'capistrano-passenger', require: false
  gem 'capistrano-rvm', require: false
end

deploy.rb:
namespace :deploy do
  after "deploy:setup", "alchemy:shared_folders:create"
  after "deploy:finalize_update", "alchemy:shared_folders:symlink"
  after :restart, :clear_cache do
    on roles(:web), in: :groups, limit: 3, wait: 10 do
  end
  end
end

Added this line to capfile.rb:
require 'capistrano/alchemy'

And then do: 
  • cap production deploy
cap aborted!
LoadError: cannot load such file -- capistrano/alchemy
Capfile:26:in `<top (required)>'

What am I missing? Why can't I add the alchemy tasks to capistrano?
Thank you

Thomas von Deyen

не прочитано,
2 июн. 2015 г., 15:38:3902.06.2015
– alche...@googlegroups.com
If you have capistrano-alchemy in your Gemfile only, then you need to run the command with:

$ bundle exec cap production deploy

Otherwise Ruby doesn't now about the Gem. 

Btw. You don't need to have the alchemy tasks in your deploy file. They are executed automatically. It's sufficient to require 'capistrano/alchemy' in your Capfile.

Hope this helps. 


Thomas

Nuno Brito

не прочитано,
3 июн. 2015 г., 04:44:0303.06.2015
– alche...@googlegroups.com
Thank you Thomas,
Yes, it works like you said.
However, I use Rubymine and in that way, I must use the command line to execute that...
My question is: I have many other recipes, from gems:
  •  require 'capistrano/bundler'
  •  require 'capistrano/rails/assets'
  •  require 'capistrano/rails/migrations'
  •  require 'capistrano/passenger'
  •  require 'whenever/capistrano'
And all of them work with "cap production deploy"
But the alchemy doesn't. Is there any detail on the gem that prevents it to act like the other ones?
Or is there some other requirement that prevents it from working the same way?
Thank you for your help and magnificient work. If I can do something to help you, please tell me.
Best regards,
Nuno

Thomas von Deyen

не прочитано,
3 июн. 2015 г., 04:51:5603.06.2015
– alche...@googlegroups.com
The other gems probably work because you installed them via "gem install" not with "bundle install"?

Thomas

Nuno Brito

не прочитано,
3 июн. 2015 г., 05:28:1603.06.2015
– alche...@googlegroups.com
I didn't install them by the command line.
I added them to gemfile and did: bundle install.
Is there any way to use this one as I was using the other? Must I remove the gem??
Thank you

Thomas von Deyen

не прочитано,
3 июн. 2015 г., 05:36:1203.06.2015
– alche...@googlegroups.com
As I said. Please try to remove the require: false argument from the "capistrano-alchemy" gem in your Gemfile and try again. 

Thomas

Nuno Brito

не прочитано,
3 июн. 2015 г., 05:44:0803.06.2015
– alche...@googlegroups.com
So now I have:

group :development do
  gem 'capistrano-alchemy', github: 'AlchemyCMS/capistrano-alchemy', branch: 'master'
  # Use Capistrano for deployment
  gem 'capistrano', '~> 3.2.0'
  # rails specific capistrano funcitons
  gem 'capistrano-rails', '~> 1.1.0'
  # integrate bundler with capistrano
  gem 'capistrano-bundler'
  # integrate bundler with passenger
  gem 'capistrano-passenger'
  gem 'capistrano-rvm'
  gem 'capistrano-faster-assets', '~> 1.0'
end

I ran bundle install, then bundle update.
Capfile:
 require 'capistrano/bundler'
 require 'capistrano/rails/assets'
 require 'capistrano/rails/migrations'
 require 'capistrano/passenger'
 require 'whenever/capistrano'
 require 'capistrano/faster_assets'
 require 'capistrano/alchemy'

Then using the rubymine I ran:

/home/nuno/.rvm/gems/ruby-2.1.6/bin/cap production deploy
(Backtrace restricted to imported tasks)
cap aborted!
LoadError: cannot load such file -- capistrano/alchemy
/home/nuno/Documents/RubymineWorkspace/FarmacoWebStore/Capfile:27:in `<top (required)>'
(See full trace by running task with --trace)

I can't figure out what I am doing wrong...
Sorry to bother.. I am still learning all this stuff...
Thank you Thomas 

Thomas von Deyen

не прочитано,
3 июн. 2015 г., 07:06:1103.06.2015
– alche...@googlegroups.com
Ok. 

The only thing that's different is that you are loading the capistrano-alchemy gem via GitHub. 

I guess that's why Ruby doesn't know where to load the lib from. Only Bundler knows where the gem is. 

That's nothing we can solve now. We need to publish the gem on Rubygems. Unfortunately I am on vacation right know and don't have a computer nearby. So you need to wait until next week. 

Sorry for that. 


Thomas

Nuno Brito

не прочитано,
3 июн. 2015 г., 07:27:1203.06.2015
– alche...@googlegroups.com
Thomas,
Fortunately you are on vacations :)
Ok, I will wait for it. I just tought it was something I was doing wrong.
Thank you Thomas and good vacations ;)
Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений