Skip to content

[WIP] GitLab pages (EE only)

Kamil Trzcińśki requested to merge gitlab-pages into master

Fixes gitlab-org/gitlab-ce#3085

This is pretty naive approach for having static pages build on artifacts support:

  1. When job named pages is defined in .gitlab-ci.yml the artifacts from this build will be used for serving static pages.
  2. Build job needs to put all served files in public/ and upload artifacts to GitLab.
  3. GitLab detects and fires sidekiq job to unpack artifacts and put them into shared/pages/group/project folder.
  4. We then have nginx config with dynamic virtual host support serving files from shared/pages
  5. On every pages deploy we try to do atomic update using move filesystem operation
  6. If no pages is defined in .gitlab-ci.yml we inject predefined job that is executed for gl-pages branch.

Example .gitlab-ci.yml:

pages:
  image: jekyll/jekyll:builder
  script:
  - jekyll build --destination=public
  artifacts:
  - public/
  only:
  - master

Pros:

  1. By using CI and docker images we can build static webpage with any tools, we are not limited to stripped down Jekyll server as it is on GitHub Pages.
  2. By having Shared Runners it will work out of box on GitLab.com.
  3. By using Docker by default it will work out of box on most installations.

Cons:

  1. We need to build static page on CI and upload it to GitLab and unpack it later - this is time consuming
  2. We serve only static files, no dynamic content allowed

This is proof of concept and misses:

  1. Custom domain names (CNAME? file)
  2. Custom directory with static files, currently public/ is hardcoded
  3. Backup support
  4. Tests support
  5. Documentation how to use it
  6. Disable symlink following for Nginx
  7. Ability to define domain on which the sites will be served.
  8. Think how we should handle custom domains (if we want to have support for them)

The code is not yet nice, I'll make it better if we choose that this is a way how we want to do it.

@sytses @jacobvosmaer @marin @dzaporozhets What do you think?

It's based on build artifacts MR.

Merge request reports