> For the complete documentation index, see [llms.txt](https://tech.x2bee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tech.x2bee.com/dev-guide/developer-guide-en/pjt-prepare/architecture-guide/ci-cd-configuration-design.md).

# CI/CD Configuration Design

## Kubernetes App

<figure><img src="https://200425-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVEZx3rsZsIv89GPS3d2J%2Fuploads%2FS8TWmtQwkONUFlOedlG6%2FKubernetes%20App.png?alt=media&#x26;token=026e79bf-0240-43ba-82cc-44a0cfe3b4c4" alt=""><figcaption></figcaption></figure>

<table data-header-hidden><thead><tr><th width="215.111083984375">Resource</th><th>Info</th></tr></thead><tbody><tr><td><strong>Resource</strong></td><td><strong>Info</strong></td></tr><tr><td><strong>Source/script commit</strong></td><td>Developers commit completed source code to the Gitlab repository</td></tr><tr><td><strong>Source and script reference</strong></td><td>Jenkins pulls the completed source code from Gitlab</td></tr><tr><td><strong>Library reference</strong></td><td>Required libraries are referenced from Nexus during the maven build</td></tr><tr><td><strong>Container image storage</strong></td><td>Once the build completes, a docker image is created and stored in the Nexus repository</td></tr><tr><td><strong>Deployment request</strong></td><td>Requests deployment to ArgoCD</td></tr><tr><td><strong>Script reference</strong></td><td>ArgoCD pulls the deployment script from Gitlab and delivers its contents to Kubernetes</td></tr><tr><td><strong>Container sync request</strong></td><td>Developers commit completed source code to the Gitlab repository</td></tr><tr><td><strong>Scheduling</strong></td><td>Specifies the Worker Node that will perform the deployment</td></tr><tr><td><strong>Application image reference</strong></td><td>Pulls the docker image stored in Nexus and deploys it</td></tr><tr><td><strong>Static content deployment</strong></td><td>Static content included in the application is deployed to S3</td></tr></tbody></table>

## CI / CD Environment

<figure><img src="https://200425-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVEZx3rsZsIv89GPS3d2J%2Fuploads%2FmormvWoq6dzwphpTNDWv%2FCI_CD%20%E1%84%92%E1%85%AA%E1%86%AB%E1%84%80%E1%85%A7%E1%86%BC.png?alt=media&#x26;token=a63b3404-d994-4fe7-ba77-9531198269c9" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### Development / Push

The development team writes source code in the IDE (STS4) and pushes it to the Gitlab server

* Source coding
* Writing and running unit tests (JUnit4)
* Running Code Inspection (CheckStyle, PMD, FindBugs)
  {% endstep %}

{% step %}

### Configuring and Running the Build Trigger

The operations team configures and runs Jenkins' build trigger conditions based on the environment and status

* Manual run / periodic run / run on success of another project / run by detecting a Gitlab Push event
  {% endstep %}

{% step %}

### Inspection — CheckStyle

Runs a coding-format check (whether the next step proceeds on failure depends on the configuration)

* Checks compliance with basic JAVA syntax
* Checks compliance with the project's Coding Style Guide
  {% endstep %}

{% step %}

### Inspection — PMD

Runs a check for unnecessary code (whether the next step proceeds on failure depends on the configuration)

* Checks for unused variables or functions
  {% endstep %}

{% step %}

### Unit Tests

Runs unit tests (proceeds to the next step only if the unit tests succeed)

* Runs JUnit tests
* Generates code coverage information when the unit tests succeed
  {% endstep %}

{% step %}

### Maven Build and Artifact Storage

Generates the Spring Boot jar via a Maven build and stores it in Nexus
{% endstep %}

{% step %}

### Inspection — FindBugs

Runs a check for potential error-prone areas (whether the next step proceeds on failure depends on the configuration)

* Checks for areas that could cause errors at runtime (e.g., NullPointer)
  {% endstep %}
  {% endstepper %}

###
