Main reasons and how to overcome the read only limitation:
Case 1: Static Content Symlinks Enabled
The file "/app/pub/static/frontend/Pearl/weltpixel_custom/en_US/css/styles-l-temp.css" cannot be deleted Warning!unlink(/app/pub/static/frontend/Pearl/weltpixel_custom/en_US/css/styles-l-temp.css): Read-only file system : default
In some cloud environments,
pub/static
can be symlinked during the deployment to a folder outside the Magento application folder, which is why this folder is read-only and theme Less/Css files cannot be regenerated under /pub/static/frontend/Pearl/weltpixel_custom/en_US/css/.You can get the 'pub/static' folder to be writable by disabling the static content symlink. Create
STATIC_CONTENT_SYMLINK
variable as you can see in the picture.STATIC_CONTENT_SYMLINK : false

The folder pub/static will now be writable, but deployment time will be increased due to copying static during the deployment. When you go live, you can enable symlinks on the Production environment for faster deployments but for staging and development we suggest removing symlinks in order to be able to regenerate theme LESS/CSS files.
Please refer to DevDocs for more details regarding symlinks:
https://devdocs.magento.com/guides/v2.2/cloud/env/variables-deploy.html#static_content_symlink
https://devdocs.magento.com/guides/v2.2/cloud/env/variables-deploy.html#static_content_symlink
Related articles: https://support.magento.com/hc/en-us/articles/360000338413-Error-running-setup-static-content-deploy-manually-deployed-version-txt-is-not-writable-
Case 2: Deployment hooks
Try setting the deployment hooks in the deploy/ post-deploy phase instead of the build phase.
hooks:
# We run build hooks before your application has been packaged.
build: |
php ./vendor/bin/ece-tools build:generate
php ./vendor/bin/ece-tools build:transfer
# We run deploy hook after your application has been deployed and started.
deploy: |
php ./vendor/bin/ece-tools deploy
# We run post deploy hook to clean and warm the cache. Available with ECE-Tools 2002.0.10.
post_deploy: |
php ./vendor/bin/ece-tools post-deploy
php ./bin/magento weltpixel:less:generate
php ./bin/magento weltpixel:css:generate --store=default
# We run build hooks before your application has been packaged.
build: |
php ./vendor/bin/ece-tools build:generate
php ./vendor/bin/ece-tools build:transfer
# We run deploy hook after your application has been deployed and started.
deploy: |
php ./vendor/bin/ece-tools deploy
# We run post deploy hook to clean and warm the cache. Available with ECE-Tools 2002.0.10.
post_deploy: |
php ./vendor/bin/ece-tools post-deploy
php ./bin/magento weltpixel:less:generate
php ./bin/magento weltpixel:css:generate --store=default
Comments
0 comments
Please sign in to leave a comment.