Create Application
In KubeRocketCI, all software components, such as applications, libraries, Terraform infrastructures, and automated tests, are referred to as codebases. KubeRocketCI provides flexible methods for scaffolding these components.
This guide will walk you through the process of creating a Go application using the Gin framework. The Marketplace will be used to streamline the application creation process.
Application Onboarding​
To create the first application, complete the instructions below:
-
In the KubeRocketCI, navigate to Marketplace.
-
In the Marketplace section, select Web Applications with Gin Framework:
-
On the application template details window, click Proceed:
-
In the appeared window, define the following values and click Apply:
- Component name:
my-go-gin-app
- Description:
My first application
- Git server:
github
- Repository name:
<github_account_name>/my-go-gin-app
- Codebase versioning type:
edp
- Start version from:
0.1.0
- Suffix:
SNAPSHOT
- Component name:
-
As soon as the codebase is created, navigate to it via the notification at the bottom left corner or click the Components section:
Build Application​
Having created the Go application, proceed to build it by performing the following actions:
-
In the create project page add new project to analyze it.
noteProject name in the Sonar cloud must be the same as codebase name.
Set the Previous version option and click Create project.
-
On the project menu, navigate to Branches menu, select
master
branch and rename it tomain
. -
On the account settings copy the value of the SonarCloud organization name.
-
In the component details page, expand the application and click the GIT button:
-
In the opened Source Code. In the
main
branch in GitHub, open thesonar-project.properties
file and include thesonar.language=go
, andsonar.organization
parameters wheresonar.organization
is equal to the value copied in the previous step, resulting in the following configuration:sonar.projectKey=my-go-gin-app
sonar.projectName=my-go-gin-app
sonar.go.coverage.reportPaths=coverage.out
sonar.test.inclusions=**/*_test.go
sonar.exclusions=**/cmd/**,**/deploy/**,**/deploy-templates/**,**/*.groovy,**/config/**
sonar.language=go
sonar.organization=<organization-key> -
Commit the changes.
-
In the component details page, click the Trigger build pipeline run button:
noteAfter first project scan, sonar creates Quality Gate for this project, and scan will be failed, rerun pipeline to analyze project with new Quality Gates.
-
To check the status of the build pipeline, click on its name:
-
Once the build fails, click the failed task name to open the Tekton pipeline run:
-
In KubeRocketCI, initiate the build pipeline again and wait for its completion.
Build pipelines in KubeRocketCI are specifically designed to generate an executable image of an application. Once the build process is complete, the resulting image can be deployed and run in a target environment.
Now that you have successfully built an application, the next step is to create an environment for deployment. In order to deploy the application, you will need to install and integrate Argo CD. To learn how to install and integrate Argo CD, please refer to the Integrate Argo CD page.