
org.testifyproject.github.dockerjava.jaxrs.CommitCmdExec Maven / Gradle / Ivy
package org.testifyproject.testifyproject.github.dockerjava.jaxrs;
import static javax.ws.rs.client.Entity.entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import org.testifyproject.slf4j.Logger;
import org.testifyproject.slf4j.LoggerFactory;
import org.testifyproject.testifyproject.fasterxml.jackson.databind.node.ObjectNode;
import org.testifyproject.testifyproject.github.dockerjava.api.org.testifyproject.testifyprojectmand.CommitCmd;
import org.testifyproject.testifyproject.github.dockerjava.core.DockerClientConfig;
public class CommitCmdExec extends AbstrSyncDockerCmdExec implements CommitCmd.Exec {
private static final Logger LOGGER = LoggerFactory.getLogger(CommitCmdExec.class);
public CommitCmdExec(WebTarget baseResource, DockerClientConfig dockerClientConfig) {
super(baseResource, dockerClientConfig);
}
@Override
protected String execute(CommitCmd org.testifyproject.testifyprojectmand) {
WebTarget webTarget = getBaseResource().path("/org.testifyproject.testifyprojectmit").queryParam("container", org.testifyproject.testifyprojectmand.getContainerId())
.queryParam("repo", org.testifyproject.testifyprojectmand.getRepository()).queryParam("tag", org.testifyproject.testifyprojectmand.getTag())
.queryParam("m", org.testifyproject.testifyprojectmand.getMessage()).queryParam("author", org.testifyproject.testifyprojectmand.getAuthor());
webTarget = booleanQueryParam(webTarget, "pause", org.testifyproject.testifyprojectmand.hasPauseEnabled());
LOGGER.trace("POST: {}", webTarget);
ObjectNode objectNode = webTarget.request().accept("application/vnd.docker.raw-stream")
.post(entity(org.testifyproject.testifyprojectmand, MediaType.APPLICATION_JSON), ObjectNode.class);
return objectNode.get("Id").asText();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy