1. Install groovy plugin

2. Add a step of groovy. (normal & systerm)

3. Execute groovy script

import jenkins.model.*

def q = Jenkins.instance.queue

q.items.findAll{ it.task.name.startsWith('ttt') }.each{ q.cancel(it.task) }

Above script is cancel all pending build in queue.

Additional info:

install groovy :

GVM (the GroovyenVironment Manager)
This tool makesinstalling Groovy on any Bash platform (Mac OSX, Linux, Cygwin, Solaris orFreeBSD) very easy.

Simply open a newterminal and enter:

$ curl -s get.gvmtool.net | bash

Follow theinstructions on-screen to complete installation.

Open a newterminal or type the command:

$ source "$HOME/.gvm/bin/gvm-init.sh"

Then install thelatest stable Groovy:

$ gvm install groovy

After installationis complete and you've made it your default version, test it with:

$ groovy -version

That's all thereis to it!

How to use groovy script on jenkins的更多相关文章

  1. SoapUI Pro Project Solution Collection –Easy develop Groovy Script to improve SoapUI ability

    As you know the groovy script and java script language is the soapui supported .but unfortunately So ...

  2. Common tasks that you can perform with the Groovy Script test step

    https://support.smartbear.com/readyapi/docs/soapui/steps/groovy.html Get test case object To obtain ...

  3. Access Java API in Groovy Script

    $ cat Hello.java package test; public class Hello { public int myadd(int x, int y) { return 10 * x + ...

  4. Elasticsearch的Groovy Script自定义评分检索

    需求:以索引中的boostapp列作为评分的基础分值,同时根据carpublishtime(数据的刷新时间字段)按时间进行衰减. 基于Groovy脚本实现. 1.query脚本方式: { " ...

  5. Groovy Script in SoapUI REST Testing

    1. Run special step: testRunner.runTestStepByName("stepName/requestName") get it's respons ...

  6. [SoapUI] 通过Groovy Script获取当前运行的是哪套Environment

    log.info testRunner.testCase.testSuite.project.getActiveEnvironment().getName()

  7. [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] Exception Handling in groovy

    def x = new String[3] x[0] = "A" x[1] = "B" x[2] = "C" log.info"X ...

  8. [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] HashSet and Hashtable

    Hashset: HashSet set = new HashSet() set.add("India") set.add("USA") set.add(&qu ...

  9. [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] Array and ArrayList

    Array: def x = new String[5] x[0] = "India" x[1] = "USA" x[2] = "Korea" ...

随机推荐

  1. RobotFrameWork(二)Ride简单使用及快捷键

    一.简单示例 注意:以下操作使用到快捷键的,请先确保没有与其他软件的快捷键设置冲突,比如sogou拼音.有道词典等等 1.启动ride 启动ride方法: 1)  通过界面图标 2)  dos命令行: ...

  2. ABAP 数量单位转换

    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'           EXPORTING             input                = wa_ite ...

  3. C# Mvc中文件下载

    public ActionResult DownloadFile(string id) { var fileinfo = CommonAnnexService.Get(id); if (fileinf ...

  4. NEFU 558 迷宫寻路

    题目链接 简单搜索题 #include <cstdio> #include <iostream> #include <cstring> using namespac ...

  5. NTC 热敏电阻温度计算公式

    Rt = R *EXP(B*(1/T1-1/T2))这里T1和T2指的是K度即开尔文温度,K度=273.15(绝对温度)+摄氏度:其中T2=(273.15+25)Rt 是热敏电阻在T1温度下的阻值: ...

  6. 用Myeclipse,包名上有小红叉(表示错误),但是包中的类都是没有错误的+struts2继承ActionSupport时package前面出错

    使用Eclipse 进行项目开发,在实现类中的方法前面如果添加@Override就提示“Multiple markers at this line”的错误,问题描述如下 应该是JDK版本的问题, 右击 ...

  7. 四种常见的App弹窗设计,你有仔细注意观察吗?

    弹窗又称为对话框,是App与用户进行交互的常见方式之一.弹窗分为模态弹窗和非模态弹窗两种,两者的区别在于需不需要用户对其进行回应.模态弹窗会打断用户的正常操作,要求用户必须对其进行回应,否则不能继续其 ...

  8. 高并发应用场景下的负载均衡与故障转移实践,AgileEAS.NET SOA 负载均衡介绍与实践

    一.前言 AgileEAS.NET SOA 中间件平台是一款基于基于敏捷并行开发思想和Microsoft .Net构件(组件)开发技术而构建的一个快速开发应用平台.用于帮助中小型软件企业建立一条适合市 ...

  9. 【MongoDB】4.MongoDB 原子修改器的 极速修改

    文档转自:http://blog.csdn.net/mcpang/article/details/7752736 对于文档的更新除替换外,针对某个或多个文档只需要部分更新可使用原子的更新修改器,能够高 ...

  10. 超详细的Xcode代码格式化教程,可自定义样式

    为什么要格式化代码 当团队内有多人开发的时候,每个人写的代码格式都有自己的喜好,也可能会忙着写代码而忽略了格式的问题. 在之前,我们可能会写完代码后,再一点一点去调格式,很浪费时间. 有了ClangF ...