Potential issues when deploying with capistrano #198
rachitpant
started this conversation in
General
Replies: 1 comment 1 reply
-
About builds being skipped, you should ensure that either:
Regarding About the third problem, if you avoid setting I'm not available for further advice regarding the particulars of a Capistrano-based deployment. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description 📖
Thank you for your help yesterday and for this gem in general. I am trying to deploy a rails application that I migrated from webpacker to vite to our staging environment. I was able to deploy a working copy but there are some issues with the contents of public directory on the server that I have tried to describe below. You will notice my
publicOutputDir
is""
. I am not sure if the following are actually issues so I have started this discussion and not opened a bug.Vite Ruby Info
Details 📜
Problem 1
When watched files have not changed and you try to deploy with capistrano, vite build would not build new assets and deploy existing contents within the public directory. There is a false assumption that the contents of last build would reside locally in public directory. Thats true only if you build locally with a command like
RAILS_ENV=staging DEBUG=vite-plugin-ruby:* bin/vite build
.However when deploying with a capistrano deploy script , the assets are directly generated on the server and
In this scenario, the public directory in the release folder on the deployment server will not include the manifest files.
Problem 2
If there are existing files in the public directory ( eg. robots.txt ) , those files would not get deployed on the server in case of a successful vite build. Please see the screenshot below. You can see the manifest files and the assets generated by vite , but the existing public files are not present.

On the other hand when vite doesn't actually build because watch files haven't changed, you can find the existing public files on the server but no manifest files. ( essentially this is same as problem 1 , described above)

Ideal scenario
Ideally, both the existing static files on the src public folder (eg. robots.txt ) as well as manifest files should get generated every time on the server public directory irrespective of whether the watched files have changed or not. It shouldn't be an either/or scenario. Right now the result is one of the above two screenshots.
Problem 3.
When vite does a build ( either the first time or watch files have changed ) , it recreates the assets folder instead of following an existing symlink to the shared assets directory if there is one ( by default capistrano does this ) .
If you compare the two screenshots above, you will notice in the first screenshot vite-ruby replaced has replaced the assets symlink with a new assets folder and generated the assets there.
Beta Was this translation helpful? Give feedback.
All reactions