Octopus Deploy
We use Octopus Deploy to deploy KODIAK Oms on internal test environments as well as on both UAT and PROD environments for our clients.
Kóði has a Octopus Cloud server: https://kodiak.octopus.app , if you need access you can contact Magnús (magnus@kodi.is)
To start using Octopus
A tentacle needs to be installed on the server, we are using “Polling tentacles” since the servers are not open to the internet. Information on tentacles: https://octopus.com/docs/infrastructure/deployment-targets/tentacle/tentacle-communication
Port 10943 or 10933 must be open out from the server, the server will be polling kodiak.octopus.app
The tentacle can be downloaded from here: https://octopus.com/downloads
After installing the tentacle a “Tenant” must first be created in the https://kodiak.octopus.app website, when creating the Tenant a environment and project must be specified.
Setting up the Tentacle on the server, you must go through the setup process
Choose a “Polling tentacle”
Authenticate with the https://kodiak.octopus.app server by creating an API key
Choose the correct environment, role and tenant
Port 10933 or 10943 is the default port for the tentacle and must be opened in some cases
When setting up a new tentacle a “Tenant” must be created in the Octopus server for that machine.
We use Jenkins to build, set the environment variables and deploy to the servers
Creating a project in Octopus Deploy
Before creating a Jenkins job you must create the project in the Octopus interface, a project in Octopus deploy is a recipe for how to deploy the executables.
The KODIAK Trade Report Server is a good example of how a Windows Service is deployed.
Setting up a Jenkins job
One Jenkins job must create the release before it can be deployed, it can be done in the post build action. Please note that a release can only be created once if it is created again the build will fail. Thus it is best to create the release on the main release/staging/develop builds and create a new build that deploys and changes the environmental variables.
Example of create version settings in Jenkins:
You should add a parameter to the build to prompt before you build and deploy the new version to the server:
Here below is a sample of how the build is configured in Jenkins (https://jenkins.livemarketdata.com/view/.Net/view/KODIAK OMS/view/Octopus Deploy/view/Production Deployments/view/Kvika Production/job/kodi_kodiak_integration_release_test_kvika.release.octopus/configure) :
NOTE: This config is for PRODUCTION and shoud not be copied with the tenant and environment variables#Instance variables branch="release" tenant="kvika-DO NOT COPY" environment="PROD - DO NOT COPY" #Below should be the same for all deployments in develop branch zip_file_name_prefix="kodi_kodiak_customer_integration" main_path="c://Builds/${branch}/kodi_kodiak_customer_integrations" instance_path="${main_path}/tenants/source/${tenant}/${environment}" zip_files_path="${main_path}/tenants/zipfiles/${tenant}/${environment}" s3bucketBaseUrl="s3://kodi-artifacts/windows/release/kodiak_oms/server/customer_integration/kvika" read BUILDVERSION < "${main_path}/output/version.txt" echo ${BUILDVERSION} #remove files from previous builds rm -rf ${instance_path} rm -rf ${zip_files_path} mkdir -p ${instance_path} mkdir -p ${zip_files_path} #copy deployment files cp -r ${main_path}/output/* ${instance_path} cp -r KodiakCustomerIntegration/Configs/${tenant}/${environment}/* ${instance_path} # zip and send Customer Integration zipFileName="${zip_file_name_prefix}.${tenant}.${environment}.${BUILDVERSION}.zip" zipFilePath="${zip_files_path}/${zip_file_name_prefix}.${tenant}.${environment}.${BUILDVERSION}.zip" 7z a -tzip ${zipFilePath} ${instance_path}/* # zip and send Customer Integration to Octopus zipFilePath="${zip_files_path}/${zip_file_name_prefix}.${tenant}.${environment}.${BUILDVERSION}.zip" 7z a -tzip ${zipFilePath} ${instance_path}/* C:/ProgramData/chocolatey/bin/octo.exe push --server https://kodiak.octopus.app/ --apiKey API-XXXXXXXX --space Spaces-1 --package ${zipFilePath} --overwrite-mode OverwriteExisting # send aws s3 cp ${zipFilePath} ${s3bucketBaseUrl}/${zipFileName} # remove instance path to save space rm -rf ${instance_path} # Deploy version to server C:/ProgramData/chocolatey/bin/octo.exe deploy-release --deployTo Production --version ${BUILDVERSION} --tenant ${tenant}.${environment} --progress --project "Kodiak Customer Integration" --server https://kodiak.octopus.app/ --apiKey API-XXXXXXX --space Spaces-1 --debug