2 Replies Latest reply on Dec 8, 2014 7:39 AM by otinanism

    Deploy to remote Wildfly using jboss-cli non-interactive script

    otinanism

      I am trying to deploy a war using jboss-cli.bat (Windows machine).

       

      When I run the commands separetly it works:

       

      > jboss-cli.bat --connect --controller=ip:port --user=admin --password=***

      [standalone@10.61.0.113:10990 /] deploy test.war

       

      Then my application is deployed

       

      But what I need is to run this non-interactively so it can be run from a build server for example:

       

      >jboss-cli.bat --commands="connect --controller=ip:port --user=admin --password=***, deploy test.war"

       

      First if I run this command I get the error:

       

      'test.war' already exists in the deployment repository (use --force

      to replace the existing content in the repository).

       

      then I run again the command:

       

      >jboss-cli.bat --commands="connect --controller=ip:port --user=admin --password=***, deploy test.war --force"


      This time I get no error but the war is not deployed. I can check this by undeploying the war manually and running the command again.

       

      Any ideas?

        • 1. Re: Deploy to remote Wildfly using jboss-cli non-interactive script
          jaysensharma

          The Correct command  should be something like following:

           

          Example:

           

          ./jboss-cli.sh -c controller=remoteIP:9990 --user=admin --password=admin@123 --command="deploy /PATH/TO/test.war"
          
          
          

           

           

          If you get message like "'test.war' already exists in the deployment repository" which means your application was already deployed , this can be verified by looking at the jboss profile (like standalone.xml file  there should be a tag  <deployments> with your app info) So undeploy the app again and then deploy to verifiy the same or run the following command to list already existing deployed  applications:

           

          ./jboss-cli.sh -c controller=remoteIP:9990 --user=admin --password=admin@123 --command="deployment-info"
          
          • 2. Re: Deploy to remote Wildfly using jboss-cli non-interactive script
            otinanism

            Thank you that is correct! I am wondering if this is something that should be clearer on the documentation.