Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Octopus Integration

I am using Jenkins as a CI tool and using Octopus to deploy my JAVA application. But when surfed, i could get solutions to deploy a .Net application using Octopack. But how to pack my JAVA Application and automatically deploy it into the Octopus server from my Jenkins instance?

like image 383
Alla Sasikanth Avatar asked Oct 29 '22 21:10

Alla Sasikanth


2 Answers

You can pack it with NuGet (with the nuget pack command, documented here). That's essentially all that Octopack does. Create a .nuspec file, and in your <files> section, include the files you want with an empty target. For example, this will include all files in your package:

...
<files>
    <file src="path/to/output/**" target="" />
</files>
...

You can then push it to your Octopus Deploy system using nuget push. Instructions are on your Octopus Deploy Package Library page.

like image 171
JamesQMurphy Avatar answered Nov 17 '22 08:11

JamesQMurphy


Since Octopus 3.3 you can also package in tar and zip, in addition to NuGet.

You can configure the machine where you want your code to be deployed to as a deployment target. Listening Tentacles are the most oft-used ones.

Once your deployment target is configured, setup Octo.exe on your Jenkins server and use the script console in your Jenkins job to automatically deploy your package to the intended target using Octo.exe .

You can also write the code to a script on the Jenkins server and call that directly from the console in the Jenkins job. We do this in our setup because Octo.exe uses the API-KEY which we'd rather keep secret from the developers.

Note: Octopus Deploy is also currently working on native Java support. See this RFC.

like image 28
mkumar118 Avatar answered Nov 17 '22 10:11

mkumar118