Applies to ReadyAPI 2.8, last modified on August 16, 2019

Jenkins is a build management application that helps with automating repeating tasks such as obtaining source code from source code control, building projects, testing applications and so on.

You can deploy, update, or remove virtual services from VirtServer in your builds by using the Jenkins VirtServer Plugin.

Download

You can download the plugin from the SmartBear website:

ReadyAPI Downloads Center

Requirements and Limitations

  • VirtServer must be running on the machine Jenkins can access.

  • The Jenkins VirtServer plugin cannot work with JMS virtual services.

Installing the Jenkins VirtServer Plugin

Online Installation
  • In Jenkins, go to Manage Jenkins > Manage Plugins.

  • Switch to the Available tab.

  • Find the VirtServer support plugin and click Install without restart.

    Tip: Press CTRL+F and search through the page for the VirtServer keyword to find the plugin faster.
Offline Installation
  1. Download the Jenkins VirtServer Plugin .hpi file from the ReadyAPI downloads page.

  2. In Jenkins, go to Manage Jenkins > Manage Plugins.

  3. Switch to the Advanced tab.

  4. Click Choose File in the Upload Plugin section.

  5. Select the plugin file on your device.

  6. Click Upload.

Configuring VirtServer Properties

Before deploying virtual services, you need to configure the address of your VirtServer instance:

  1. In Jenkins, go to Manage Jenkins > Configure System.

  2. Find the VirtServer section and specify the following:

    Option Description
    VirtServer IP and port The IP address and port number of your VirtServer instance.
    Username The username Jenkins uses to log in to VirtServer. For information on creating VirtServer users, see Managing VirtServer Users.
    Password The password of the VirtServer user.
Jenkins Configuration: Settings Configuration

Click the image to enlarge it.

All the builds you start on Jenkins will use the specified VirtServer instance and user.

Working With Virtual Services From Jenkins

Deploying Virtual Services

To deploy a virtual service, add the VirtServer: Deploy Virtual Service build step. Configure the step fields:

Option Description
Project file The full path to the project file. The project must contain the virtual service to deploy.
Name of the virtual service to deploy The full name of the virtual service you want to deploy.
Autostart If selected, your virtual service will be started automatically upon deployment and when VirtServer is launched.
Port The port number that the deployed virtual service will use on VirtServer. If empty, the port specified in the virtual service settings will be used.
Replace If enabled and the same virtual service is already deployed on VirtServer, the new virtual service will replace the old one. Otherwise, the old virtual service will remain deployed. If there is no virtual service on VirtServer, this option has no effect.
Jenkins Configuration: Deploying Virtual Services

Click the image to enlarge it.

Starting Virtual Services

To start a virtual service that is already deployed on VirtServer, add the VirtServer: Start Virtual Service build step. Configure the step field:

Option Description
Name or Deployment ID The name of the virtual service deployed during the test run, or the ID of the service on VirtServer. Leave it empty to start all the virtual services deployed during the build.
You can use virtual service names to work with the services deployed during the same build. If a virtual service was deployed during a different build, use the deployment ID. You can get the deployment ID of a service by using the ReadyAPI VirtServer Command-Line Interface or from Jenkins Console Output after the service was deployed.
Jenkins Configuration: Starting Virtual Services

Click the image to enlarge it.

Stopping Virtual Services

To stop a virtual service running on VirtServer, add the VirtServer: Stop Virtual Service build step. Configure the step field:

Option Description
Name or Deployment ID The name of the virtual service deployed during the test run, or the ID of the virtual service on VirtServer. Leave it empty to stop all the services deployed during the build.
You can use virtual service names to work with the services deployed during the same build. If a virtual service was deployed during a different build, use the deployment ID. You can get the deployment ID of a service by using the ReadyAPI VirtServer Command-Line Interface or from Jenkins Console Output after the service was deployed.
Jenkins Configuration: Stopping Virtual Services

Click the image to enlarge it.

Undeploying Virtual Services

To remove a virtual service from VirtServer, add the VirtServer: Undeploy Virtual Service build step. Configure the step field:

Option Description
Name or Deployment ID The name of the virtual service deployed during the test run, or the ID of the service on VirtServer. Leave it empty to undeploy all the services deployed during the build.
You can use virtual service names to work with the services deployed during the same build. If a service was deployed during a different build, use the deployment ID. You can get the deployment ID of a service by using the ReadyAPI VirtServer Command-Line Interface or from Jenkins Console Output after the service was deployed.
Jenkins Configuration: Undeploying Virtual Services

Click the image to enlarge it.

Updating Virtual Services

To update virtual service parameters, add the VirtServer: Undeploy Virtual Service build step. For example, you can change the port number the virtual service uses. Configure the step fields:

Option Description
Deployment ID only The ID of the virtual service on TestServer.
You can use virtual service names to work with the services deployed during the same build. If a service was deployed during a different build, use the deployment ID. You can get the deployment ID of a service by using the ReadyAPI VirtServer Command-Line Interface or from Jenkins Console Output after the service was deployed.
Autostart If selected, the virtual service you update will be started automatically upon deployment and when VirtServer is launched.
Port The port number the virtual service will use on VirtServer. If empty, the port specified in the virtual service settings will be used.
Jenkins Configuration: Updating Virtual Services

Click the image to enlarge it.

See Also

Managing VirtServer Users
Command-Line Interface Utility
Configuring and Using VirtServer

Highlight search results