Running the Jenkins pipeline using parameters adapted to your environment - 7.3

Talend Software Development Life Cycle Best Practices Guide

Version
7.3
Language
English (United States)
Product
Talend Big Data
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Module
Talend Administration Center
Talend Artifact Repository
Talend CommandLine
Talend JobServer
Talend Studio
Content
Administration and Monitoring
Deployment
Design and Development

Configure the pipeline script provided by Talend to generate the project items according to the Maven phase you want to achieve and the repository you want to deploy your artifacts to.

Some parameters come from the maven_settings file you have previously defined and the credentials you have stored in Jenkins. For more information about the Talend Maven parameters you can use when configuring your pipeline, see Talend custom Maven build options.

Procedure

  1. From the Jenkins home page, select TalendSimplePipeline.
  2. Click Build with Parameters on the left panel to open the pipeline configuration page.
  3. Set your own values for the environment variables defined in the script (Git project name and branch, Job name/version/type, Maven goals, repository URL, etc.).
    Tip:
    • You can copy-paste the parameters that are stated in the description of each field in the corresponding parameter fields.
    • You can also directly look for the <> references in the jenkins_talend_helper.groovy script provided by Talend as an example and replace them with values corresponding to your environment. The script can be found in the Downloads tab of this page.

    Example

    Values for a project named CICD, Jobs named my_simple_job, my_complex_job and my_other_complex_job with a 0.1 version to be deployed in a Docker image named cicd4talend:
    Parameter Example of default value
    GIT_PROJECT_LIST
    CICD;https://github.com/talenduser/CICD.git;main
    JOBS_TO_BUILD
    jobs/process/my_simple_job_0.1,jobs/process/my_complex_job_0.1,jobs/process/my_other_complex_job_0.1
    MVN_GOALS
    clean deploy -Pdocker
    TALEND_CI_RUN_CONFIG
    -Dlicense.path=license 
    -Dupdatesite.path=http://localhost:8080/P2/
    -Dpatch.path=D:/patches/Patch_20220513_R2022-05_v1-7.3.1.zip
    -Dorg.slf4j.simpleLogger.showDateTime=true 
    -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS
    TALEND_CI_BUILD_OPTIONS
    -Dtalend.docker.name=cicd4talend 
    -Djkube.docker.push.registry=talenddockerregistry 
    -Djkube.docker.username=talenduser 
    -Djkube.docker.password=Talenddock3rpassw0rd
    Warning: Syntax requirements:
    • The value of the GIT_PROJECT_LIST parameter must be in upper case otherwise it might cause build failure. If you used special characters in the project name or have any doubts on its final syntax you can check it in the parent pom.xml file of your project (talend.project.name variable in <project>/poms/pom.xml).
    • The value of the JOBS_TO_BUILD parameter must be in lower case even if the original name of your Job/Route/Service contained upper case as all artifacts are in lower case in the .pom files required to launch the build.
    • Do not add manually the "-SNAPSHOT" suffix to the version value. Snapshots and releases are decoupled from the version itself and must only be handled via the Studio preferences, see Changing the deployment version of each artifact at once.
  4. To define the artifact repository in which you want to deploy the project artifacts, edit the repository URL stated in the MVN_GOALS parameter.

    The repository defined in the default script provided by Talend is the Nexus releases repository.

    Example

    Parameter Example of default value
    MVN_GOALS
    clean deploy -DaltDeploymentRepository=maven-releases::default::http://localhost:8081/repository/maven-snapshots/

    allows you to deploy artifacts into a Nexus snapshots repository (for projects under development and artifacts with a -SNAPSHOT version).

    You need to specify your own artifact repository URL and there should not be any line breaks between the Maven goal and the -DaltDeploymentRepository parameter.

  5. To define the Maven phase and profile you want to achieve, make sure the phases stated in the MVN_GOALS parameter are the ones you want to perform.
    For more information on the Maven phases, see the Maven documentation.
    Tip: All build profiles (-Pdocker, -Pnexus, etc.) are listed in the parent pom.xml file of your project. Some default parameters, like the Docker image name or the Open JDK name, can also be overwritten in this file.

    Example

    Parameter Example of default value
    MVN_GOALS
    deploy -Pdocker

    For examples of filters you can apply to the execution of your project items, see Filtering the execution of your project on selected artifacts.

  6. To define the Talend Cloud Management Console workspace and environment in which you want to deploy the project artifacts, edit the Docker credentials stated in the TALEND_CI_BUILD_OPTIONS parameter.

    Example

    Parameter Example of default value
    TALEND_CI_BUILD_OPTIONS
    -Dservice.url=https://tmc.eu.cloud.talend.com/inventory
    -Dcloud.token=XXX1234TalendCloudToken1234XXX
    -Dcloud.publisher.screenshot=true 
    -Dcloud.publisher.environment=prod
    -Dcloud.publisher.workspace=ci-workspace

    allows you to deploy artifacts (with screenshots) into a Talend Cloud account inside a workspace named ci-workspace on a prod environment. You need to specify your own Talend Cloud environment and workspace.

  7. To define the Docker registry in which you want to deploy the project artifacts, edit the Docker credentials stated in the TALEND_CI_BUILD_OPTIONS parameter.

    Example

    Parameter Example of default value
    TALEND_CI_BUILD_OPTIONS
    -Dtalend.docker.name=cicd4talend 
    -Djkube.docker.push.registry=talenddockerregistry 
    -Djkube.docker.username=talenduser 
    -Djkube.docker.password=Talenddock3rpassw0rd

    allows you to deploy artifacts as the Docker image you have previously defined in the Docker registry of your choice.

  8. Click Build to take your changes into account and build your artifacts.