Use Jenkins VirtServer Plugin

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:

go.gifReadyAPI Downloads Center

Requirements and limitations

  • Jenkins Plugin 1.12.0 requires Jenkins 2.222.4 or later.

  • Jenkins Plugin 1.19.0 requires Jenkins 2.440.3 or later.

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

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

Install the Jenkins VirtServer Plugin

  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.

Configure 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 Manage VirtServer Users.

    Password

    The password of the VirtServer user.

Jenkins Configuration: Settings Configuration

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

Work with virtual services from Jenkins

Deploy 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

Start 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.

Important

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

Stop 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.

Important

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

Undeploy 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.

Important

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

Update 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 ReadyAPI.

Important

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

See Also

Publication date: