Octopus Deploy deploymnet into Azure Blob using Jenkins and Azure Blob Library

Hi Team,

My Octopus Deploy will connect with Maven Artifactory as external feed.I want to choose an option of passing the version number as parameter while invoking Octopus Deploy from Jenkins for my CI CD.Could you please advise how can I achieve this? Below link says octopus Deploy takes latest version as default which I don’t want? https://octopus.com/docs/packaging-applications/package-repositories/maven-feeds

As suppose out of 10builds/deployments I want to promote the 7th version from CIT to SIT, then 7th version has to be passed as variable to Octopus deploy?

Note-I’m using Azure library to deploy and using Maven as external feed

https://library.octopusdeploy.com/step-template/actiontemplate-azure-blob-storage-upload

Second question-

If the above has some solution, I will need to deploy the package in two nodes of Azure Blob (DR’s), how can I achieve that?

Please help.

Thanks,

Siddharth

Responded via support email

Hi Shannon

I’m not able to see your response neither in mail nor in the topic.Where to view that?

Thanks
Siddharth

I can see it in our outgoing mailbox. Your message was a reply to an earlier message, so the title was a bit different to the subject here. Anyway, I’ll copy the response here, it might help others that way too.

Could I just check, are you using the Jenkins extension or are you calling octo.exe from a script step yourself? You can specify a specific version for a package either way, the mechanics are just slightly different.

If you’re using the extension you can use the UI to either set the Default package version (which works if your deployment process only has 1 package or the packages are a set with matching version numbers) or to set the individual versions for the individual packages.

If you’re using octo.exe directly then what you’re after are the --defaultpackageversion or the --package options.

Both of these work if the version you’re referring to is something like 1.0.7 vs 1.0.10. I’m not an expert with Maven feeds, but my understanding is that for SNAPSHOTs within a version you can only use the current snapshot, you can’t specify an earlier snapshot.

Could I also just confirm what CIT and SIT are? We usually refer to promoting in Octopus as promotion between environments, so I’m wondering if they are environments and this is what you mean?
If they are environments, do you have Jenkins triggering the promote somehow or are you just doing that in Octopus itself?

For example, a typical process I’d use would be to have Jenkins just build the packages, push them to Octopus, and create a release in Octopus for that version. So I might have releases 1.0.7 and 1.0.10 from the earlier version number examples. I can then go to those releases in Octopus and deployment them to an environment without running anything in Jenkins.

Regarding question 2, unfortunately we don’t currently have a specific standalone step for pushing a package to Azure Blob storage. My recommendation would be to use an Azure PowerShell step in conjunction with the Packages in Script Step feature. This will let you get the package and use the Azure PowerShell cmdlets to push it to the storage account you need.

I hope that helps and if I can assist further just let me know.

Regards
Shannon

Hi Shannon,
Thanks for your response.Let me make it clear.
I have Azure Blob storage Environmnets as CIT(single node), SIT(single node), Pre-Prod(two nodes) and PROD(two nodes).
The application is of ReactJS code and after build I will pack as zip and upload to Maven Artifactory JFrog.
My CI CD model is -Jenkins fetch the code from BitBucket and build it using yarn command,then zip and upload to artifactory.Jenkins to download the zip and using Octopus deploy, deploy to Azure Blob CIT environment first.So upto here it would be continuous Build and deploy. In a different jenkins job for SIT(next higher environment), I want to deploy the Release which is signed off in CIT.It may be the case that though I’ve tested 1.0.7 which I want to deploy to SIT but currently 1.0.10 is there in CIT. So for SIT deployment, I will pass the version to Octopus deploy to deploy into Azure SIT(no build of src here as the Release is already available in Artifactory).Is it possible?
I can use Jenkins plugins or octo.sh (linux), so for CIT build/deploymment, I think I can make a release version and then do this as that is continuous process?
Octo.sh" pack --format=zip -id=dejavu-web --basePath=“proj\dejavu\test\ats-webapp\app” --version 1.1.%BUILD_NUMBER%-WEBDEJTEST --packageversion 1.1.%BUILD_NUMBER%-WEBDEJTEST --server OCTOPUS_SERVER_IP:9010 --apiKey %OctopusApiKey%

Octo.sh" push
–package dejavu-web.1.1.%BUILD_NUMBER%-WEBDEJTEST.zip
–server http://OCTOPUS_SERVER_IP:9010
–apiKey %OctopusApiKey%

Octo.sh" create-release
–project dejavu-web
–version 1.1.%BUILD_NUMBER%-WEBDEJTEST
–packageversion 1.1.%BUILD_NUMBER%-WEBDEJTEST
–server OCTOPUS_SERVER:9010
–apiKey %OctopusApiKey% --deployto=TEST --progress

Here during Build I will create a version number and that version I will upload to artifcatory,then call Octopus deploy (inbuild or external feed) and deploy for CIT.

Please confirm if I choose Maven feed as external Repo in Octopus Deploy, still I can pass the version which I want to deploy for SIT or to make this possible I have to use in Built Octopus Deploy Repo?
Is there any way that I can directly promote or deploy by passing version number the application from CIT to SIT using command line?

I don’t want to use the Octopus Deploy UI and everything should happen via Jenkins.

Please advise.

Thanks,
Siddharh

Hi Siddharh,

In Octopus terminology, a Release is a snapshot of the code/binaries at a point in time. You then promote that release through a lifecycle to different environments, using a Deployment.

When creating a release the package versions are specified and stored as part of the snapshot. This works equally whether the packages are coming from an external feed (e.g. Maven) or the Octopus internal feed.

