Move pages_path_prefix to pages.path_prefix
What does this MR do and why?
Move pages_path_prefix to pages.path_prefix
After some conversation about how to enable pages multiple jobs, we decided to, for now, only rename the pages_path_prefix
to pages.path_prefix
.
pages_path_prefix
was introduced as a root job option, but now that we the vision that we want to concentrate all pages
build options under the same pages:
option for better organization and discoverability.
This will not have any impacts as the pages_path_prefix
options is currently behind a disabled feature flag and undocumented. The documentation will be added on another MR.
Related to:
- Enable multiple pages jobs (#427755 - closed)
- Improve `pages:` job option to be less verbose (#428018)
FAQ
-
Why are we adding a
pages
option that can only be used on jobs namedpages
?Yes, this is a bit weird at first, but this is a step towards Enable multiple pages jobs (#427755 - closed). In intend to replace the job name requirement by this new
pages
option. -
Shouldn't we be updating documentation as well?
The original
pages_path_prefix
documentation MR ( !130314 (merged)) wasn't finished when we decided to rename the field. So, I'll update that MR once this is merged with all the new information.
Screenshots or screen recordings
Screen_Recording_2023-10-17_at_18.51.08
How to set up and validate locally
-
You need a license (https://about.gitlab.com/handbook/developer-onboarding/#working-on-gitlab-ee-developer-licenses)
-
You need GitLab Runner (https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/runner.md?ref_type=heads)
-
Enable
pages_multiple_versions_setting
feature flag -
Create a public project (to avoid having to configure private access) using the
html
template (root/html
for example`) -
Run the pipeline on that project (to ensure the pages is created)
-
Navigate to
Settings > Pages
(http://gdk.test:3000/root/html/pages, for example)- Disable
Force HTTPS (requires valid certificates)
- Enable
Use multiple versions
- [optional] Click on the
Access pages
URL to see your GitLab Pages site👀
- Disable
-
Edit your
gitlab-ci.yml
adding thepages_path_prefix
to thepages
job:pages: stage: deploy pages: path_prefix: '$CI_COMMIT_BRANCH' # mr<iid>, like `mr123` script: - echo 'Nothing to do...' artifacts: paths: - public only: - master
-
Run the pipeline again
-
Go to rails console (
bundle exec rails console
) and check if the lastPagesDeployment
has the given prefix:[dev](main)> PagesDeployment.last.path_prefix => "master"
-
Success!
🎉
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.