import * as jenkins from "jenkins" ; param type const getJenkins = function ( type ) { const jenkinsConfig = { h5 : { baseUrl : "http://cookieboty:qq123456@jenkins.cookieboty.com/" , crumbIssuer : true , } , } ; return jenkins ( jenkinsConfig [ type ] ) ; } ; author : Cookie
 *  description const buildJenkins = async ( { type , job , params } ) => { const jenkinsCallback = await new Promise ( ( resolve ) => { getJenkins ( type ) . job . build ( { name : job , parameters : params } , ( err , data ) => { if ( err ) { console . log ( "err: " , err ) ; throw err ; } resolve ( { queueId : data } ) ; } ) ; } ) ; return { data : jenkinsCallback } ; } ; author : Cookie
 *  description const getQueuedInfo = async ( { type , queueId } ) => { const jenkinsCallback = await new Promise ( ( resolve ) => { getJenkins ( type ) . queue . item ( queueId , ( err , data ) => { if ( err ) { console . log ( "err---->" , err ) ; throw err ; } resolve ( data ) ; } ) ; } ) ; return { data : jenkinsCallback } ; } ; author : Cookie
 *  description const getJenkinsInfo = async ( { type , job , buildNumber } ) => { console . log ( type , job , buildNumber ) ; const jenkinsCallback = await new Promise ( ( resolve ) => { getJenkins ( type ) . build . get ( job , buildNumber , ( err , data ) => { console . log ( "data: " , data ) ; console . log ( "err: " , err ) ; if ( err ) { console . log ( "err---->" , err ) ; throw err ; } resolve ( data ) ; } ) ; } ) ; const { statusCode } = jenkinsCallback ; if ( jenkinsCallback && statusCode !== 404 ) { return { data : jenkinsCallback } ; } else { return { data : jenkinsCallback } ; } } ; author : Cookie
 *  description const getJenkinsConsole = async ( { type , job , buildId } ) => { const jenkinsCallback = await new Promise ( ( resolve ) => { getJenkins ( type ) . build . log ( job , buildId , ( err , data ) => { if ( err ) { return console . log ( "err---->" , err ) ; } resolve ( data ) ; } ) ; } ) ; return { data : jenkinsCallback } ; } ; export default { buildJenkins , getQueuedInfo , getJenkinsInfo , getJenkinsConsole , } ;