Skip to main content Skip to complementary content

Creating an Azure build pipeline adapted to your deployment needs

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.

Adapting the YAML parameters to your environment

Some parameters and credentials that wil be used in the pipeline come from the secure files you stored in Azure DevOps. For more information about the Talend Maven parameters you can use when configuring your pipeline, see Talend custom Maven build options.

  1. Download and extract the file: azure-pipeline.zip.
    Information noteWarning: This file is an example and must be adapted to your environment before it is used. It gives you some predefined Maven commands and options that you can customize to fit your deployment needs. For example, the azure-pipeline.yml script file allows you to build and publish artifacts to Talend Management Console. If you want to publish artifacts to an artifact repository or to Docker, uncomment the corresponding parameters in the script.
  2. Set your own values for the environment variables defined at the top of the script (project name, Job name/version/type, repository URL, etc.).
    Information noteTip: Look for the XXX references in the azure-pipeline.yml provided by Talend as an example and replace them with values corresponding to your environment.
    Example of a project named CICD, a Job named my_complex_job with a 1.0 version and a Docker image named cicd4talend:
    variables:
    - group: Talend Variables
    - name: project_name
      value: 'CICD'
    - name: jobs_to_build
      value: 'process/my_complex_job_1.0'
    - name: docker_image_name
      value: 'cicd4talend'
    Information noteWarning: Syntax requirements:
    • The value of the project_name variable 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 variable 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 Talend Studio preferences, see Changing the deployment version of each artifact at once.
  3. Edit the artifact repository URL stated in the artifact_url Azure variable you created previously.
    Example of command to deploy artifacts into a Nexus maven-releases repository (for stable release artifacts in a Production environment). :
    -DaltDeploymentRepository=releases::default::http://nexus:8081/repository/maven-releases/

    If you want to deploy Jobs that use custom components, you need to use the -Dcomponents.* options as described in Talend custom Maven build options.

  4. Edit the Talend Cloud workspace and environment stated in the talend_ci_config variable group.

    Example of command to deploy artifacts (with screenshots) into a Talend Cloud account inside a workspace named ci-workspace on a prod environment while changing the context environment to Prod (using --context):

    -Dservice.url=$(talend_cloud_url)
    -Dcloud.token=$(talend_cloud_token)
    -Dcloud.publisher.screenshot=true
    -context=Prod
    -Dcloud.publisher.environment=prod
    -Dcloud.publisher.workspace=ci-workspace

    This environment must have been defined previously in Talend Studio, however if you did not define any context parameters you can use --context_param to define them at build time.

  5. To define the Maven phase you want to achieve: make sure the phase and build profiles stated in the options and goals lines are the one you want to perform. The default goal defined in the default script provided by Talend is deploy.
    For more information on the Maven phases, see the Maven documentation.
    Information noteTip: 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 of command to take the packaged artifact as a jar or .zip files and deploy it to the Nexus repository of your choice:
    options: '--settings $(settings_xml.secureFilePath) -Pnexus -pl $(jobs_to_build) -am'
    goals: 'clean deploy'

    Example of command to take the compiled code, package it as a Docker image and deploy it to the registry of your choice:

    options: '--settings $(settings_xml.secureFilePath) -X -Pdocker -pl $(jobs_to_build) -am -Dtalend.docker.name=$(docker_image_name)'
    goals: 'deploy'

Creating and configuring your pipeline

The first step to create your build pipeline is to import your Git repository where your source artifacts are stored.

  1. Go to the Pipelines page.
  2. Click Create pipeline.
  3. In the Connect and Select steps, select your source repository type, select the repository you want to import then give permissions to Azure to access it.
  4. In the Configure step, select Starter pipeline in order to configure the steps of your pipeline.
  5. In the Review step, paste the content of the azure-pipeline.yml file you have previously adapted to fit your deployment needs.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!