我怎么知道 Jenkins 构建状态
How can I know the Jenkins Build Status
我实际上在做我自己的 Jenkins 插件,我有一个从 RunListener<Run>
扩展而来的 class,使用下一个 onCompleted()
方法:
@Override
public void onCompleted(Run build, TaskListener listener) {
int number = build.number;
EnvVars env;
String name = "";
try {
env = build.getEnvironment(listener);
name = env.get("JOB_NAME") + "-" + env.get("BUILD_NUMBER");
} catch (IOException | InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
GraphicAction act = new GraphicAction(name);
build.getActions().add((Action) act);
}
有没有可能只在构建成功后才执行最后两行?
谢谢!
我实际上在做我自己的 Jenkins 插件,我有一个从 RunListener<Run>
扩展而来的 class,使用下一个 onCompleted()
方法:
@Override
public void onCompleted(Run build, TaskListener listener) {
int number = build.number;
EnvVars env;
String name = "";
try {
env = build.getEnvironment(listener);
name = env.get("JOB_NAME") + "-" + env.get("BUILD_NUMBER");
} catch (IOException | InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
GraphicAction act = new GraphicAction(name);
build.getActions().add((Action) act);
}
有没有可能只在构建成功后才执行最后两行?
谢谢!