Set Up Jenkins
Access Jenkins by navigating to http://localhost:8080 in your web browser.
Follow the setup wizard. Use suggested plugins for a typical installation.
Install Jenkins Watson Plug-in
- Go to Jenkins Dashboard, then click on Manage Jenkins.
- Select Manage Plugins and navigate to the Available tab.
- Search for "IBM Watson" in the plugin list.
- Check the box next to the IBM Watson plugin and click Install without restart.
Configure Watson Service
- Navigate to the IBM Cloud and create an instance of the required Watson service, such as Watson Language Translator or Watson Assistant.
- Once created, retrieve the service credentials which include the API key and URL.
- Store these credentials securely and note them for the Jenkins configuration.
Configure Jenkins with IBM Watson
- Return to the Jenkins Dashboard and click on Manage Jenkins, then Configure System.
- Scroll down to the IBM Watson section and enter the Watson service credentials.
- Input the API Key and URL into their respective fields.
- Click Save to confirm the configuration settings.
Create a Jenkins Job to Use Watson
- From the Jenkins Dashboard, click New Item, give your job a name, and choose a Freestyle project.
- In the job configuration page, navigate to the Build section.
- Add a build step and select the Watson integration task, such as text translation or tone analysis, based on your service.
- Provide necessary inputs required by Watson, like text to be translated or analyzed.
- Click Save to create the job.
Execute and Test the Job
- Once your job is configured, click Build Now from the job's page in Jenkins.
- Monitor the build output to verify that Jenkins is successfully interacting with IBM Watson.
- Check output as per Watson task setup in earlier steps to ensure correctness.
Troubleshooting
- If there are issues with the API connection, double-check the service credentials and ensure they match.
- Ensure that your network settings allow outbound requests if running behind a firewall or proxy.
- Review the Jenkins logs for detailed error messages that can hint at the exact problem.