How to integrate Bonita CI/CD suite features in a CI pipeline

The Bonita CI/CD suite CLIs can not only be run interactively, but also within standard Continuous Delivery servers such as Jenkins CI, or GitHub Actions, or GitLab CI, etc.

There are many ways to integrate Bonita CI/CD suite in a CI pipeline. The samples proposed here explain how to integrate a bonita build and the bonita-la-deployer in a GitHub Actions CI job.

Building a Bonita Project

Since version 2023.2, a bonita project is a standard maven project, so you just have to do a standard maven build in your CI as first step.

Let’s assume the project to build is named my-project and the target deployment bonita profile is Qualification. Placeholders like …​ XXX …​ are to be replaced with your own values.

Default maven executable (mvn command) has to be configured to use the settings.xml file with access to "Bonita artifact repository". Use the default .m2/settings.xml location or use the .mvn/maven.config file option to specify the settings.xml path.

Classical build

Sample build steps in GitHub Actions
name: Build main
on:
  push:
    branches:
        - main
jobs:
    build:
        runs-on: ubuntu-24.04
        steps:
        - uses: actions/checkout@v4 (1)
        - uses: actions/setup-java@v4 (2)
            with:
            java-version: 17
            distribution: 'temurin'
            cache: 'maven'
        - name: Setup Maven configuration (3)
          uses: ... Use secret management to configure the maven settings with JFrog credentials ...
        - name: πŸͺΆ Build (4)
            run: mvn -B -ntp verify
        - name: πŸͺΆ Publish to maven repository (5)
            run: mvn -B -ntp  deploy -DskipTests -DaltDeploymentRepository= ... REPOSITORY_ID ...
    # other steps omitted ...
1 Checkout the repository
2 Install Java JDK and use maven dependency cache
3 Configure your maven settings with the credentials to access Bonita Artifact Repository (use secret management)
4 Build the bonita project
5 Publish project artifacts to your maven repository.

Docker build

Sample docker build steps in GitHub Actions
name: Build main
on:
  push:
    branches:
        - main
jobs:
    build:
        runs-on: ubuntu-24.04
        steps:
        - uses: actions/checkout@v4 (1)
        - uses: actions/setup-java@v4 (2)
            with:
            java-version: 17
            distribution: 'temurin'
            cache: 'maven'
        - name: Setup Maven configuration (3)
          uses: ... Use secret management to configure the maven settings with JFrog credentials ...
        - name: 🐳 Login to Bonita docker registry (4)
            uses: docker/login-action@v3
            with:
            registry: ... DOCKER_REGISTRY ...
            username: ... USER ...
            password: ... TOKEN ...
        - name: πŸͺΆπŸ³ Build (5)
            run: mvn -B -ntp verify -Pdocker

        - name: 🐳 Login to destination docker registry (6)
            uses: docker/login-action@v3
            with:
            registry: ... DOCKER_REGISTRY ...
            username: ... USER ...
            password: ... TOKEN ...
        - name: 🐳 Publish docker image (7)
            run: docker push ... IMAGE NAME ...
    # other steps omitted ...
1 Checkout the repository
2 Install Java JDK and use maven dependency cache
3 Configure your maven settings with the credentials to access Bonita Artifact Repository (use secret management)
4 Login to Bonita docker registry to be able to pull base image for SCA builds
5 Build the bonita project, using SCA mode by activating docker profile
6 Login to your own docker registry
7 Push your SCA image to your docker registry

Deploy step as part of CI job

The deployer is a standalone java program. The simplest way to use it, is to download it from Bonita Artifact Repository, and execute it with the desired arguments.

To access the bonita-la-deployer, you need a valid Bonita CI/CD suite subscription.
Sample deploy steps in GitHub Actions
# other steps omitted ...

- name: Extract version (1)
    id: extract-version
    run: echo 'version=$(mvn -B -ntp org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate -Dexpression=project.version -q -DforceStdout)' >> "$GITHUB_OUTPUT"

- name: πŸͺΆ Publish configurations to artifactory (2)
    run: |
    mvn -B -ntp package -Dbonita.environment=Qualification
    mvn -B -ntp deploy:deploy-file -Dfile=app/target/my-project-${{ steps.extract-version.outputs.version }}-Qualification.bconf -DgeneratePom=false -DgroupId=com.acme.my-project -DartifactId=my-project -Dversion=${{ steps.extract-version.outputs.version }} -Dtype=bconf -Dclassifier=Qualification -DrepositoryId=releases -Durl=... RELEASES_REPOSITORY_URL ...

- name: πŸš€ Deploy to integration environment (3)
    run: |
    mvn -B dependency:copy -Dartifact=com.bonitasoft.deployer:bonita-la-deployer:1.1.0:jar -Dmdep.stripVersion -DoutputDirectory=./'
    mvn -B --non-recursive exec:exec -Dexec.args="-jar bonita-la-deployer.jar -f app/target/my-project-${{ steps.extract-version.outputs.version }}-Qualification.zip -t ... BONITA_URL ... --username ... BONITA_TECH_LOGIN ... --password ... BONITA_TECH_PASSWD... "
1 Retrieve the project version
2 Build configuration for the target environment and pubish it
3 Run the deployer on the target server (here …​ BONITA_URL …​)
If you think quality is important, you can add an integration-tests maven module based on our test toolkit. As a standard maven module, all test present will be executed during the test or integration-test phase of your maven build.