Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
446 views
in Technique[技术] by (71.8m points)

ruby on rails - Why server does not down when capistrano restart puma

My question is knowledge question, it is not for fixing a bug or a task, I see when we use capistrano to deploy application to server, capistrano do many action like, pre complile, migrate, restart puma... I confuse while capistrano is working, my website is still live because I see capistrano need restart puma. I think capistrano make a copy version of web and wait until deployment is finish and switch to new state.

This is a question interview I am asked. So please explain for me.

question from:https://stackoverflow.com/questions/65952000/why-server-does-not-down-when-capistrano-restart-puma

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

From the official source

├── current -> /var/www/my_app_name/releases/20150120114500/
├── releases
│   ├── 20150080072500
│   ├── 20150090083000
│   ├── 20150100093500
│   ├── 20150110104000
│   └── 20150120114500
├── repo
│   └── <VCS related data>
├── revisions.log
└── shared
    └── <linked_files and linked_dirs>

current is a symlink pointing to the latest release. This symlink is updated at the end of a successful deployment. If the deployment fails in any step the current symlink still points to the old release.

releases holds all deployments in a timestamped folder. These folders are the target of the current symlink.

So there you have the reason for your site not going down during deployment, which would completely defeat the purpose of using such a nice tool as Capistrano.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...