Java Code Examples for org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints#addRunFacet()

The following examples show how to use org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints#addRunFacet() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContainerRecordUtils.java    From yet-another-docker-plugin with MIT License 6 votes vote down vote up
public static void attachFacet(Run<?, ?> run, TaskListener listener) {
    final Executor executor = run.getExecutor();
    if (executor == null) {
        return;
    }

    final Computer owner = executor.getOwner();
    DockerComputer dockerComputer;
    if (owner instanceof DockerComputer) {
        dockerComputer = (DockerComputer) owner;
        try {
            DockerFingerprints.addRunFacet(
                    createRecordFor(dockerComputer),
                    run
            );
        } catch (IOException | ParseException e) {
            listener.error("Can't add Docker fingerprint to run.");
            LOG.error("Can't add fingerprint to run {}", run, e);
        }
    }


}
 
Example 2
Source File: RunFingerprintStep.java    From docker-workflow-plugin with MIT License 5 votes vote down vote up
@SuppressWarnings("SynchronizeOnNonFinalField") // run is quasi-final
@Override protected Void run() throws Exception {
    DockerClient client = new DockerClient(launcher, node, step.toolName);
    DockerFingerprints.addRunFacet(client.getContainerRecord(env, step.containerId), run);
    String image = client.inspect(env, step.containerId, ".Config.Image");
    if (image != null) {
        ImageAction.add(image, run);
    }
    return null;
}