Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grab all artifacts from gitlab-ci dir and make them an artifact

I am trying to display all the artifacts .html files in a specific directory: $TOOLS_PATH/terraform_results/html that are generated during a build job stage when my gitlab pipeline is run.

when this is run in the gitlab pipeline I get a warning: Uploading artifacts... WARNING: tools/terraform_results/html/*: no matching files

I'm invoking this via gitlab-ci.yml file via:

  artifacts:
    paths:
    - "$TOOLS_PATH/terraform_results/html/*"

What am i doing wrong?

like image 250
Jshee Avatar asked Oct 21 '25 14:10

Jshee


2 Answers

Drop the quotes and wildcard, and indent the paths list. This will zip everything in the html folder. You can use wildcards like *.html to filter filenames if needed:

artifacts:
    paths:
      - $TOOLS_PATH/terraform_results/html/

If that doesn't work, read the gitlab-ci.yml reference on artifacts:paths to make sure you didn't miss anything. For example:

Paths are relative to the project directory ($CI_PROJECT_DIR) and can’t directly link outside it.

Make sure the tools directory is located in the root of your project directory. You can confirm the directory exists by adding ls $CI_PROJECT_DIR to your scripts section and checking the runner logs.

like image 133
DV82XL Avatar answered Oct 23 '25 09:10

DV82XL


For .html only files

artifacts:
  paths:
    - $TOOLS_PATH/terraform_results/html/*.html
like image 43
Miguel Trejo Avatar answered Oct 23 '25 09:10

Miguel Trejo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!