How to Use the `Run Pipeline` `File` Value to Provide a Custom File

Situation

Hello! I’m currently working on trying to create a manually executed pipeline in GitLab that will allow my team members to submit a custom csv file, so that execution is possible using the Run Pipeline button.

To get to the Run Pipeline button all you have to do is go to your repository, then select CI/CD > Pipelines > Run Pipeline in the top right
image

Problem

The issue here is that when I select Run Pipeline I’m given a option to set a Variable or a File

As a result of this, it has created a perception that I can submit a file dynamically when running the task.

However that doesn’t seem to be the case, because it’s only a text field that I can enter text into:

Resources Used

I’ve seen the .gitlab-ci.yaml file, but I don’t see anything specific about the Run Pipeline option.

I’ve also looked at the include section where I was assuming it would elaborate on this.

I can’t find any documentation that clarifies the Run Pipeline feature. And, I can’t find any documentation that clarifies File variable option when running a pipeline!

Questions

  • Where is the documentation for Run Pipeline feature
  • How does the File variable work for the Run Pipeline feature
  • Is it possible to dynamically provide a file when using the Run Pipeline feature

Hi, the docs seem to be on:

I have the same requirement as the original poster.

I want to run a pipeline “manually” and upload a file as part of file variable.
And there seems to be no way for doing this.

The links provided by @bartj contain the answer, specifically the section labelled Use file type CI/CD variables:

Use file type CI/CD variables for tools that need a file as input. The AWS CLI and kubectl are both tools that use File type variables for configuration.

For example, if you are using kubectl with:

  • A variable with a key of KUBE_URL and https://example.com as the value.
  • A file type variable with a key of KUBE_CA_PEM and a certificate as the value.