简体   繁体   中英

How can I tell if a build is in progress when I call the Jenkins json api?

I'm calling a url like this: /job/My-Job/710/api/json and it's returning some json like this:

{
    "actions": [
        {
            "parameters": [
                {
                    "name": "DEPLOY_HOST",
                    "value": ""
                }
            ]
        },
        {
            "causes": [
                {
                    "shortDescription": "Started by user Hudson Admin",
                    "userId": "username",
                    "userName": "Hudson Admin"
                }
            ]
        },
        {},
        {},
        {}
    ],
    "artifacts": [],
    "building": true,
    "description": null,
    "duration": 0,
    "estimatedDuration": 390011,
    "executor": {},
    "fullDisplayName": "My-App #711",
    "id": "2013-08-30_12-50-14",
    "keepLog": false,
    "number": 711,
    "result": "SUCCESS",
    "timestamp": 1377892214231,
    "url": "http://hudsonurl:8081/job/My-App/711/",
    "builtOn": "",
    "changeSet": {
        "items": [
            {}
        ],
        "kind": "svn",
        "revisions": [
            {
                "module": "https://oursvn",
                "revision": 27498
            }
        ]
    },
    "culprits": [
        {
            "absoluteUrl": "http://hudsonsurl:8081/user/handsomeg",
            "fullName": "handsome guy"
        }
    ],
    "mavenArtifacts": null,
    "mavenVersionUsed": "3.0.4"
}

This build is actually in progress right now, but I can't see a way to know that. You'd think that the value of result should be in progress , but it's not. Is this a bug, or is there some other way to check? I'm using Jersey version 1.523

I just noticed there's a "building": true .

Makes me wonder what result is for. Maybe builds are considered SUCCESS until proven otherwise.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM