Comments (4)
Very good findings, thanks for sharing! Your notes about it being related to the :db
role not being defined definitely got me on the right track.
The capistrano-pending
gem looks to :capistrano_pending_role
for the role to lookup the current revision on. If that var is unset, it defaults to :db
. So technically not a bug in this gem, certainly not playing nice in all cases, as it would require configuring that gem as well.
I've made changes in the above commit to remedy the issue. In short, I'm setting that role to match the :magento_deploy_setup_role
by default, but still allowing it to be overridden.
Now all of this said… I've been refactoring this code some more, as I was unraveling more issues with how the underlying functionality works (this is why back when you initially PR'd it I didn't want it enabled by default…I feared it would work inconsistently). For example:
-
If REVISION on the server is ahead of the commit being deployed, nothing is reported as being deployed, and the current implementation actually tells the user that the from and to are the same when they are in-fact, definitively NOT the same.
-
Oddities in how the revisions are reported, as the current revision is using the lengthy hash, but the deployed ref is using the symbolic name
-
Potential to incorrectly report pending changes on a multiple node deployment
In my refactoring, I'm discovering there really is very little in the 3rd-party gem which is not being done natively, so very well may remove it as a dependency by the time I'm finished ;)
from capistrano-magento2.
Thanks for spending the time to make fix those issues.
from capistrano-magento2.
Deploying to multiple hosts which no current deployment:
Deploying even changes to multiple hosts:
Deploying a revision behind what's currently deployed:
Deploying a revision behind what's currently deployed (on single host to create disparity for future test run):
Deploying to multiple hosts which with divergent revisions:
No change deployment with the warning; stopped via 'n' input:
Test with one host having nothing to deploy (warning should not show, with deployment continuing automatically):
No change deployment with warning; proceeding via 'y' input:
Just a simple deploy:pending
to check on system works (with no warning since it's not a deploy):
Adding the following to project configuration will disable warning that will show on deployments with no pending changes:
set :magento_deploy_pending_warn, false
There are a couple other default values such as the log format and default role to use set in the defaults.rb as well.
One fringe case which I have not accounted for (and I'm not sure this is a way to account for it very readily): If one is deploying to a different branch than currently deployed, the change log won't show what changes on the current branch are being removed from the server, which could affect deployments where users dynamically change the feature branch being deployed to the same target. An example is the following where the latest commit on the 2.1 branch is currently deployed and cap is asked to deploy from a tag on the 2.0 branch. In that case, the commits from the 2.0 branch will be printed, but the fact that whats currently on the server from the 2.1 branch is ignored:
This should all be rolled out in the next release.
from capistrano-magento2.
Wow, this looks fantastic! Good work on accounting for all of those scenarios.
In regards to the fringe case you mentioned: if the 2nd point in this issue were to be implemented, it seems like it would solve for that use case, as it would warn the user that the deployed branch was being changed and they could do their due diligence to determine the impact of switching branches. I agree with your latest comment on that issue that creating the functionality as a separate Gem might make more sense. My team is managing an M1 project right now and they're frequently deploying different branches and it would be great to be able to pull that functionality into that project.
from capistrano-magento2.
Related Issues (20)
- Version dependencies for capistrano HOT 5
- 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
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.