New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CDN assets for SaaS in OCP #3199
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The CDN url must be hardcoded at settings.yml:asset_host during assets compilation in order to get static assets like CSS files point to the CDN. Otherwise, the assets are generated with relative paths and are not loaded from the CDN, even when settings.yml:asset_host is set during runtime. We don't want to have to provide any CDN url when building porta docker images in order to get the assets correctly precompiled. To avoid that, this trick assumes the assets are generated with relative paths (settings.yml:asset_host = null during compilation time) and prepends the CDN url in runtime. By default, settings.yml:asset_host is set to RAILS_ASSET_HOST, which makes this env variable the only source of truth for CDN urls.
Co-authored-by: Aleksandar N. Kostadinov <akostadinov@gmail.com>
We're not going to merge until SaaS is moved to OCP
In order to be able to load both Sprockets and Webpacker assets from a CDN, the asset host property must be empty during the webpack assets compilation time. This ensures urls are generated as relative paths and webpack can safely prepend the CDN url to them.
This reverts commit 2c3e4a8
# Conflicts: # package.json # yarn.lock
This was referenced Feb 15, 2023
jlledom
changed the title
[DO NOT MERGE] CDN Fix for OCP staging
Fix CDN assets for SaaS in OCP
Feb 23, 2023
mayorova
approved these changes
Feb 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rebase #3085 and #3072 to
master
and fix merge conflicts.This solves THREESCALE-7522