capistrano | A deployment automation tool built on Ruby , Rake , and SSH | Continuous Deployment library
kandi X-RAY | capistrano Summary
kandi X-RAY | capistrano Summary
Capistrano is a framework for building automated deployment scripts. Although Capistrano itself is written in Ruby, it can easily be used to deploy projects of any language or framework, be it Rails, Java, or PHP. Once installed, Capistrano gives you a cap tool to perform your deployments from the comfort of your command line. When you run cap, Capistrano dutifully connects to your server(s) via SSH and executes the steps necessary to deploy your project. You can define those steps yourself by writing Rake tasks, or by using pre-built task libraries provided by the Capistrano community.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Adds a filter to the server .
- Invokes a task .
- Define a file
- Execute a shell call .
- Configures TLS configuration .
- Returns true if the value exists .
- Setup the command .
- Instantiates a new instance .
- Loads the dependencies of the load
- Defines a task .
capistrano Key Features
capistrano Examples and Code Snippets
Community Discussions
Trending Discussions on capistrano
QUESTION
So I have a file not found problem. I have an engine that works in development mode in the engines test/dummy app, the engine allows the editing of sass variables and stores them in a theme table, the variables are used by a sass partial such as _banner.scss containing variables used in the main stylesheet such as $banner_color which is then imported into the main stylesheet which in turn is precompiled using an initializer in the engine.rb file and inclusion in the app/config/engine_name_manifest.js.
The files are all available in development with the local dummy app but not in the eventual host app due to the assets being compiled.
I have a rake task that takes the data, updates the relevant partial e.g. _banner.scss with the data from the theme table but of course the partials are not not available in a host app as the engine has already compiled them. I'm looking for a solution that will allow me to edit the raw, uncompiled stylesheets then recompile them. Obviously my Capistrano deploy script will need to reapply the stylesheet changes every deployment but that is just a rake task call. What approach should I take? Should I find a way to copy the css files to the host app in an engine initializer? Should I use a different approach entirely, I have started looking at propshaft but that is a massive step to replace sass rails and I'm not sure how that would help
The engine
...ANSWER
Answered 2022-Apr-02 at 03:44Thanks for clarifying. If I understood correctly here my take on it.
partials are not not available in a host app as the engine has already compiled them
Partials are still there, precompilation just outputs *.{css/js}
files into public/assets/
that are declared in app/assets/config/manifest.js
.
To get to engines files, instead of Rails.root
use:
QUESTION
I have nginx + nginx unit + django python application , and django project is is deployed by capistrano
deploy.rb
ANSWER
Answered 2022-Feb-25 at 17:46With the latest release you are able to restart the application and let Unit reload the code from the workdir.
QUESTION
I upgrade my ruby version to 2.6.5. I deployed it to my server using capistrano.
But my nginx logs say this:
...ANSWER
Answered 2022-Jan-27 at 22:58Bingo got it working. Thanks to @razvans and @engineersmnky for pointing me in the right direction.
Yes I had references to passenger_ruby
but it was in the wrong place. I had to go to /etc/nginx/sites-available
and add passenger_ruby /path/to/ruby
To find out what the /path/to/ruby
is use passenger-config about ruby-command
and use the value at Command
.
QUESTION
On a brand new digitalocean droplet running Ubuntu 20.10 with a brand new pretty near empty rails 7 alpha 2 app running bundle install
results in the following both when running cap production deploy on my local machine and when running from the command shell on the droplet
ANSWER
Answered 2021-Nov-09 at 14:37I ran into this also. Not sure why, but they yanked the 7.x versions and regressed to 0.8.x:
https://rubygems.org/gems/turbo-rails/versions/7.1.1
Just add this to your Gemfile:
QUESTION
Currently, Rails application is on service.
The environment is following the below.
I'm thinking to introduce React to my app.
But in case of management screen, I want to use Rails.
Because it's already customized a lot and no complaint so far.
I think to introduce React to Rails app is 3way.
- Using Webpacker
- Using Gem(react-rails/react_on_rails)
- Using
create-react-app
From my thinking, 1&2 and 3 have big differences. 1&2 is React renders from Rails View. 3 is React renders independently and Rails is just used for API.
So I have three questions.
- Compare 1&2 and 3, which is faster? Is there big different?
- In case of 3, I think React'host should be 3000, Rails should be 3001. Is it possible to release step by step? Like introducing React only top screen, others are Rails.
- In case of 3, can I use RailsAdmin for management screen?
I have no idea.
Please help me..
ANSWER
Answered 2022-Jan-14 at 08:33I would almost always use the approach number 3, as in using Rails as an API and having admin panel. To achieve this you simply define a different route for all the api endpoints and the admin, don't overthink this. Under the rails port you can put all the API endpoints and a rails admin endpoint. Using Webpacker in rails is still supported but starting with rails 7 it is no longer the default, which means that in case of some problems (which in my experience are frequent with webpacker) you might have a harder time finding some help. Using gems to work with JS frameworks always seems to me like an unnecessary complication, and adding an extra tool to help with a different tool...
Keep both tools to themselves, you can still have both apps in one repository nothing is stoping you from that, but Rails being responsible for the backend and react being the frontend is the most sensible approach IMHO. Nothing stands in a way of using rails app as both the API server and rails admin managment view. It is just a matter of setting up the routes.
QUESTION
My environment is following the below.
Environment Version Rails 7.0.0 Ruby 3.0.0 capistrano 3.16.0 Production environment Amazon EC2 LinuxAfter for while from deploying, I got these logs.
Then deploying stopped, not working anymore.
...ANSWER
Answered 2022-Jan-07 at 17:12The deploy user needs to be a sudo user in order to restart the puma systemctl service.
You can fix the issue by creating new file inside /etc/sudoers.d directory and add this line
QUESTION
I am working on a Ruby on Rails application that uses the gem Private Pub (https://github.com/ryanb/private_pub) to have a real time chat messages feature
This application is hosted in Digital Ocean and chat messages have been working correctly for a long time. However, around 1 and a half month ago it stopped working and I got an error on the console that says: GET https://fake-url.com:9292/faye/faye.js net::ERR_CONNECTION_REFUSED
First thing I did was to restart the Faye server using this command: bundle exec thin -C /data/app/shared/config/private_pub_thin.yml -d -P /data/app/shared/tmp/pids/faye.pid --ssl-disable-verify start (I run this command through Capistrano)
After running that command I checked /data/app/shared/tmp/pids folder and confirmed that faye.pid is there so process seems to be running
Then I ran sudo lsof -i -P -n | grep LISTEN to check open ports and 9292 port is listed
After that I reloaded the chat and got again the net::ERR_CONNECTION_REFUSED error
Then I checked the ports again and port 9292 does not appear on the list
So it seems like everytime I load the pages it closes the port or something like that.
NOTES:
- ufw is not enabled
- We have a staging server where we have the same problem. Only difference is that in staging port 9292 always appears on the list of open ports. However, it throws net::ERR_CONNECTION_REFUSED
- I think this error started to happen after the old Let’s Encrypt Root Certificate expired (https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021) I am not 100% sure about this but I had other problems related to this and I wonder if this error is somehow related to that
- It works fine locally
Thanks in advance!
...ANSWER
Answered 2021-Dec-29 at 14:21I ended up removing Private Pub gem and using Pusher to get the real time updates. Pusher was really easy to use. Thank you all!
QUESTION
I'm trying to deploy ruby on rails application to the Amazon EC2 instance, using puma as an application server, nginx server and capistrano for deployments. Currently I'm stuck with the error message:
nginx logs are not showing any error,
puma logs are also not showing what's the error
I have verified that puma server is started and running, using the following command:
...ANSWER
Answered 2021-Dec-09 at 01:08In my particular case it was due to the stopped REDIS service. The application was configured to utilize REDIS for caching, however REDIS service wasn't running. This wasn't reflected in the logs for some reason and I spent a good amount of time figuring out what was wrong.
QUESTION
I have downloaded a list of all the towns and cities etc in the US from the census bureau. Here is a random sample:
...ANSWER
Answered 2021-Nov-12 at 22:48I have such a solution. And I'm surprised myself that I used two loops for
!! Incredibly, I did it. First things first.
My proposal is based on a simplification. However, the mistake you will make at short distances will be relatively small. But the time gain is huge!
Well, I propose to count the distance in Cartesian coordinates, not spherical.
So we're going to need a simple function that computes the Cartesian coordinates based on the two arguments latitude
and longitude
.
Here is our LatLong2Cart
feature.
QUESTION
Rails 6, Mysql, Ubuntu 20.04 I would like deploy with Capistrano Puma.
I have this error in my website :
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
Error into my log : puma.error.log :
...ANSWER
Answered 2021-Nov-16 at 13:59That error comes from a misconfigured storage.yml
in your environment. You are missing the root
key.
For more information on how to set up ActiveStorage, read here.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install capistrano
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page