Update JMeter plugins from CLI in CI/CD

on 20 December 2021 Automation, CI, CONTINUOUS INTEGRATION, DEVOPS, JMETER, JMETER-PLUGINS, PERFORMANCE, PRODUCTIVITY and Tags: , , , , , , , , , with 0 comments
Updating JMeter plugins from CLI in CI/CD

Update JMeter plugins from CLI in CI/CD

Following the request of one of our users, we would like to share with you the procedure to update JMeter plugins from the command line interface (CLI) in a continuous integration and delivery pipelines.

The context

When deploying JMeter within a CI/CD pipeline you want to:

  • Install a plugin automatically
  • Update the plugin automatically to the latest version

In this blog we’ll see how JMeter-Plugins-Manager can help updating plugins using CLI in CI/CD pipelines.

The Pre-requisites

Download https://jmeter-plugins.org/get/ and put it in jmeter/lib/ext, the latest version is 1.8 at the time of the writing.

Download cmdrunner-2.3.jar from here (https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.3/cmdrunner-2.3.jar) and put it in ${JMETER_HOME}/lib directory

Run:

java -cp ${JMETER_HOME}/lib/ext/jmeter-plugins-manager-1.8.jar org.jmeterplugins.repository.PluginManagerCMDInstaller

This will install in ${JMETER_HOME}/bin directory the files:

  • PluginsManagerCMD.sh
  • PluginsManagerCMD.bat

The solution to update JMeter Plugins using CLI in CI/CD pipelines

Now we have the setup done, we will test using UbikLoadPack Video Streaming plugin, but you can do it with any JMeter-Plugin that is published at https://jmeter-plugins.org.

To see if there are updates:

./PluginsManagerCMD.sh upgrades  ulp-jmeter-videostreaming-plugin

If there are updates you’ll get the following output:

There are updates (8.0.0 is installed):
2021-11-09 16:08:07,764 INFO o.j.r.PluginManagerCMD: Command is: upgrades
2021-11-09 16:08:07,854 INFO o.j.r.JARSourceHTTP: Found cached repo
2021-11-09 16:08:08,050 INFO o.j.r.PluginManager: Plugins Status: [jpgc-casutg=2.10, jpgc-fifo=0.2, jpgc-plugins-manager=1.6, ulp-jmeter-videostreaming-plugin=8.0.1, websocket-samplers=1.2.8, jmeter-core=5.4.1, jmeter-ftp=5.4.1, jmeter-http=5.4.1, jmeter-jdbc=5.4.1, jmeter-jms=5.4.1, jmeter-junit=5.4.1, jmeter-java=5.4.1, jmeter-ldap=5.4.1, jmeter-mail=5.4.1, jmeter-mongodb=5.4.1, jmeter-native=5.4.1, jmeter-tcp=5.4.1, jmeter-components=5.4.1]
[ulp-jmeter-videostreaming-plugin=8.0.1]

If there are NO updates you’ll get the following output (if 8.0.1 is installed):

2021-11-09 16:16:46,372 INFO o.j.r.PluginManagerCMD: Command is: upgrades
2021-11-09 16:16:46,449 INFO o.j.r.JARSourceHTTP: Found cached repo
2021-11-09 16:16:46,679 INFO o.j.r.PluginManager: Plugins Status: [jpgc-casutg=2.10, jpgc-fifo=0.2, jpgc-plugins-manager=1.6, ulp-jmeter-videostreaming-plugin=8.0.1, websocket-samplers=1.2.8, jmeter-core=5.4.1, jmeter-ftp=5.4.1, jmeter-http=5.4.1, jmeter-jdbc=5.4.1, jmeter-jms=5.4.1, jmeter-junit=5.4.1, jmeter-java=5.4.1, jmeter-ldap=5.4.1, jmeter-mail=5.4.1, jmeter-mongodb=5.4.1, jmeter-native=5.4.1, jmeter-tcp=5.4.1, jmeter-components=5.4.1]
There is nothing to update.

To install last version from CLI

./PluginsManagerCMD.sh install ulp-jmeter-videostreaming-plugin

To install a version X.Y.Z:

./PluginsManagerCMD.sh install ulp-jmeter-videostreaming-plugin=X.Y.Z

Learn more on JMeter and UBIK Load Pack

About us: