Build artifacts for multi module applications

Application artifacts are prerequisite to create service definitions and deploy them using odin.

We have already seen the output for single application in the onboard your service section.

For multi module applications we'll follow similar steps. Let's say our multi module application has two applications APPLICATION_ONE and APPLICATION_TWO.

To get started we'll create the required structure for both the applications, to do the same run the below command in the working directory,

odin generate application-template --name APPLICATION_ONE
odin generate application-template --name APPLICATION_TWO

This will generate the below structure in your working directory.

<application_folder>
    └─── application related files
    └─── .odin
        └─── APPLICATION_ONE
            | application-spec.yml
            | build.sh
            | pre-deploy.sh
            | start.sh
       └─── APPLICATION_TWO
            | application-spec.yml
            | build.sh
            | pre-deploy.sh
            | start.sh

Complete the build.sh , pre-deploy.sh and start.sh as required. Example given here

Creation of service artifacts

Automation for application artifact generation is supported in jenkins jobs. This can be achieved by using automation via pr.jenkinsfile. Adding the below stage in pr.jenkinsfile

stage('Push: Push to Jfrog') {
  steps {
      retryWithBackoff(STAGE_RETRY_COUNT, STAGE_BACKOFF_SECONDS) {
        script {
          releasePackage(["${APPLICATION_1}", "${APPLICATION_2}"])
        }
      }
  }
}

By default releasePackage assumesthe stable branch is master.

If your Github repo has a different stable branch, then you can specify the branch as 2nd argument in the releasePackage

ex: releasePackage(["${APPLICATION_1}", "${APPLICATION_2}"], "main")

Last updated