Comments (5)
You should commit app/etc/config.php
to version control anyway. Not sure if this is something that belongs in deployment.
from capistrano-magento2.
@chaohe There are no plans for this currently, sorry.
The gem expects the app/etc/config.php
file to be committed to the project repository, and that file exists solely for the purpose of maintaining module enabled/disabled state.
The reason it spits out a list of disabled modules on deploy is so that you will know if you've forgotten to run module:enable and commit the config.php changes prior to deploy.
A couple benefits of this are:
-
You can deploy with certain modules disabled.
-
We can deploy with near zero downtime, as the db upgrade commands can be run after all the static content generation has occurred.
-
It ensures all servers in deployments to multiple app servers end up with exactly the same code.
currently what we are doing is just running the deploy without enabling the module, then going directly into the release folder and running the module-related commands again. very clunky and totally defeats the purpose of the awesomeness of capistrano. any thoughts?
Before deploying a module, run the module:enable and commit the changes made to app/etc/config.php. Doing this will ensure the module is enabled on deploy.
You shouldn't have to run anything by hand on the remote server for a deployment, with the exception of having to add an entry to the database for new themes in some cases due to Magento not handling that correctly (see issue #63). We've been using this process for over a year on dozens of M2 sites without any problems. :)
from capistrano-magento2.
@davidalger thanks for explaining. just so i'm understanding correctly, is this your flow?
1.) run module:enable
locally, commit all app/
files plus config.php
change enabling module
2.) during deployment, static-content:deploy
is run first, but it will actually generate static content for the new module (even though the module commands like module:enable
and setup:upgrade haven't been run yet)
3.) the setup:upgrade
step with MODULE => 1
in the config.php
file turns the module on and the new module will work upon deployment completion.
i suppose the 2nd point is where my understanding was lacking?
from capistrano-magento2.
@chaohe That's pretty much it, yes. If a module is listed in config.php, it's considered enabled. So if it is listed in config.php and the db upgrade commands are run (the gem is actually running setup:db-schema:upgrade and setup:db-data:upgrade vs setup:upgrade) then it is correctly installed / upgraded along with all the other modules.
from capistrano-magento2.
Confirmed, that worked! Thanks a ton :)
from capistrano-magento2.
Related Issues (20)
- Do not run show pending updates when capistrano is outside magento git repo HOT 1
- var/reports HOT 2
- Can't install 'capistrano/magento2/cachetool' HOT 2
- [enhancement] Deploy on multiple fronts without recompiling everything on each machine HOT 2
- Catalog product images in production mode delete after deploy HOT 1
- Cached data from current release causes new release to fail with redis caching HOT 6
- Change default path of Composer HOT 2
- Magento still has issues with /pub in sitemap HOT 1
- Change deployment order of DI compile and schema upgrade HOT 2
- Problem with deploy after updated module with SFTP error in setup:di:compile step HOT 5
- Doesn't work with PHP 7.4 and Magento 2..42 HOT 4
- When execute command cap staging deploy
- Issue: Cached metadata/generated files HOT 7
- How to handle initial setup:install HOT 1
- How can I flush cache file on multi server HOT 1
- touch: cannot touch '/var/www/html/releases/20220809134142/pub/static/deployed_version.txt' No such file or directory HOT 1
- Suggestion: Add arbitrary composer_flags or option to run composer with --no-plugins HOT 1
- Capistrano version
- Support for Quality Patches Tool
- When upgrading PHP version, mainenance:enable runs against old codebase, using new php version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capistrano-magento2.