Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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

    Code Block
    #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