首页 文章

Jenkins:从artifactory部署war文件

提问于
浏览
10

我们正在使用 Jenkins 构建( maven )并将工件(JAR和* WAR *)部署到内部工件服务器(快照和发布) .

对于部署,目前,我们获得了Jenkins作业,这些作业打包war文件(来自发行版scm标记)并部署到不同的环境/服务器 . 我们希望跳过包阶段,因为似乎没有必要再次打包它以及发布版本,因为即使在尝试1000次之后也无法获得war文件的不同副本 .

我们正在寻找Jenkins的方法从Artifactory获取工件(war)并将其部署到容器中 . 我相信其他人也会遇到这种情况,但我无法找到任何有关此问题的在线资料 .

Is there any Jenkins plugin that takes a war file from Artifactory (based on a version) and deploy it to a remote container?

If this is not the right way of doing it then what are the recommendations for any other approach?

谢谢

2 回答

  • 2

    存储在Artifactory中的每个工件都将具有包含版本号的唯一URL . 它将采用这种格式

    http://artifactory-server/repository-name/path-to-artifact/version/filename
    

    例如

    http://artifactory/apps-releases-local/com/yourorg/yourapp/1.5.67/webapp.war
    

    (取决于您的打包方式,WAR文件名也可能包含版本号) .

    因此,您的部署作业可以构建Artifactory URL并下载该文件 . 根据您在Artifactory中设置安全性的方式,您可能需要对请求进行身份验证 .

  • 1

    我不知道一个带有版本#并部署它的插件,但你可以构建一个Jenkins作业,将最后一个成功的版本部署到以前的环境(例如从DEV - > QA复制 . )

    为此,您将使用copy-artifact-plugin .

    这是一种易于遵循的这种设置:

    http://www.lordofthejars.com/2012/09/deploying-jee-artifacts-with-jenkins.html

相关问题