Draft: Enable the usage of any artifact folder name
What does this MR do?
This updates GitLab Pages to allow the artifacts folder to have *any* name.
Behaviour
If the user deploys only a single folder as artifacts, GitLab Pages will use that as the root folder for all requests. For Example, if the Pages pipeline looks like this:
pages:
# ...
artifacts:
paths:
- output
It will serve all files inside the output
folder. The name of the folder is irrelevant as long as it's the only folder in artifacts. It could be called rat-poo
for all Pages cares.
But since artifacts.paths
is a list, it could contain more than one folder. I have yet to discover a usecase why that may be useful, but it was previously allowed, so I'd like to keep the behaviour.
In the case where artifacts.paths
contains more than one folder, it will check for the presence of any of the following folders. These are the output folders generated by the most popular frontend frameworks, ordered by the popularity of the related framework (but public
first, because backwards compatibility):
-
public
(previous GitLab behaviour, Hugo, Gatsby, Svelte) -
build
(React) -
dist
(Vue, Nuxt.js, Angular, Astro, Vite) -
out
(Next.js) -
_site
(Eleventy, Jekyll)
But why not ask the user to provide this as part of the pipeline?
Because
I'd like for pages to get to the stage where it just works, with no need for extra config. And I think by educated guessing we have the opportunity to achieve that. And for the remaining 0.001% there's still the possibility to configure their framework to use one of the preferred output folder names.
TODO
-
I added the Changelog
trailer (e.g.Changelog: feature
) to the commits that need to be included in the changelog -
I added unit tests or they are not required -
I added acceptance tests or they are not required -
I added documentation (or it's not required) -
I followed code review guidelines -
I followed Go Style guidelines
Closes #668 (closed)
Related: gitlab-org/incubation-engineering/jamstack/meta#6 (closed)