You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 27, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: CONFIGDOC.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
When you define a [Jenkins™ Pipeline](https://www.jenkins.io/doc/book/pipeline/), wether in the web UI or with a [`Jenkinsfile`](https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#setting-environment-variables), you can use the plugin to run your MATLAB® code or Simulink® models on Jenkins. This guide demonstrates how to configure the plugin and use it in freestyle, multi-configuration, and Pipeline projects.
1
+
When you define a [Jenkins™ Pipeline](https://www.jenkins.io/doc/book/pipeline/), whether in the web UI or with a [`Jenkinsfile`](https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#setting-environment-variables), you can use the plugin to run your MATLAB® code or Simulink® models on Jenkins. This guide demonstrates how to configure the plugin and use it in freestyle, multi-configuration, and Pipeline projects.
2
2
3
3
4
4
-[Configure Plugin in Web UI](#configure-plugin-in-web-ui)
5
-
-[Use MATLAB for Build](#use-matlab-for-build)
5
+
-[Use MATLAB in Build](#use-matlab-in-build)
6
6
-[Specify Build Steps](#specify-build-steps)
7
7
-[Run MATLAB Command](#run-matlab-command)
8
8
-[Run MATLAB Tests](#run-matlab-tests)
@@ -12,12 +12,12 @@ When you define a [Jenkins™ Pipeline](https://www.jenkins.io/doc/book/pipe
12
12
-[Add MATLAB to System Path](#add-matlab-to-system-path)
-[Use MATLAB for Matrix Build](#use-matlab-for-matrix-build)
15
+
-[Use MATLAB in Matrix Build](#use-matlab-in-matrix-build)
16
16
17
17
## Configure Plugin in Web UI
18
-
You can use the web UI provided by Jenkins to configure the plugin in freestyle and multi-confiuraton projects. To run MATLAB or Simulink in a Pipeline project, see [Set Up Pipeline Project](#set-up-pipeline-project).
18
+
You can use the web UI provided by Jenkins to configure the plugin in freestyle and multi-configuration projects. To run MATLAB or Simulink in a Pipeline project, see [Set Up Pipeline Project](#set-up-pipeline-project).
19
19
20
-
### Use MATLAB for Build
20
+
### Use MATLAB in Build
21
21
Once you install the plugin, **Use MATLAB version** appears in the **Build Environment** section of the project configuration window.
@@ -109,7 +109,7 @@ You can define several axes in the **Configuration Matrix** section. For example
109
109
* A multi-configuration project creates a separate workspace for each user-defined axis value. If you specify the full paths to where MATLAB is installed as axis values, Jenkins fails to create separate workspaces and fails the build.
110
110
111
111
## Set Up Pipeline Project
112
-
When you define your Pipeline with a `Jenkinsfile`, the plugin provides you with a step to run MATLAB scripts, functions, and statements. The plugin also provides a step to run MATLAB and Simulink tests. (These steps are common to both Declarative and Scripted Pipeline.)
112
+
When you define your Pipeline with a `Jenkinsfile`, the plugin provides you with a step to run MATLAB scripts, functions, and statements. The plugin also provides a step to run MATLAB and Simulink tests. (These steps are common to both Declarative and Scripted Pipelines.)
113
113
114
114
To configure the plugin for a Pipeline project:
115
115
1) Define your Pipeline in a `Jenkinsfile` in the root of your repository.
@@ -120,9 +120,9 @@ To configure the plugin for a Pipeline project:
120
120
You also can define your Pipeline directly in the project configuration window. If you select **Pipeline script** from the **Definition** drop-down menu, you can author your Pipeline code in the **Script** box. When you define your Pipeline this way, your Pipeline must include an additional stage to check out MATLAB code from source control.
121
121
122
122
### Add MATLAB to System Path
123
-
When Jenkins executes your Pipeline, it invokes the first MATLAB instance on the system path. If the PATH environment variable of the build agent does not inculde any MATLAB instances, you must update the variable with the MATLAB root folder that should be used for the build.
123
+
When Jenkins executes MATLAB-related steps in your Pipeline, it uses the first MATLAB instance on the system path. If the PATH environment variable of the build agent does not include any MATLAB instances, you must update the variable with the MATLAB root folder that should be used for the build.
124
124
125
-
To update the system PATH environment variable using Declarative Pipeline syntax, use an `environment` block in your `Jenkinsfile`. For example, prepend MATLAB R2019a to the system PATH enviroment variable and use it to run your command.
125
+
To update the system PATH environment variable using Declarative Pipeline syntax, use an `environment` block in your `Jenkinsfile`. For example, prepend MATLAB R2019a to the system PATH environment variable and use it to run your command.
126
126
127
127
```groovy
128
128
pipeline {
@@ -154,7 +154,7 @@ node {
154
154
```
155
155
156
156
### Use `runMATLABCommand` Step
157
-
Use the `runMATLABCommand` step in your Pipeline to run MATLAB scripts, functions, and statements tailored to your specific needs. You can use this task to flexibly customize your test run or add a build step to your pipeline.
157
+
Use the `runMATLABCommand` step in your Pipeline to run MATLAB scripts, functions, and statements tailored to your specific needs. You can use this task to flexibly customize your test run or run any MATLAB commands.
158
158
159
159
You must provide `runMATLABCommand` with a string that specifies the command you want to execute. If the command is the name of a MATLAB script or function, do not specify the file extension. If you specify more than one MATLAB command, use a comma or semicolon to separate the commands.
160
160
@@ -219,7 +219,7 @@ node {
219
219
}
220
220
```
221
221
222
-
To generate artifacts using the `runMATLABTests` step, provide the step with one or more name-value pair arguments to specify the artifacts and the locations to save them. Use a colon to Separate names and values.
222
+
To generate artifacts using the `runMATLABTests` step, provide the step with one or more name-value pair arguments to specify the artifacts and the locations to save them. Use a colon to separate names and values.
223
223
224
224
For example, define a Declarative Pipeline to run the tests in your MATLAB project automatically, and then generate a JUnit test results report and a Cobertura code coverage report at specified locations on the build agent.
225
225
@@ -262,8 +262,8 @@ node {
262
262
| modelCoverageCobertura | Path to write model coverage report in Cobertura XML format (requires Simulink Coverage™ license and is supported in MATLAB R2018b or later).<br/>**Example:**`'model-coverage/coverage.xml'`|
263
263
264
264
265
-
## Use MATLAB for Matrix Build
266
-
Similar to multi-configuration projects, you can use the plugin to perform [matrix](https://www.jenkins.io/doc/book/pipeline/syntax/#declarative-matrix)builds in Pipeline projects. For example, you can define a Declarative Pipeline to run your test suite on different platforms or against different versions of MATLAB. (Matrix build is not supproted in Scripted Pipelines.)
265
+
## Use MATLAB in Matrix Build
266
+
Similar to multi-configuration projects, you can use MATLAB as part of a [matrix](https://www.jenkins.io/doc/book/pipeline/syntax/#declarative-matrix)build in Pipeline projects. For example, you can define a Declarative Pipeline to run your test suite on different platforms or against different versions of MATLAB. (Matrix build is not supported in Scripted Pipelines.)
267
267
268
268
Your Pipeline must have a `matrix` section to define the possible name-value combinations that should run in parallel. This example shows how to define a Pipeline to run your MATLAB code and generate test artifacts using MATLAB R2018b, R2019a, and R2020a.
269
269
@@ -275,11 +275,11 @@ pipeline {
275
275
matrix {
276
276
agent any
277
277
environment {
278
-
PATH = "C:\\Program Files\\MATLAB\\${VERSION}\\bin;${PATH}" // Windows agent
278
+
PATH = "C:\\Program Files\\MATLAB\\${MATLAB_VERSION}\\bin;${PATH}" // Windows agent
0 commit comments