9 Replies Latest reply on Feb 4, 2014 11:45 AM by Jay Guidos

    Deploy a project without Workbench

    Jay Guidos Novice

      Hi All,

       

      I am trying to build and deploy an existing project without starting workbench. I was using kie-config-cli, and I can delete existing deployments but I can't seem to build and deploy.

       

      There is no 'build' command, as far as I can see, and when I try to do an add-deployment it prompts me for GAV and such and then says 'successfully deployed'.  But if I stop and start the CLI again the deployment is lost.  And I am not sure if it ever really built anything at all.

       

      Can you give me a step-by-step example of how to do this?

       

      Jay

        • 1. Re: Deploy a project without Workbench
          Maciej Swiderski Master

          kie-config-cli does not build and deploy, it simply allows to put kjars already built (that are in maven repository) to be deployed. By default kie-config-cli works on its local copy of the system git repository taken from kie-workbench, once you modify changes you can push those changes back to the kie-workbench but to do so, you need to have kie-wb up and running as it then exposes git server so the changes can be pushed. If you work in offline mode, modifying directly system git in .niogit folder then the information will be written directly and on next start of the kie-wb those deployments will be attempted to be activated.

           

          HTH

          • 2. Re: Deploy a project without Workbench
            Jay Guidos Novice

            HI Maciej,

             

            I am still struggling to understand what kie-config-cli is actually useful for, but this helps somewhat.  So you didn't really answer my question, which was "how to build and deploy a project WITHOUT using workbench"?  I suppose I could try and copy the .niogit system folder on a server that does have workbench deployed but it seems pretty clunky.  I have all the source of the project thanks to GIT, is there a build/deploy library I could call manually from within my EJB? I would prefer our production server not have workbench deployed on it.

             

            Jay

            • 3. Re: Deploy a project without Workbench
              Maciej Swiderski Master

              Jay Guidos wrote:

               

              HI Maciej,

               

              I am still struggling to understand what kie-config-cli is actually useful for, but this helps somewhat.

              it is to be able to manipulate configuration of kie workbench such as organizational units, repositories, deployments, roles assigned to repositories. It allows to do so in two modes:

              • online - when kie wb is up and running then it operates over the git server hosted by kie wb
              • offline - as sort of installer, that allows you to create initial setup so application can bootstrap with ready to use configuration

               

              Jay Guidos wrote:

               

              So you didn't really answer my question, which was "how to build and deploy a project WITHOUT using workbench"?  I suppose I could try and copy the .niogit system folder on a server that does have workbench deployed but it seems pretty clunky.  I have all the source of the project thanks to GIT, is there a build/deploy library I could call manually from within my EJB? I would prefer our production server not have workbench deployed on it.

              why would you need to build projects in your production server? They should already be built and available for execution in maven repository. Applications should actually run the business assets rather then build them from source, otherwise how would you deal with build time errors? Does you application provide design time functionality like model processes, rules, forms etc?

              Kie wb is both design and runitme tool and that's why it provides such capabilities, but it can also be ran as execution server where no UI is available and it dedicated for processing of the actual work - process execution.

              So you should more look at the runtime capabilities in your application, while kie-wb use for design and build. Alternatively you can completely skip kie-wb when it comes to build and use CI (like jeniks) to fetch git projects build them in deploy to maven.

               

              HTH

              • 4. Re: Deploy a project without Workbench
                Jay Guidos Novice

                Hi Maciej,

                 

                I don't need to build in production, I just don't know how to move everything from my workbench server to my production server. So you are saying all I really need to do is:

                 

                1. the project is built into your extra local repo located at JBOSS_HOME/repository (why you just don't use the standard local maven repo directory is a mystery I have yet to solve)
                2. this appears to be a regular maven repo, so I can use regular maven operations to put it in the equivalent directory on my production server
                3. from my production server, deploy the project using the KModuleDeploymentService

                 

                So I don't need any of the other stuff sprinkled in the .nogit system directory?

                 

                Jay

                • 5. Re: Deploy a project without Workbench
                  Jay Guidos Novice

                  OK I just tried this, and while I still don't know what /repositories is for, I put the assembled project into my local Maven repo on the production server and could deploy the project. So apparently your maven repository manager looks there as well. Progress!

                  • 6. Re: Deploy a project without Workbench
                    Maciej Swiderski Master

                    Jay Guidos wrote:

                     

                    Hi Maciej,

                     

                    I don't need to build in production, I just don't know how to move everything from my workbench server to my production server. So you are saying all I really need to do is:

                     

                    1. the project is built into your extra local repo located at JBOSS_HOME/repository (why you just don't use the standard local maven repo directory is a mystery I have yet to solve)

                    this is not a local maven repo but remote repo that is available over http. JBOSS_HOME/repository is just store of the artifacts that maven repo provide access to. At the same time the artifact is installed to the real local maven repository (~/.m2/repository). With that you can simply configure your production environment maven to use this remote maven repository (this can be done by adding repository configuration in settings.xml) and that's it.

                     

                    Jay Guidos wrote:

                    1. from my production server, deploy the project using the KModuleDeploymentService

                     

                    So I don't need any of the other stuff sprinkled in the .nogit system directory?

                     

                    Jay

                    exactly, that's the whole idea, you separation between design time and runtime activities and in between there is maven and its standards when it comes to packaging and distribution artifacts and dependencies.

                     

                    I'll write a blog about various deployment options soon, hopefully this week so will link it here as well.

                     

                    HTH

                    • 7. Re: Deploy a project without Workbench
                      Jay Guidos Novice

                      Looking forward to it! We can't link from production back to a development repository (no network routes) but knowing the project artefacts are in both the local and your hosted remote repos is very useful.  I can push them to our corporate production repo easily enough!  This is good stuff, thanks for the info and again I look forward to reading your blog.

                       

                      Jay

                      • 8. Re: Deploy a project without Workbench
                        Maciej Swiderski Master

                        here it is, enjoy reading and comments are welcome.

                         

                        HTH

                        • 9. Re: Deploy a project without Workbench
                          Jay Guidos Novice

                          Hi Maciej,

                           

                          An excellent article.  There should be some way to push this content back into the manual.  I find the main docs very "arm wavy", meaning good for background information but not so useful when you stare at an open, empty IDE java window and think "OK, what now?".  More hands on like this would be an immense help.

                           

                          Jay