Procedure
-
Click New Item to add a new Jenkins Job.
-
Select a Freestyle project and update the name accordingly.
-
Set up the Source Code Management (SCM) repository where the JSON configuration
file is located.
This example uses Git, with a repository named ci-artifacts-repo. The default branch is master.
It is recommended to have a branch for each Talend environment (DEV, TEST, PRE-PROD, PROD, etc.). Each branch will have its own version of the JSON task list. Optionally, the name of this branch can be passed as a Job parameter with master as a default.
-
In Build Environment, select the Inject
environment variables to the build process check box and set the
Talend Administration Center address and
login information as environment variables.
This way, you avoid hard-coding any parameters in the script. The
JSON_CONFIG_FILE
name is also exposed in case the default name must be changed.Optionally, these environment variables can also be saved in the SCM repository as a property file.
The environment variables
TAC_URL
,TAC_ADMIN_USER
,TAC_ADMIN_PWD
andJSON_CONFIG_FILE
are used by the Groovy script. -
Add a build step to retrieve the Groovy script.
The script is copies into the Jenkins Job workspace using the Provide configuration file plugin.
The name TALEND_TASK_MANAGEMENT is the name used to store the Groovy script, update it accordingly.
-
Add a build step which uses the default Groovy installation to execute the
Groovy script located in the workspace.
The script path is provided by the environment variable TALEND_TASK_MANAGMENT defined above.
Optionally:
- When Talend Administration Center
is configured with SSL, you can add the Java truststore path (where
the TAC certificate/Public Key has been imported) and the truststore
password as Java OTPS (update
accordingly).
-Djavax.net.ssl.trustStore=/opt/talend/dependencies/jenkins/tac_truststore.ts -Djavax.net.ssl.trustStorePassword=changeit
- When Talend Administration Center is not configured with SSL, do as follows:
- When Talend Administration Center
is configured with SSL, you can add the Java truststore path (where
the TAC certificate/Public Key has been imported) and the truststore
password as Java OTPS (update
accordingly).
-
Run the Job to deploy the artifacts to the JobServers via Talend Administration Center.
Results
The Job runs successfully:
The task is successfully deployed with the trigger configured and the Ready to run state.