Search code examples
gitlabgitlab-cigitlab-api

Gitlab download artifact of matrix job


I am trying to download artifacts from a successful job. The download for a regular job works but the download of of a job matrix is not working.

Any idea how I have to structure the URL for that.

lambda_build: [tools]
lambda_build: [helper] 
lambda-master works with ..../-/jobs/artifacts/master/download?job=lambda-master

I don't find answer in the gitlab documentation.


Solution

  • Executing a matrix job generates a name unique to that pipeline from each variable used, so I think you can't just use the name you gave the job alone.

    For example, when declaring this matrix job:

    myJob: 
      script: echo $FOO
      parallel:
        matrix: 
          - FOO: [bar, baz]
    

    Gitlab will generate two jobs:

    myJob: [bar]
    myJob: [baz]
    

    So you might have to put "build: [$lambda_build]" or something into the query parameter.