Build Application Component

🕓 10 minutes

What you’ll learn#

How to build the application component in the CodeNOW environment.

CodeNow offers you two options for component building: release and preview.

  1. Release build has its own version and no steps are skipped during the build process.

    • If your code contains any major errors, the build will fail.
    • You can check the quality of your code using the SonarQube static analysis after the component is built.
    • Also, you need to create a new package and configuration file for each release build before deployment.
  2. The main intention of the preview build is to quickly check whether the new changes work properly inside the deployed application.

    • This type of build doesn't have a version.
    • During this build, unit tests and the sonar qube analysis are disabled.
    • Preview build is automatically deployed into the chosen environment using the pre-existing configurations.

Prerequisites#

Release build#

  1. Build a new component version
    • An application release must contain only released components because it makes clear which fixed bugs and newly developed features are contained in a particular build.
    • A released component:
      • is tagged in git,
      • has updated its pom.xml descriptors,
      • is uploaded to the nexus artifact repository.
    • During the build process, unit tests are enabled.
    • Developers can check the build progress in CI/CD Builds Overview.
dep1.1

dep1.2

dep1.3

dep1.4

dep1.5

  1. See the result of code quality check
    • SonarQube is the most popular open-source tool for static code analysis and is integrated into CodeNOW. See more about SonarQube.
    • Let’s use the default oxus-java profile for the quality check.
    • A code quality check is a good first-line measure to evaluate overall code quality.
    • Defining quality gateways help for first glance decisions on whether the code is release-ready.
    • If the code quality is too low, improve your code and build a new component version (STEP 1)
dep2.1

dep2.2

  1. Repeat STEP 1 and STEP 2 for each improved application component.

Preview build#

  1. If you made some changes in one of the components and want to make a quick check before the release build, you can create a preview build.
    • The major differences from the release build is that during the build process, the unit testing and SonarQube steps are skipped. If the application contains errors, it may happen that the preview build was successful, but the deployed application doesn't work properly.
info

The precondition for the preview build is to have your component once properly deployed using the release build option. Because the preview build is deployed automatically, it takes an existing configuration for the chosen environment.

dep7.1

Component build history#

By clicking on the "Latest Builds" button, you will see the records of all previous builds.

  • You can change the number of the displayed latest builds in the list in the component detail page by changing the "Max Size of Builds Queue" value.
latest_builds

What’s next?#

You might be interested in our other tutorials: