Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,329
    • Merge requests 1,329
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #26362
Closed (duplicated) (duplicated)
Open
Issue created Jan 25, 2019 by Brendan O'Leary 🐢@brendan🌻Developer

Arbitrary value (i.e., one-dimensional array or matrix) for parallel jobs

Problem to solve

The parallel option allow you to create multiple copies of the same job with an automatically incremented CI_NODE_INDEX over the jobs we create. However, it could be more useful if I could specify my own array of values for these jobs.

Target audience

Further details

Use cases could include a Node project that has an arbitray set of scripts outside of just npm test or npm build that I want to run. Perhaps I have a package.json with:

"scripts": {
    "clean": "rimraf dist/*",
    "prebuild": "npm run clean -s",
    "build": "npm run build:scripts -s && npm run build:styles -s && npm run build:markup -s",
    "build:scripts": "browserify -d assets/scripts/main.js -p [minifyify --compressPath . --map main.js.map --output dist/main.js.map] | hashmark -n dist/main.js -s -l 8 -m assets.json \"dist/{name}{hash}{ext}\"",
    "build:styles": "stylus assets/styles/main.styl -m -o dist/ && hashmark -s -l 8 -m assets.json dist/main.css \"dist/{name}{hash}{ext}\"",
    "build:markup": "jade assets/markup/index.jade --obj assets.json -o dist",
    "test": "karma start --singleRun",
  },

I could then say at the build stage I want to parallelize it and have it run the scripts ["build", "build:scripts", "build:styles", "build:markup"].

Proposal

We could expand on the matrix keyword to accept a one-dimensional matrix as follows:

deploystacks:
  stage: deploy
  script:
    - bin/deploy
  parallel:
    matrix:
      - PROVIDER: [gcp, vultr]

This would solve this use case in a clear way, using existing features (https://docs.gitlab.com/ee/ci/yaml/#parallel-matrix-jobs).

What does success look like, and how can we measure that?

Links / references

Edited Sep 11, 2020 by Jason Yavorska
Assignee
Assign to
Time tracking