To filter the execution of your project items to build only the artifact(s) you
want, you need to declare the filter in the Maven parameters entered when configuring
the build project which generates your project sources on the Continuous Integration
server.
Before you begin
- You have created the build pipeline on your Continuous Integration server,
Jenkins in this example. See Creating the Jenkins pipeline.
- You know the path to the pom files of the artifacts you want to execute (Standard
Jobs, Big Data Jobs, Routes, etc.). These files are available in the Studio
workspace, in the workspace/<my_project>/poms
directory.
Tip:
- To filter on Standard Jobs, the path to be used will be
jobs/process/jobName_version
- To filter on Big Data Jobs, the path to be used will be
jobs/process_mr/jobName_version
- To filter on Routes, the path to be used will be
jobs/routes/routeName_version
- To filter on Data Services, the path to be used will be
jobs/services/serviceName_version
Procedure
-
From the Jenkins home page, select
TalendSimplePipeline.
-
Click Build with Parameters on the left panel to open
the pipeline configuration page.
-
In the JOBS_TO_BUILD area, edit the Maven commands and
parameters that allow you to filter the Jobs according to your needs:
Example
Example of Maven command used to clean the project build directory (deleting
old files), launch the generation of the
route_feature950 Route and its dependencies and
deploy the packages on the Nexus Artifact repository you have defined:
-fae -e -pl jobs/routes/route_feature950_0.1 -amd
The -amd parameter is mandatory to publish a Route as
the dependencies of the Route need to be generated in order to publish
it.
Example of Maven command used to clean the project build directory (deleting
old files), launch the generation of the parent Job named
parent along with is dependencies (child jobs)
and deploy these packaged artifacts on Talend Cloud Management Console:
-Pcloud-publisher -pl jobs/process/parent_0.1 -am
Example of Maven command used to take the generated project and package the
Java code of all artifacts inside this project as a Docker image.
-Pdocker package -fae -e
-
Click Build to take your changes into account and build
your artifacts.
Results
When you execute your project on your Continuous Integration
server, the filter will be applied and only the artifacts you have filtered will be
generated and executed.