0

I'm trying to deploy a simple .html report, which is created after testing, to the Gitlab Pages. Everything is pretty straightforward according to the official documentation however, I'm constantly getting the 404 status when I open the https://DOMAIN/$CI_PIPELINE_ID/$REPORT link (this is an example URL).

I did the same yesterday, and all was relatively good - reports went live, though not for a long time, maybe because new pipeline was overwriting already existing Page.

I have two questions:

1. What may be the reason for a URL to return the 404?

2. Is it possible to keep Pages from previous pipelines still accessible by their URL after a new pipeline succeeds? I used this approach by creating folders with unique titles based on the pipeline ID inside the public/ folder, and put .html files inside. However, I cannot check it because of the 404 status.


public\ folder looks smth like this:

├── public
│   ├── 1234567
│   │   ├──report_1.html
│   ├── 1234568
│   │   ├──report_.html

.gitlab-ci.yml

stages:
  - test
  - publish

cache:
  paths:
    - public

test:
  stage: test
  ...

pages:
  stage: publish
  script:
    - mkdir -p public/$CI_PIPELINE_ID
    - REPORT=$(ls report*.html)
    - cp report* public/$CI_PIPELINE_ID/
  artifacts:
    name: “$CI_PIPELINE_ID”
    paths:
      - public
    expire_in: never
  rules:
    - if: $TASK_NAME == “load_tests”
eftshift0
  • 26,375
  • 3
  • 36
  • 60
Moveton
  • 37
  • 7
  • Do you have setting on regarding only keeping the latest artifact? This one: https://docs.gitlab.com/ee/ci/pipelines/job_artifacts.html#keep-artifacts-from-most-recent-successful-jobs It's by commit, not pipeline, so depending on how often you're running the pipeline, it may or may not help – Arty-chan Oct 08 '22 at 17:25
  • 1
    Thanks for the suggestion @Arty-chan, it is not the case though. What I figured out is I still have to put .html file within the public/ folder directly, otherwise it just doesn't work. – Moveton Oct 10 '22 at 20:18

0 Answers0