All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.graphql.dockerfile 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/dockerfile.rocker.raw
 * Do not edit this file. Changes will eventually be overwritten by Rocker parser!
 */
@SuppressWarnings("unused")
public class dockerfile extends com.fizzed.rocker.runtime.DefaultRockerModel {

    static public com.fizzed.rocker.ContentType getContentType() { return com.fizzed.rocker.ContentType.RAW; }
    static public String getTemplateName() { return "dockerfile.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 dockerfile config(JsonNode config) {
        this.config = config;
        return this;
    }

    public JsonNode config() {
        return this.config;
    }

    public dockerfile expose(String expose) {
        this.expose = expose;
        return this;
    }

    public String expose() {
        return this.expose;
    }

    static public dockerfile template(JsonNode config, String expose) {
        return new dockerfile()
            .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 azul/zulu-openjdk-alpine:11 as packager\n\nRUN { \\\n        java --version ; \\\n        echo \"jlink version:\" && \\\n        $JAVA_HOME/bin/jlink --version ; \\\n    }\n\nENV JAVA_MINIMAL=/opt/jre\n\n# build modules distribution\nRUN $JAVA_HOME/bin/jlink \\\n    --verbose \\\n    --add-modules \\\n        java.base,java.sql,java.naming,java.desktop,java.xml,jdk.crypto.cryptoki,jdk.crypto.ec,jdk.unsupported,java.management,java.security.jgss,java.net.http \\\n    --compress 2 \\\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(dockerfile.class.getClassLoader(), dockerfile.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(dockerfile 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 @ [31:1]
            __internal.aboutToExecutePosInTemplate(31, 1);
            if (config.get("buildMaven").booleanValue()) {
                // PlainText @ [31:46]
                __internal.aboutToExecutePosInTemplate(31, 46);
                __internal.writeValue(PLAIN_TEXT_1_0);
                // WithBlockBegin @ [32:1]
                __internal.aboutToExecutePosInTemplate(32, 1);
                com.fizzed.rocker.runtime.WithBlock.with(config.get("artifactId").textValue() + "-" + config.get("version").textValue() + ".jar", false, (name) -> {
                    // PlainText @ [32:105]
                    __internal.aboutToExecutePosInTemplate(32, 105);
                    __internal.writeValue(PLAIN_TEXT_2_0);
                    // ValueExpression @ [32:118]
                    __internal.aboutToExecutePosInTemplate(32, 118);
                    __internal.renderValue(name, false);
                    // PlainText @ [32:123]
                    __internal.aboutToExecutePosInTemplate(32, 123);
                    __internal.writeValue(PLAIN_TEXT_3_0);
                    // WithBlockEnd @ [32:1]
                    __internal.aboutToExecutePosInTemplate(32, 1);
                }); // with end @ [32:1]
                // PlainText @ [32:135]
                __internal.aboutToExecutePosInTemplate(32, 135);
                __internal.writeValue(PLAIN_TEXT_1_0);
                // IfBlockElse @ [33:1]
                __internal.aboutToExecutePosInTemplate(33, 1);
            } else { // else @ [33:1]
                // PlainText @ [33:7]
                __internal.aboutToExecutePosInTemplate(33, 7);
                __internal.writeValue(PLAIN_TEXT_1_0);
                // WithBlockBegin @ [34:1]
                __internal.aboutToExecutePosInTemplate(34, 1);
                com.fizzed.rocker.runtime.WithBlock.with(config.get("artifactId").textValue() + ".jar", false, (name) -> {
                    // PlainText @ [34:63]
                    __internal.aboutToExecutePosInTemplate(34, 63);
                    __internal.writeValue(PLAIN_TEXT_4_0);
                    // ValueExpression @ [34:80]
                    __internal.aboutToExecutePosInTemplate(34, 80);
                    __internal.renderValue(name, false);
                    // PlainText @ [34:85]
                    __internal.aboutToExecutePosInTemplate(34, 85);
                    __internal.writeValue(PLAIN_TEXT_3_0);
                    // WithBlockEnd @ [34:1]
                    __internal.aboutToExecutePosInTemplate(34, 1);
                }); // with end @ [34:1]
                // PlainText @ [34:97]
                __internal.aboutToExecutePosInTemplate(34, 97);
                __internal.writeValue(PLAIN_TEXT_1_0);
                // IfBlockEnd @ [31:1]
                __internal.aboutToExecutePosInTemplate(31, 1);
            } // if end @ [31:1]
            // PlainText @ [35:2]
            __internal.aboutToExecutePosInTemplate(35, 2);
            __internal.writeValue(PLAIN_TEXT_5_0);
        }
    }

    private static class PlainText {

        static private final String PLAIN_TEXT_0_0 = "\nFROM azul/zulu-openjdk-alpine:11 as packager\n\nRUN { \\\n        java --version ; \\\n        echo \"jlink version:\" && \\\n        $JAVA_HOME/bin/jlink --version ; \\\n    }\n\nENV JAVA_MINIMAL=/opt/jre\n\n# build modules distribution\nRUN $JAVA_HOME/bin/jlink \\\n    --verbose \\\n    --add-modules \\\n        java.base,java.sql,java.naming,java.desktop,java.xml,jdk.crypto.cryptoki,jdk.crypto.ec,jdk.unsupported,java.management,java.security.jgss,java.net.http \\\n    --compress 2 \\\n    --strip-debug \\\n    --no-header-files \\\n    --no-man-pages \\\n    --output \"$JAVA_MINIMAL\"\n\n# Second stage, add only our minimal \"JRE\" distr and our app\nFROM alpine\n\nENV JAVA_MINIMAL=/opt/jre\nENV PATH=\"$PATH:$JAVA_MINIMAL/bin\"\n\nCOPY --from=packager \"$JAVA_MINIMAL\" \"$JAVA_MINIMAL\"\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