Application Upgrade Using Pre-Built Assets
This guide shows how to configure the OroCloud environment to run the upgrade without assets build and how to store pre-built assets in a git repository.
To make OroCloud skip the assets build during the upgrade, override upgrade commands in the orocloud.yaml file:
1 2 3 4 5 6
--- orocloud_options: deployment: upgrade_commands: - 'oro:platform:update --skip-assets' - 'assets:install'
oro:platform:update --skip-assetscommand runs the upgrade process without assets build.
assets:installcommand installs assets that are served directly, and should not be built. This operation is fairly quick.
Store Pre-Built Assets in a Git Repository
When the application is ready to be released, follow the two steps outlined below:
Build assets locally:
php bin/console oro:assets:build --env=prod
Make sure you build assets in prod environment without
--skip-*options. Otherwise, assets may be incomplete and not ready for the production use.
Add built assets to the git repository.
In OroCommerce and OroCRM 4.1 and higher, built assets are placed in the public/ folder. By default, they are added into the .gitignore file and not tracked by git.
If you want to add them to the git repository, you have two options:
Remove the following lines for the .gitignore file to track changes on the built assets:
/public/js /public/build /public/layout-build /public/media/js
Force the addition of the built assets to the git repository when they are ready.
git add -f public/build public/layout-build public/js/oro.locale_data.js public/media/js
To avoide a large number of changed files during development, it is recommended that you do not store pre-built assets in the dev branches and add them only to the release branches or tags.
After pushing pre-built assets to the git repository, you can run an upgrade with one of the maintenance commands.