templates.graphql.dockerfileslim Maven / Gradle / Ivy
package templates.graphql;
import java.io.IOException;
import com.fizzed.rocker.ForIterator;
import com.fizzed.rocker.RenderingException;
import com.fizzed.rocker.RockerContent;
import com.fizzed.rocker.RockerOutput;
import com.fizzed.rocker.runtime.DefaultRockerTemplate;
import com.fizzed.rocker.runtime.PlainTextUnloadedClassLoader;
// import @ [1:1]
import com.fasterxml.jackson.databind.JsonNode;
/*
* Auto generated code to render template templates/graphql/dockerfileslim.rocker.raw
* Do not edit this file. Changes will eventually be overwritten by Rocker parser!
*/
@SuppressWarnings("unused")
public class dockerfileslim extends com.fizzed.rocker.runtime.DefaultRockerModel {
static public com.fizzed.rocker.ContentType getContentType() { return com.fizzed.rocker.ContentType.RAW; }
static public String getTemplateName() { return "dockerfileslim.rocker.raw"; }
static public String getTemplatePackageName() { return "templates.graphql"; }
static public String getHeaderHash() { return "2102311678"; }
static public long getModifiedAt() { return 1645995245871L; }
static public String[] getArgumentNames() { return new String[] { "config", "expose" }; }
// argument @ [2:2]
private JsonNode config;
// argument @ [2:2]
private String expose;
public dockerfileslim config(JsonNode config) {
this.config = config;
return this;
}
public JsonNode config() {
return this.config;
}
public dockerfileslim expose(String expose) {
this.expose = expose;
return this;
}
public String expose() {
return this.expose;
}
static public dockerfileslim template(JsonNode config, String expose) {
return new dockerfileslim()
.config(config)
.expose(expose);
}
@Override
protected DefaultRockerTemplate buildTemplate() throws RenderingException {
// optimized for convenience (runtime auto reloading enabled if rocker.reloading=true)
return com.fizzed.rocker.runtime.RockerRuntime.getInstance().getBootstrap().template(this.getClass(), this);
}
static public class Template extends com.fizzed.rocker.runtime.DefaultRockerTemplate {
// \nFROM openjdk:11.0.3-slim\n
static private final byte[] PLAIN_TEXT_0_0;
// \n
static private final byte[] PLAIN_TEXT_1_0;
// COPY /target/
static private final byte[] PLAIN_TEXT_2_0;
// server.jar
static private final byte[] PLAIN_TEXT_3_0;
// COPY /build/libs/
static private final byte[] PLAIN_TEXT_4_0;
// \nCMD [\"/bin/sh\",\"-c\",\"exec java -Dlight-4j-config-dir=/config -Dlogback.configurationFile=/config/logback.xml -jar /server.jar\"]\n
static private final byte[] PLAIN_TEXT_5_0;
static {
PlainTextUnloadedClassLoader loader = PlainTextUnloadedClassLoader.tryLoad(dockerfileslim.class.getClassLoader(), dockerfileslim.class.getName() + "$PlainText", "UTF-8");
PLAIN_TEXT_0_0 = loader.tryGet("PLAIN_TEXT_0_0");
PLAIN_TEXT_1_0 = loader.tryGet("PLAIN_TEXT_1_0");
PLAIN_TEXT_2_0 = loader.tryGet("PLAIN_TEXT_2_0");
PLAIN_TEXT_3_0 = loader.tryGet("PLAIN_TEXT_3_0");
PLAIN_TEXT_4_0 = loader.tryGet("PLAIN_TEXT_4_0");
PLAIN_TEXT_5_0 = loader.tryGet("PLAIN_TEXT_5_0");
}
// argument @ [2:2]
protected final JsonNode config;
// argument @ [2:2]
protected final String expose;
public Template(dockerfileslim model) {
super(model);
__internal.setCharset("UTF-8");
__internal.setContentType(getContentType());
__internal.setTemplateName(getTemplateName());
__internal.setTemplatePackageName(getTemplatePackageName());
this.config = model.config();
this.expose = model.expose();
}
@Override
protected void __doRender() throws IOException, RenderingException {
// PlainText @ [2:39]
__internal.aboutToExecutePosInTemplate(2, 39);
__internal.writeValue(PLAIN_TEXT_0_0);
// IfBlockBegin @ [4:1]
__internal.aboutToExecutePosInTemplate(4, 1);
if (config.get("buildMaven").booleanValue()) {
// PlainText @ [4:46]
__internal.aboutToExecutePosInTemplate(4, 46);
__internal.writeValue(PLAIN_TEXT_1_0);
// WithBlockBegin @ [5:1]
__internal.aboutToExecutePosInTemplate(5, 1);
com.fizzed.rocker.runtime.WithBlock.with(config.get("artifactId").textValue() + "-" + config.get("version").textValue() + ".jar", false, (name) -> {
// PlainText @ [5:105]
__internal.aboutToExecutePosInTemplate(5, 105);
__internal.writeValue(PLAIN_TEXT_2_0);
// ValueExpression @ [5:118]
__internal.aboutToExecutePosInTemplate(5, 118);
__internal.renderValue(name, false);
// PlainText @ [5:123]
__internal.aboutToExecutePosInTemplate(5, 123);
__internal.writeValue(PLAIN_TEXT_3_0);
// WithBlockEnd @ [5:1]
__internal.aboutToExecutePosInTemplate(5, 1);
}); // with end @ [5:1]
// PlainText @ [5:135]
__internal.aboutToExecutePosInTemplate(5, 135);
__internal.writeValue(PLAIN_TEXT_1_0);
// IfBlockElse @ [6:1]
__internal.aboutToExecutePosInTemplate(6, 1);
} else { // else @ [6:1]
// PlainText @ [6:7]
__internal.aboutToExecutePosInTemplate(6, 7);
__internal.writeValue(PLAIN_TEXT_1_0);
// WithBlockBegin @ [7:1]
__internal.aboutToExecutePosInTemplate(7, 1);
com.fizzed.rocker.runtime.WithBlock.with(config.get("artifactId").textValue() + ".jar", false, (name) -> {
// PlainText @ [7:63]
__internal.aboutToExecutePosInTemplate(7, 63);
__internal.writeValue(PLAIN_TEXT_4_0);
// ValueExpression @ [7:80]
__internal.aboutToExecutePosInTemplate(7, 80);
__internal.renderValue(name, false);
// PlainText @ [7:85]
__internal.aboutToExecutePosInTemplate(7, 85);
__internal.writeValue(PLAIN_TEXT_3_0);
// WithBlockEnd @ [7:1]
__internal.aboutToExecutePosInTemplate(7, 1);
}); // with end @ [7:1]
// PlainText @ [7:97]
__internal.aboutToExecutePosInTemplate(7, 97);
__internal.writeValue(PLAIN_TEXT_1_0);
// IfBlockEnd @ [4:1]
__internal.aboutToExecutePosInTemplate(4, 1);
} // if end @ [4:1]
// PlainText @ [8:2]
__internal.aboutToExecutePosInTemplate(8, 2);
__internal.writeValue(PLAIN_TEXT_5_0);
}
}
private static class PlainText {
static private final String PLAIN_TEXT_0_0 = "\nFROM openjdk:11.0.3-slim\n";
static private final String PLAIN_TEXT_1_0 = "\n";
static private final String PLAIN_TEXT_2_0 = "COPY /target/";
static private final String PLAIN_TEXT_3_0 = " server.jar";
static private final String PLAIN_TEXT_4_0 = "COPY /build/libs/";
static private final String PLAIN_TEXT_5_0 = "\nCMD [\"/bin/sh\",\"-c\",\"exec java -Dlight-4j-config-dir=/config -Dlogback.configurationFile=/config/logback.xml -jar /server.jar\"]\n";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy