Skip to content

Commit

Permalink
Micro-optimized the pre-deployment version check #77
Browse files Browse the repository at this point in the history
  • Loading branch information
davidalger committed Aug 18, 2017
1 parent 17d0ffc commit d2af120
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- [x] Remove duplicate composer install command (2.1 and newer support deployment using --no-dev); see davidalger/capistrano-magento2#76
- [ ] Verify 2.1.1 and newer deployment ability
- [ ] Verify 2.2-RC2.0 deployment ability
- [ ] Verify 2.1.0 and older throw version check error and halt deployment
- [x] Verify 2.1.0 and older throw version check error and halt deployment
- [ ] Ensure static content deploy is correctly deploying both secure and insecure versions of require js config file (preferably eliminate double runs here)
- [ ] Update README to reflect new minimum version requirement for Magento

Expand Down
5 changes: 3 additions & 2 deletions lib/capistrano/tasks/magento.rake
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ namespace :magento do
task :version_check do
on release_roles :all do
within release_path do
unless magento_version >= Gem::Version.new('2.1.1')
_magento_version = magento_version
unless _magento_version >= Gem::Version.new('2.1.1')
error "\e[0;31mVersion 0.7.0 and later of this gem only support deployment of Magento 2.1.1 or newer; " +
"attempted to deploy v" + magento_version.to_s + ". Please try again using an earlier version of this gem!\e[0m"
"attempted to deploy v" + _magento_version.to_s + ". Please try again using an earlier version of this gem!\e[0m"
exit 1 # only need to check a single server, exit immediately
end
end
Expand Down

0 comments on commit d2af120

Please sign in to comment.