Prerequisite

On the Zanata server you use
Global Configuration in your Jenkins server
  • Configure Zanata credentials (username and API key) in Jenkins Credentials view
  • Configure Github credential or equivalent remote SCM credentials if you want to push commit
  • JAVA_HOME defined as environment variable (You should install JDKs and then expose one's installation path as environment variable. This way the JAVA_HOME variable is correct both in master and in slave)

Next step

Configure a job to listen to Zanata webhook event

In your job configuration, check the Accept Zanata Webhook checkbox under 'General' section. It will open up more fields: - The 'URL to register on Zanata' field is readonly for you to register your webhook in Zanata. See Zanata webhook for more detail. - The optional webhook secret field is for verification of incoming webhooks

Accept Zanata Webhook

Configure your SCM for your Jenkins job as usual. If you want to trigger a build when SCM changes, you can leverage other Jenkins plugins. e.g. Github plugin to listen to github webhook event and trigger a build to push resources to Zanata.

Then in the 'Build' section, you will have two options to push source to and/or pull translation from Zanata server.

  1. Use 'Zanata Sync' build step
  2. Install Zanata CLI on Jenkins node and use 'Zanata Sync via CLI' build step

Option 1 has the advantage of being installation free and simple to use. It will work on all type of jenkins slave nodes. It will commit translation after pull automatically if you use Git as SCM. Disadvantage being that it uses only the included version of Zanata CLI java classes. and you can't do much customization for push and pull.

Option 2 has the advantage of being flexible. You can use all the features and options of Zanata CLI. The disadvantage is, you will need to know how to use Zanata CLI. You also need to manually manage source control in your shell script.