V7.4 main changes
DotEnv
Intro
For multisite single-installation the values of some parameters that are site-specific needs to be determined at runtime, when the chosen site is known. For this reason, XalokNext loads environment variables from an (optional) .env
file in the root of the project.
Overwriting values
Variables defined in the .env
file can be overwritten with environment specific values by adding a .env.dev
(in dev
environments) or .env.prod
(in prod
environments) file
Using environment variables
# .env
S3_BUCKET='s3_bucket'
# app/config/parameters/local.yml
parameters:
s3_bucket: '%env(S3_BUCKET)%'
No rehub
Deploy artefacts are built in gitlab's CI using configuration parameters for PRO. The publicUrl
JavaScript config is thus dumped in the webpack's compilation output, using the value from PRO. To change this value on the PRE environment, a replacement of the PRO URL with the PRE one is done through the JavaScript files.
v7.4 replaces this process by dumping the fresh JSON post-deploy and reading it from there:
./app/admin/console --env=prod wf:cms:wf-assets __ADMIN_BASE_URL__ --filter "config.json"
Note: In spite of requiring the __ADMIN_BASE_URL__
argument, this argument is used for generating absolute URLs in the assets, the command does not connect to the webserver, so it can be safely run (and it must be run) before changing the /var/www/sites/enabled
symlink to the new version.