2021-12-22 16:34:36 +02:00
metadata :
name : gradleExecuteBuild
description : This step runs a gradle build command with parameters provided to the step.
2023-04-24 09:09:31 +02:00
longDescription : This step runs a gradle build command with parameters provided to the step.Supports execution of gradle tasks with or without wrapper.Gradle tasks and flags can be specified via 'task' or 'buildFlags' parameter. If both are not specified 'build' task will run by default.
2021-12-22 16:34:36 +02:00
spec :
inputs :
params :
- name : path
aliases :
- name : buildGradlePath
deprecated : false
type : string
2022-03-21 11:17:03 +02:00
description : Path to the folder with build.gradle (or build.gradle.kts) file which should be executed.
2021-12-22 16:34:36 +02:00
scope :
- PARAMETERS
2022-01-24 16:08:39 +02:00
- STAGES
2021-12-22 16:34:36 +02:00
- STEPS
mandatory : false
- name : task
type : string
2023-04-24 09:09:31 +02:00
description : A single gradle task that should be executed. If you prefer more than one, use 'buildFlags' parameter. If 'buildFlags' parameter is specified, this parameter will be ignored.
2021-12-22 16:34:36 +02:00
scope :
- PARAMETERS
- STAGES
- STEPS
mandatory : false
default : build
2022-04-14 14:59:09 +02:00
- name : publish
type : bool
description : Configures gradle to publish the artifact to a repository.
scope :
- STEPS
- STAGES
- PARAMETERS
default : false
- name : repositoryUrl
type : string
description : Url to the repository to which the project artifacts should be published.
scope :
- GENERAL
- PARAMETERS
- STAGES
- STEPS
resourceRef :
- name : commonPipelineEnvironment
param : custom/repositoryUrl
- name : repositoryPassword
type : string
description : Password for the repository to which the project artifacts should be published.
scope :
- GENERAL
- PARAMETERS
- STAGES
- STEPS
secret : true
resourceRef :
- name : commonPipelineEnvironment
param : custom/repositoryPassword
- name : repositoryUsername
type : string
description : Username for the repository to which the project artifacts should be published.
scope :
- GENERAL
- PARAMETERS
- STAGES
- STEPS
secret : true
resourceRef :
- name : commonPipelineEnvironment
param : custom/repositoryUsername
2022-03-21 11:17:03 +02:00
- name : createBOM
type : bool
description : Creates the bill of materials (BOM) using CycloneDX plugin.
scope :
- GENERAL
- STEPS
- STAGES
- PARAMETERS
2022-04-14 14:59:09 +02:00
- name : artifactVersion
type : string
description : Version of the artifact to be built.
scope :
- GENERAL
- PARAMETERS
- STAGES
- STEPS
resourceRef :
- name : commonPipelineEnvironment
param : artifactVersion
- name : artifactGroupId
type : string
description : The group of the artifact.
scope :
- PARAMETERS
- STAGES
- STEPS
resourceRef :
- name : commonPipelineEnvironment
param : groupId
- name : artifactId
type : string
description : The name of the artifact.
scope :
- PARAMETERS
- STAGES
- STEPS
resourceRef :
- name : commonPipelineEnvironment
param : artifactId
2022-06-07 10:24:10 +02:00
- name : useWrapper
type : bool
description : If set to false all commands are executed using 'gradle', otherwise 'gradlew' is executed.
scope :
- STEPS
- STAGES
- PARAMETERS
default : false
2022-11-15 15:17:31 +02:00
- name : applyPublishingForAllProjects
type : bool
description : If set to false publishing logic will be applied in 'rootProject' directive, otherwise 'allprojects' will be directive used
scope :
- STEPS
- STAGES
- PARAMETERS
default : false
- name : excludeCreateBOMForProjects
description : Defines which projects/subprojects will be ignored during bom creation. Only if applyCreateBOMForAllProjects is set to true
scope :
- PARAMETERS
- STAGES
- STEPS
type : "[]string"
- name : excludePublishingForProjects
description : Defines which projects/subprojects will be ignored during publishing. Only if applyCreateBOMForAllProjects is set to true
scope :
- PARAMETERS
- STAGES
- STEPS
type : "[]string"
2023-04-24 09:09:31 +02:00
- name : buildFlags
type : "[]string"
description : Defines a list of tasks and/or arguments to be provided for gradle in the respective order to be executed. This list takes precedence if specified over 'task' parameter
longDescription : |
2023-04-27 09:09:52 +02:00
Defines a list of tasks and/or arguments to be provided for gradle in the respective order to be executed. This list takes precedence if specified over 'task' parameter
2023-04-24 09:09:31 +02:00
To run command `gradle clean build -x test` , it can be achieved as follows
```
steps :
gradleExecuteBuild :
buildFlags :
- clean
- build
- -x
- test
```
scope :
- PARAMETERS
- STAGES
- STEPS
2022-03-21 11:17:03 +02:00
outputs :
resources :
- name : reports
type : reports
params :
2022-08-01 13:38:49 +02:00
- filePattern : "**/bom-gradle.xml"
2022-03-21 11:17:03 +02:00
type : sbom
2022-10-25 13:17:42 +02:00
- name : commonPipelineEnvironment
type : piperEnvironment
params :
- name : custom/artifacts
type : "piperenv.Artifacts"
2021-12-22 16:34:36 +02:00
containers :
- name : gradle
2022-01-28 16:58:01 +02:00
image : gradle:6-jdk11-alpine