Introduce configuration value for mounts
What does this MR do?
Adds support for a 'mounts' entry to the Static Site Editor config file.
See #241166 (closed) for more details and discussion.
See the links
and link
Entry
classes in lib/gitlab/ci/config/entry/release/assets/links.rb
for an existing example of a similar array-of-hashes config value in the CI config (#36133 (closed))
Description
This config value takes inspiration from the approach Hugo ended up with in their module
/mounts
approach:
- The configuration is an array, with entries consisting of
source
+target
value pairs. - The
source
value of an entry is the path relative to the project root. - The
target
value is where the content relative to the source should considered to be mounted, relative to the web root. - Other relevant links on the Hugo virtual filesystem and modules/mounts:
So, using an examples from our current repo where we have can have two or more different content roots for Middleman in our monorepo structure, it would be something like this (using the Hugo "mounts" terminology):
mounts:
- source: sites/handbook/source
target: ''
- source: source/images
target: images
Config File Entry Syntax Details
Types:
mounts:
- source: <string>
target: <string>
- ...
Default Values:
- Ideally, the default value should be determined based on the
static_site_generator
config value, and be a single array entry with the source and target following the out-of-the box defaults for the corresponding tool (middleman, hugo, etc). This can be deferred to the future, though.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required) (Will be provided in a subsequent MR)
-
Code review guidelines -
Merge request performance guidelines
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Related Issues and MRs
- Depends on (and rebased on, until merged) !43481 (merged)
- Related #241166 (closed)
Edited by Chad Woolley