Search code examples
gitjbpm

How do I use git to version control my jBPM project assets?


I have a new jboss/jbpm-server-full running in docker. I have a space and project, but I can start a new one too.

I know I can clone an existing space/project from inside the container with git clone ssh://wbadmin@0.0.0.0:8001/SomeSpace/SomeProject to my local machine, but I want to keep my stuff in Bitbucket.

I tried to "Import Project" with a Bitbucket repository URL, but it won't accept my authentication / credentials. What should I actually do to get my space or my project into Bitbucket and then from Bitbucket back into jBPMS?


Solution

  • I discovered a working process (We use bitbucket, but should be applicable to others too). This assumes you use SSH key authentication with Bitbucket.

    Develop

    1. Create project in jBPM
    2. Clone that project locally (change the URL, installation, port, space and process to fit your needs)

      $ git clone ssh://wbadmin@0.0.0.0:8001/MySpace/MyProcess

    3. Open the git repo and add your preferred git storage as a new remote -- here "bitbu" is a nickame I gave to the remote

      $ git remote add bitbu bitbucket.org:your-thingy/your-repo-name.git

    4. Make changes if you need to and first push directly to jBPM

      $ git commit -a -m "Test commit" && git push

    5. Then push those same changes to the other repo;

      $ git push bitbu

    6. This does mean that you have to remember to manually push the changes to bitbucket.

    Deploy

    1. Add your own ssh public key to Business Central > Admin > SSH Keys (it's most likely ~/.ssh/id-rsa.pub).
    2. Open your target space and import the project from bitbucket. This should just work.
    3. Deploy immediately (or add dependencies first if you need them).
    4. When changes happen, reimport the project and deploy again.