4

We have started development on a Magento CE 2.2.5 and installed theme / modules and custom module. We are working with local project/server versioned with GIT.

The gitignore file specify to not look in vendor folder.

I want to modify one time files on my local project then deploy changes thought a commit on the server and work for all developers. Is it possible ?

  • If a download 2.2.6 source files from Magento website and override file in the GIT project, it will override composer.json and
    composer.lock in which custom modules dependencies are specified.
  • If I run magento command from my local side, I think all developers have to run command and GIT project should blow up with local files
    changes made by the upgrade.

How could I process ?

Should I merge composer.json and composer.lock with 2.2.6 composer files then commit override core files and run composer upgrade on server and local projects ?

Update 2018-10-15 :

After a long search, finally I gave up the main idea to only run cmd on my local side, commit and deploy without more actions from others :) Find below the procedure I have followed :

  • Save composer.json and composer.lock files version 2.2.5
  • Modify gitignore file and exclude composer.json and composer.lock files
  • Update locally your version of Magento from 2.2.5 to 2.2.6 following the procedure described on the official Magento website : https://devdocs.magento.com/guides/v2.0/comp-mgr/cli/cli-upgrade.html
  • Git commit and push all changes in the Magento core files on the development server
  • Git pull on the server. Re add composer files previously saved (2.2.5).
  • Run Magento update procedure with composer. As the gitignore file specify to not look in vendor folder, there is no conflict.

After this, your local version and server version of Magento should be 2.2.6

Then for the team :

  • If there is an existing version, this is the same way as the local update (save composer files, pull git, re add composer files 2.2.5 and update to 2.2.6)
  • If this a new project, sync the project, add composer files already in 2.2.6 (copy from server) then install with composer install cmd.
0

Run below commands

composer require magento/product-community-edition 2.2.6 --no-update
composer update
rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/*
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade

Now commit composer.json and composer.lock file and push it in git Then take pull in another environment and then run below command

composer install

Hope this helps you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.