Link in readme.md to a single artifact (.png file) created by a CI/CD runner

Describe your question in as much detail as possible:
Use case: I have a CI/CD pipeline that generates a number of files. One of the files is dot_inline_dotgraph_1.png . I would like to link to that png file in the README.md file like this: state-machine

This causes two problems:

  1. I can manually download a zip file with assets here: Sign in · GitLab This url contains the jobnumber. I don’t know how to link to the output of the job that was triggered by the current commit.

  2. The assets mentioned in 1) are inside a zip file. How can I link to dot_inline_dotgraph_1.png specifically?

  • What are you seeing, and how does that differ from what you expect to see?

  • Consider including screenshots, error messages, and/or other helpful visuals
    After the script has run, I can download a zip file with the artifacts


    The contents of the zip file:

  • What version are you on? Are you using self-managed or GitLab.com?
    I am using a self-managed version of gitlab to run the CI/CD script, (as I’m unable to run them on www.gitlab.com because I don’t have a credit card.)

GitLab Community Edition 14.6.0

I don’t know how to get the version number of the runner.

  • Add the CI configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml)

Here’s a copy of my repository:

.gitlab-ci.yml:

# This file is a template, and might need editing before it works on your project. 
# use the official gcc image, based on debian 
# can use verions as well, like gcc:5.2 
# see https://hub.docker.com/_/gcc/ 
image: gcc

variables:
    GIT_SUBMODULE_STRATEGY: recursive #https://docs.gitlab.com/ee/ci/git_submodules.html

deploy:
  stage: deploy
  before_script:
     - apt update && apt -y install doxygen graphviz
  script:
     - doxygen
  artifacts:
    paths:
     - ./html/dot_inline_dotgraph_1.png
#     - ./html/index.html
  • What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

Thanks for taking the time to be thorough in your request, it really helps! :blush:

I found an article describing exactly what I need:

I was able to download artifacts.zip with this link:
Sign in · GitLab (artifacts.zip)
The zip file did contain one file: html\dot_inline_dotgraph_1.png

I didn’t find the link to download only dot_inline_dotgraph_1.png All three of the below links yielded error 404:
Sign in · GitLab (error 404)
Sign in · GitLab (error 404)
Sign in · GitLab (error 404)

Here are the links again but this time I’ve added some spaces, so they are not resolved by the forum software:
h t t p s://git.lumc.nl/crldewijs/markdown-test/-/jobs/artifacts/main/download?job=deploy (artifacts.zip)
h t t p s://git.lumc.nl/crldewijs/markdown-test/-/jobs/artifacts/main/raw/review/dot_inline_dotgraph_1.png?job=Deploy (error 404)
h t t p s://git.lumc.nl/crldewijs/markdown-test/-/jobs/artifacts/main/raw/review/dot_inline_dotgraph_1.png?job=deploy (error 404)
h t t p s://git.lumc.nl/crldewijs/markdown-test/-/jobs/artifacts/main/raw/review/html/dot_inline_dotgraph_1.png?job=deploy (error 404)

This is a working link to the .png file from a specific job run:
h t t p s://git.lumc.nl/crldewijs/markdown-test/-/jobs/12563/artifacts/file/html/dot_inline_dotgraph_1.png (dot_inline_dotgraph_1.png)

How do I rewrite this link so it always points to the latest job run?

I found the solution:
h t t p s://git.lumc.nl/crldewijs/markdown-test/-/jobs/artifacts/main/raw/html/dot_inline_dotgraph_1.png?job=deploy


The corresponding README.MD:

# markdown-test

![graph](https://git.lumc.nl/crldewijs/markdown-test/-/jobs/artifacts/main/raw/html/dot_inline_dotgraph_1.png?job=deploy)