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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With