In the example call you used to Octo.sh you are creating a release and then deploying it to TEST in a single command line, but it is actually 2 separate operations to Octopus. This is fine, and a common usage. You can then promote that same release (i.e. do the 2nd operation again) to a different environment using the deploy-release command, and it will use all the same package versions used when the Release was created.

Regards
Shannon

Hi Shannon

Thanks for explaining.

So in the example-
for the SIT (next env) deployment I can use create-release command and pass/put the version number I want to deploy and that version will be deployed(1.0.7) irrespective of latest version in Repo (inbuilt/external) is 1.0.10?

Please confirm if this is correct.

If that’s true…then for external Repo I.e. Maven Feeds, Octopus Deploy will download that version 1.0.7 from repo automatically?

Thanks
Siddharth

The key is to remember that a Release and a Deployment are separate things in Octopus.

If you specify 1.0.7 as the package version when you do the initial create-release, that version will be locked against that release version. If you then run octo deploy-release --version=1.0.7 --deployto=SIT you are asking it to deploy release number 1.0.7 to SIT. Another release (e.g. 1.0.10) could have been created in the meantime but it is a completely separate release and will not interfere with 1.0.7.

The machine doing the deployment will go looking for the version locked to the release, and if it isn’t already cached locally it will download it from the designated repo, whether that is internal or external.

Regards
Shannon

Thank you so much Shannon.I will try this and get back you.

so here what I’m going to…
Configure Octopus Deploy to talk to Maven Atrifactory as External feed (no in built repo).
For CIT-Jenkins builds, pushes to maven artifactory then use oct create-release with passing version to deploy to CIT.
Incase I want to revert back the old version, I will use create deploy with old version to deploy to CIT.If that old version is deleted from Octopus Deploy cache then it will download automatically from external feed?

For SIT-i will use octo create deploy by passing version number to deploy.Same as above for CIT with old code version.

Please confirm and correct me If I’m wrong.

Thanks
Siddharth

Hi Shannon

Will it be possible for you to come in a call to discuss?
I will setup a webex meeting based on your timings.I’m UK based.

Thanks
Siddharth

Hi Siddarth,

Shannon passed this over to me as I am based in the UK as a Solution Architect for Octopus.

You can schedule in some time with me here. We can jump on a zoom call with you next week if that works.

Thanks

Derek

HI Derek,

Thank you so much.

I’m not able to select the timings from here but can we do on Tuesday 12-1PM BST? Is that ok for you?

I will send you the webex link and the bridge number so zoom doesn’t work here.

Thanks,

Siddharth

Hi Siddarth,

That time works. Can you please email an invite to Derek.Campbell@Octopus.com?

Thanks

Derek

Thank you so much Derek.Much Appreciated.

At the moment I’m keeping the configurations ready for Jenkins,Maven Artifactory and Octopus Deploy.Once done, I will send you invite the invite.If I’m not able to complete by Tuesday, is Wednesday would be fine for you to review?

Actually I’m waiting for the vendor to come back on Azure Blob Service Principal which is required for Azure Blob storage Deployment, which I was expecting today and hence requested for Tuesday.Apologies.

Thanks,

Siddharth

Hi Derek,

Thank you so much and welcome.

I’m not able to choose the timing so will next tuesday 12-1PM BST ok for you?

Some reason I will not be able to access zoom, so can I send the webex and bridge number to you?

Thanks
Siddharth

Public

Hi Derek,

I’m got the subscription details and progressing now.

I got the below error while trying from octopack push (create package worked anyway)

Error:-

Octopus Deploy Command Line Tool, version 4.42.2

System.TypeInitializationException: The type initializer for ‘System.Net.Http.CurlHandler’ threw an exception. —> System.TypeInitializationException:
The type initializer for ‘Http’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘HttpInitializer’ threw an exception. —> System.DllNotFoundException: Unable to load DLL ‘System.Net.Http.Native’: The specified module
or one of its dependencies could not be found.

(Exception from HRESULT: 0x8007007E)

at Interop.Http.GetSslVersionDescription()

I got the below link which talks about the issue-

https://help.octopusdeploy.com/discussions/questions/14021-octo-on-ubunto-crashes

Could you please help in the system requirements and what else I need to fix the issue-

My system details are-

Linux LSUKJKM001 4.15.0-1022-azure #22~16.04.1-Ubuntu SMP Thu Aug 16 10:31:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

OpenSSL 1.0.2g 1 Mar 2016

version 4.42.2

Octopus Deploy v2018.2.6

Thanks,

Siddharth

Public

Hi Derek,

Thanks for coming back so early.

I was seeing this mentioned in my previous link.

Could you please confirm the task would be-

Install .Net Core Runtime (2.1 or 1.x?).Please advise on the version (Linux LSUKJKM001 4.15.0-1022-azure #22~16.04.1-Ubuntu SMP Thu Aug 16 10:31:05
UTC 2018 x86_64 x86_64 x86_64 GNU/Linux)

Linux distribution dependencies

Am I correct or missing anything?

Thanks,

Siddharth

Hi Derek,

I’ve booked for Friday 4-5PM BST. My team will join on this. Please use this webex to join as we had discussed.

https://tcsglobal.webex.com/join/mruthyunjaya.rao

Step 1 - Call in number –

Toll free UK – 08000315359

UK London – 442034099805

India Toll free – 18002660247

Bangalore – 918060008412

Step 2 – Access Code – 575835934 #

Thanks,

Siddharth

Public

Hi Derek,

Sure.I’ve done that.

Thanks,

Siddharth

Thanks Siddharth,

I look forward to speaking with you and your team tomorrow.

Best regards