public synchronized static void registerImagOnAgents ( Launcher launcher , final String imageTag , final String host , final String targetRepo , final ArrayListMultimap < String , String > artifactsProps , final int buildInfoId ) throws IOException , InterruptedException { // Master final String imageId = getImageIdFromAgent ( launcher , imageTag , host ) ; registerImage ( imageId , imageTag , targetRepo , artifactsProps , buildInfoId ) ; // Agents List < Node > nodes = Jenkins . getInstance ( ) . getNodes ( ) ; for ( Node node : nodes ) { if ( node == null || node . getChannel ( ) == null ) { continue ; } try { node . getChannel ( ) . call ( new MasterToSlaveCallable < Boolean , IOException > ( ) { public Boolean call ( ) throws IOException { registerImage ( imageId , imageTag , targetRepo , artifactsProps , buildInfoId ) ; return true ; } } ) ; } catch ( Exception e ) { launcher . getListener ( ) . getLogger ( ) . println ( "Could not register docker image " + imageTag + " on Jenkins node '" + node . getDisplayName ( ) + "' due to: " + e . getMessage ( ) + " This could be because this node is now offline." ) ; } } }
Registers an image to be captured by the build - info proxy .