1 Reply Latest reply on Feb 14, 2020 3:12 PM by juancarlosvaca

    How to maintain process modification on multiple branches for multiple environments

    sheriefshawky

      I'm using KIE server for designing processes, but there will be multiple environments (DEV, Testing, UAE, Support , Production),

      how can I preserve the source for each process (project) , merging the changes on different branches.

       

      example, If I have support developer fixing issue for production and in the same time, I have development team changing the process steps.

      how I can preserve all these changes on one repo and maintain the merging between branches while each one has his own Kie server for his development

        • 1. Re: How to maintain process modification on multiple branches for multiple environments
          juancarlosvaca

          Maybe this can help you.

          1.- create a repo in GitHub or another site

           

          2.- Clone your code form kie server using git clone (Check this site How to Git Clone a Drools KIE WorkBench Repository - Intertech Blog ).  In my case "git clone ssh://wbadmin@localhost:8001/MySpace/credito.hipotecario". If you work on Linux maybe you have to configure ssh before the git clone command, to do so, edit  ~/.ssh/config file and add

           

          Host localhost

           

            VerifyHostKeyDNS no

            StrictHostKeyChecking no

            HostKeyAlgorithms +ssh-dss

            PubkeyAcceptedKeyTypes +ssh-dss

            UserKnownHostsFile /dev/null

           

          Save the file, and issue git clone.

           

          3.- Once cloned, go to the project folder and issue this command "git remote -v"  In my case  a got this

          git remote -v

          origin http://localhost:8080/business-central/git/my-jbpm/sample.jbpm (fetch)

          origin http://localhost:8080/business-central/git/my-jbpm/sample.jbpm (push)

           

          Then rename the remote using this command

          git remote rename origin kie

          and verify using

          git remote -v

           

           

          4.- Add a new remote pointing to your github repo

          git remote add origin https://github.com/github/your_new_poject.git

           

          5.- Now push your code to the new remote (This is git stuff)

          git push -f origin master

          Where:

          origin is the name of the remote

          master is the name of the branch

          -f tells git ignore any commit the remote and make prevail may local repository commits (caution is required here, and make sure you understand what -f flag does)

           

          6.- Now you can make changes in KIE server, when finish, go to the command line and issue this command

          git pull kie master

           

          and then

           

          git push origin master

           

          This way, you have centralized your code in GitHub, and you can apply your workflow as you need, create branches, etc.

           

          Now, how to upload GitHub code into KIE server of every team member.

          1.- Create a brand new project in KIE server

          2.- Clone GitHub project

          3.- add a remote pointing to your kie repo

          git remote add kie https://github.com/lasalazarr/cloudbanco.git    

          4.- execute

          git push -f kie master  (remember that -f flag overrides repository commits to preserving yours)

           

          As you can see, this is a game of push and pull into the correct remote.

           

          The next time you have to execute "git pull origin master" and then "git push kie master" or "git pull kie master"  and "git push origin master"

           

          This approach has its caveats, and the team has to be very clear that the git -f can override the commits of the repo, so caution is necessary.

           

          I hope this helps you.