Getting Started
This page is all about setting up application level changes at the user's end to help Odin operate at CD level.
Last updated
This page is all about setting up application level changes at the user's end to help Odin operate at CD level.
Last updated
A developer starts coding and ends with releasing the changes, the life-cycle of the same process is depicted below. For every step, what action needs to be performed is mentioned in this document.
To make your application code odin ready, run the below command in root of application code
This command will generate necessary files for odin as shown below.
Let's take a look at what each file means.
This file will store the version of your application and will be used while pushing the generated artifact to jfrog.
Sample content
Build.sh is used to create artifacts that'll be used to deploy the application component. Artifacts created are then uploaded to jfrog using version in the application-spec.yml
file.
Sample content for build.sh file for a Java project
Setup.sh is used to install required packages in the application image and/or make any changes to the application image to make it ready for deployment like adding some file from a public repository. This script is executed while building the application image and is optional.
The following environment variables will be available in setup.sh
:
This file is executed just before running start.sh during the deployment step. Things like db migrations or data seeding can be done in the step.
Pre-deploy.sh is executed in the root of the application code after unzipping the artifact present in jfrog
Once your are done with adding content to these files, you are all set to start deploying your service.
Automation for application artifact generation is supported jenkins jobs. This can be achieved by using automation via pr.jenkinsfile
. Adding the below stage in pr.jenkinsfile
You may choose to write your own build process. The build process should ensure that the below structure is maintained and the artifact is pushed to jfrog at the desired location.
Odin commands are executed in the <application_name>
folder e.g. ./.odin/pre-deploy.sh
ensure correct file paths are mentioned in the scripts.
The application code will be present in /app/<application_name>/
in case of docker images and in /var/www/<application_name>/
in case of EC2 instances. You might have to change paths in pm2-configs
for node projects
Add the pre-deploy code of your project to this file. If you dont have one, you can use template for reference(for java projects) and create a new one.
Write the code that's needed to start application component in this file. The name of the start script file is start.sh
by default. This can be configured by providing config.start_script_path
in the .
Add the booting code of your project to this file. If you don't have one, you can use template for reference(for java projects) and create a new one.
Odin expects the application artifact / executable in a remote artifactory repository like .
For use within Dream11, Odin expects artifact / executable zip to be in jfrog in the mentioned url in this link -
You can use jenkins job to create PR job.
Write logs to console in json format for docker containers. You can integrate for this. These logs will be sent to datadog
For Step 3, please refer to the document -
For Step 4, please refer to the document - .
For Step 6, please refer to the document - .