Matrix Build
Run a job once for every combination of parameter values. This example expands two database values (Oracle, MySQL) and two operating-system values (Linux, Windows) into four builds whenever main is updated.
Configure the Job
Edit .onedev-buildspec.yml and add a job named matrix.
-
In Params & Triggers / Parameter Specs, define two required Text parameters:
dbandos.
-
Add a Branch update trigger. Set Branches to
main(or your branch name). Fordb, choose Use specified values and addOracleandMySQLas separate values. Foros, addLinuxandWindowsas separate values.
-
Add an Execute Commands step. To verify expansion, enable Run In Container, use image
alpine:3.22, select POSIX Compatible Shell with shellsh, and enter:echo 'db=@param:db@ os=@param:os@'
This command only prints the chosen values. An os parameter does not select an agent's operating system, and a db parameter does not start a database. For actual cross-platform tests, configure suitable executors/agents and database services, and use the parameters in their selection or in your test commands.
Verify the Matrix
Commit the specification to the configured branch. Open Builds, filter by "Job" is "matrix", and use Display Params to show db and os.
Verify four builds: Oracle/Linux, Oracle/Windows, MySQL/Linux, and MySQL/Windows. Open their logs to confirm each command received its corresponding values.
