Ingwersaft / wildfly-deploy-gradle-plugin

Gradle Plugin for deploying Files to Wildfly
https://plugins.gradle.org/plugin/com.mkring.wildlydeplyplugin.deploy-wildfly-plugin
GNU General Public License v3.0
10 stars 11 forks source link

Support for executing commands on the server #9

Closed aldonogueira closed 5 years ago

aldonogueira commented 5 years ago

This is the last thing I need from DeployWildflyTask to remove the maven files from my build.

I have this fragment on my pom.xml

<build>
    <plugins>
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>${wildfly.maven.plugin.version}</version>
            <configuration>
                <username>${user}</username>
                <password>${password}</password>
                <scripts>
                    <script>config.cli</script>
                </scripts>
            </configuration>
        </plugin>
    </plugins>
</build>

And the config.cli file has something like this

/subsystem=naming/binding=java\:global\/server.jndi.host:add(binding-type=simple, type=java.lang.String, value="10.0.16.3")
/subsystem=naming/binding=java\:global\/server.jndi.port:add(binding-type=simple, type=java.lang.String, value="9201")

This is the goal used in my build:
https://docs.jboss.org/wildfly/plugins/maven/latest/execute-commands-mojo.html

Ingwersaft commented 5 years ago

Hi,

I implemented a simple execute cli command task, part of the latest 0.2.8 version:

import com.mkring.wildlydeplyplugin.ExecuteWildflyTask
[...]
task("wildflyExecute", ExecuteWildflyTask::class) {
    host = "127.0.0.1"
    port = 9990
    user = "testuser"
    password = "123"
    commands = listOf("deployment-info", "deployment-info")
}

Does it work for you?

aldonogueira commented 5 years ago

It works nicely, sir (or lady). I have just deleted all remaining maven files \o/ Thank you

aldonogueira commented 5 years ago

Notice though that the correct groovy example should be

import com.mkring.wildlydeplyplugin.ExecuteWildflyTask

task executeCommands(type: ExecuteWildflyTask) {
    host = "127.0.0.1"
    port = 9990
    user = "testuser"
    password = "123"
    commands = ["deployment-info", "deployment-info"]
}
Ingwersaft commented 5 years ago

Thanks for the groovy example hint, I didn't test it before putting it into the readme... :) You're welcome 👍