production
production copied to clipboard
Best practice vcs/git + updates
Hello all,
I have a question about using the shopware/production template with GIT.
Currently, I do so that I copy the content of the shopware/production and copy it into a separate repo. In this repo then come all plugins and themes that are necessary for this store. I do this because it is extremely important that the complete composition (plugins, theme and shopware versions) is completely the same on all systems (local, stage, live). If I have for example local and live different plugins, then certain bugs may occur or not occur.
But if it now comes to an update of Shopware, then the workflow is not really good. I have not yet found a clean way and so far no one could propose me an optimal way. Therefore, I wanted to ask here how you do it or what the best practice is.
When updating, I now copy the "new" content from shopware/production back into my own repo, so that the composer.json, bin/* files etc. are updated. I find this step not very optimal.
I imagine the update of shopware something like this: Adjust version number in composer.json. Run composer update/install. Done.
But this is unfortunately not possible, because in the current shopware/production template are many contents, which can change with an update. E.g. the scripts in the composer.json, files in the config and bin folder.
Shouldn't all things that can change when updating shopware be in a separate repo?
I know that this is only a template. But that doesn't help if the template potentially changes with every Shopware update. Maybe I'm going about this way completely wrong, but unfortunately there are no best practices for this on the internet or from Shopware itself.
Best regards, Leon
Hello all,
Same here - the workflow is not really good - and risky b/c of the manual merges.
Because this is a template I would suggest to create a symfony recipe for that - would this be possible? So updates of the template can be done via composer - and the needed local changes are "normal" git workflow as defined by symfony flex?
Best Stefan
I have this repo and my own repo as remotes and when I want to update, i pull the changes from this repo and merge it into my repo. It's big headache too, but it's working. But it would be really awesome, when there would be some docs released on how to do it the proper way.
we are currently moving many things from the production template to the platform repository. I guess it will be better in the future and you do not need to adjust the production template at all. maybe @keulinho or @pweyck can give you more insights
Any updates on this topic? I was searching for an optimal solution myself and it seems this is still the way to go, right?
We are working on a new template to use Symfony Flex to mange the comoposer project. It makes it much simpler to use.
See for the new workflow: https://github.com/shopware/docs/pull/760/files#diff-2525a2629f134228fc7d55615d5fbb517990de2c6ff9de903d5522d9fd25acf7