使用NAnt将工件从Jenkins部署到Archiva [英] Deploy Artifact From Jenkins to Archiva with NAnt

查看:395
本文介绍了使用NAnt将工件从Jenkins部署到Archiva的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我承认对于整个持续集成的想法是新的。因此,我一直在努力寻找一个方法来接受我的ASP.NET项目,通过Jenkins喂它通过使用NAnt和mono在Linux盒子上的自动构建,并最终部署到Apache Archiva的工件进行检索以后安装等。

I'm admittedly new to the whole continuous integration idea. As such, I've been scouring the web to find a way to take my ASP.NET project, feed it through Jenkins for auto-build using NAnt and mono on a Linux box, and ultimately deploy the artifact into Apache Archiva to be retrieved later for installation, etc.

我的问题是,我不知道如何将这个从Jenkins的工件交给Archiva。

My problem is, I don't know how to integrate this hand-off of the artifact from Jenkins to Archiva.

所以,这是我的理解:


  • Archiva可以用来存储任何类型的工件。 .zip 档案(这是我想使用的), .jar 档案等。

  • Jenkins可以使用NAnt来为我的.NET 4.0项目调用Mono。

  • Jenkins还可以将文件压缩成合适的工件

  • Archiva can be used to store any type of artifact. .zip files (which is what I want to use), .jar files, etc.
  • Jenkins can build the source code using NAnt to call Mono to my .NET 4.0 project
  • Jenkins can also zip the files up into a suitable artifact

这是我不明白的地方:


  • 我得到 .zip 文件(工件)从Jenkins存储它到Archium存储库?

  • How could I get the .zip file (artifact) from where it's stored when Jenkins builds it, to the Archiva repository?

这是我的工作:


  • Jenkins(1.502)服务器和Archiva 4)服务器在同一Ubuntu 12.04机器上

  • NAnt(0.92)构建脚本

  • Mono(2.10)

我不知道什么(但可能有帮助?):

What I don't know anything about (but might help?):


  • Maven

  • Ivy

推荐答案

一个单独的Jenkins任务,使用Maven进行部署。

Set up a separate Jenkins "task" that uses Maven to deploy.

注意:你不需要知道太多关于Maven的工作。你必须安装它。您必须按照下面的页面所述配置它,您需要使用该信息从命令行调用它。 (如果您想了解详情,可以使用备用建议。)

Note: You don't need to know too much about Maven to make this work. You'll have to install it. You'll have to configure it as described on the page below and you'll need to call it from a command line using that information. (If you want to learn more, you can use the alternate suggesion.)

使用此页面中的信息设置settings.xml:

Set up the settings.xml using information from this page:

http:// archiva .apache.org / docs / 1.4-M2 / userguide / deploy.html

同一页面显示如何从命令行运行Maven。要使用它,您将创建一个运行shell脚本并直接从构建任务创建它的地方部署的Jenkins任务。然后您手动运行部署,或者让Jenkins构建任务在完成时没有错误地运行部署任务。

That same page shows how to do it running Maven from a command line. To use this, you will create a Jenkins task that runs a shell script and deploys directly from where ever the build task creates it. Then you either run the deploy by hand or you make the Jenkins build task run the deploy task when it finishes without error.

您可能不熟悉的一件事是Archiva / Maven的每个文件的坐标系。

One thing you might not be familiar with is Archiva/Maven's system of coordinates for each file.

每个工件都有一个组,工件ID和版本。可以有一个分类器等,如果你想要的。

Each artifact has a group, artifact id and version. There can be a classifier and such if you want.


  • 群组通常是公司的网域名称加上内部分类指标 - com.microsoft.phone.web通过微软的电话分部。

  • 工件ID是特定工件的名称。

  • 版本是正常形式的版本字符串 - 1.0a或2.0-asl或3.2.1。

  • 分类符类似于我们使用文件扩展名 - zip,jar。

  • The group is typically, the company's domain name backwards plus internal taxonomy indicators -- com.microsoft.phone.web for a web app created by the phone division at microsoft.
  • The artifact id is the name of a particular artifact.
  • The version is a normal form of version string - 1.0a or 2.0-asl or 3.2.1.
  • The classifier is used similar to the way we use file extensions - zip, jar.

这是解释的简短版本。 Google在这里是您的朋友。

This is the short version of this explained. Google is your friend here.

您也可以使用Maven任务执行此操作。 Archium页面上关于pom.xml文件的信息将是需要的,但是你必须谷歌Maven部署,并阅读如何做到你的特定情况。当工件在本地Maven仓库(在构建机器上)并且该仓库具有您需要的特定文件和文件夹结构时,将部署默认情况。这是Maven在创建和安装它们时安排工件的方式。

You can also use a Maven task to do this. The information on the Archiva page regarding the pom.xml file will be needed but you will have to Google "Maven deploy" and read how to do it for your particular case. The default case deploys when the artifacts are in the local Maven repo (on the build machine) and that repo has a specific file and folder structure that you need. That's the way Maven arranges artifacts when it creates and 'install's them.

这篇关于使用NAnt将工件从Jenkins部署到Archiva的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