简体   繁体   English

詹金斯八达通整合

[英]Jenkins Octopus Integration

I am using Jenkins as a CI tool and using Octopus to deploy my JAVA application. 我使用Jenkins作为CI工具并使用Octopus来部署我的JAVA应用程序。 But when surfed, i could get solutions to deploy a .Net application using Octopack. 但在浏览时,我可以获得使用Octopack部署.Net应用程序的解决方案。 But how to pack my JAVA Application and automatically deploy it into the Octopus server from my Jenkins instance? 但是如何打包我的JAVA应用程序并从我的Jenkins实例自动将其部署到Octopus服务器中?

You can pack it with NuGet (with the nuget pack command, documented here ). 您可以使用NuGet打包它(使用nuget pack命令, 在此处记录 )。 That's essentially all that Octopack does. 这基本上就是Octopack所做的一切。 Create a .nuspec file, and in your <files> section, include the files you want with an empty target. 创建.nuspec文件,并在<files>部分中,使用空目标包含所需的文件。 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 . 然后,您可以使用nuget push将其推送到Octopus Deploy系统。 Instructions are on your Octopus Deploy Package Library page. 说明在您的Octopus Deploy Package Library页面上。

Since Octopus 3.3 you can also package in tar and zip , in addition to NuGet. 从Octopus 3.3开始,除了NuGet之外,您还可以打包tar和zip

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 . 配置部署目标后,在Jenkins服务器上设置Octo.exe并使用Jenkins作业中的脚本控制台,使用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. 您还可以将代码写入Jenkins服务器上的脚本,并直接从Jenkins作业中的控制台调用它。 We do this in our setup because Octo.exe uses the API-KEY which we'd rather keep secret from the developers. 我们在设置中执行此操作,因为Octo.exe使用API​​-KEY,我们宁愿保密。

Note: Octopus Deploy is also currently working on native Java support. 注意:Octopus Deploy目前也在开发本机Java支持。 See this RFC . 请参阅此RFC

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM