After installing the jenkins, we start creating new job.

1. Give job names (your project name):

2. Go to "Source Code Management tab":

Connect to source code:

3. Go to the "Build" tab, using the drop down menu, to select a step.

Normally like a web app, you can select "Excute Shell" / "Excute Windows batch command".

Here, because we use Java application as an example, so we select "Invoke top-level Maven targets".

4. Give the command should be excuted.

In the example we just need to use 'mvn compile' to compile a Java app.

5. In some case, the root dir is not the app's root dir, you can click "advanced" button to add more information. (see the pic above)

6. After those step, you are able to Build the application by clicking "Build now".

So now jenkins will do the following steps:

  • Go to our github, clone the source code and put the code inside "~/.jenkins/Workspace/atomsphere" folder.
  • Output file (if any) will be also put inside this folder.

Usually the output files will be some file we want to use, for example a web app, the output might be the bundle files that we want to served.

Now everytime you click "Build Now" button, it will re-generate new files and discard the previous files. But we might want to keep history instead of throw those away.

7. Archive previous version files

We can actaully choose which files (folder) actually we want to keep. For web app, it might be just one "dist" folder.

Here we want to keep jar file which generated by comiler.

8. Now after we build again, we will get a copy:

9. You might also want to clean the files after some time, you can also chain the command together. such as:

mvn clean
mvn package

10. Those jenkins job are actually saved into a config.xml file inside "workspace/[job_name]" folder.

If anything change on this file manully, you can also click "Reload Configuration from Disk" to get latest changes.

[Jenkins] Creating Application builds的更多相关文章

  1. Jenkins(二)

    官网:https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins 我的这篇文章不过简单的依据上文,介绍Jenkins提供了哪些功能.详细大家还是要 ...

  2. Jenkins(两)

    官网:https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins 我的这篇文章不过简单的依据上文,介绍Jenkins提供了哪些功能.详细大家还是要 ...

  3. Jenkins Docker 插件

    原文地址:https://wiki.jenkins.io/display/JENKINS/Docker+Plugin Created by magnayn -, last modified by Ni ...

  4. jenkins构建结果企业微信提醒

    每当jenkin在构建之后我们想把构建结果SUCCESS/FAILURE或者其他信息通知给其他人,也许有人会说,不是有邮件提醒吗?但是我这里的环境邮件提醒的话所被通知者并不会第一时间去阅读,所以我们用 ...

  5. DEVOPS技术实践_15:使用Docker作为Jenkins的slave

    前面实验了使用docker搭建一个jenkins,下面实验使用docker作为jenkins的slave节点 1. 环境准备 一个运行Docker的主机或者群集 Jenkins应该能访问互联网,方便安 ...

  6. Jenkins构建时报错:No Space left on device

    Jenkins在自动化构建服务的同时也在消耗服务器的磁盘空间,如果构建的项目个数很多,而Jenkins 服务器磁盘空间又不是非常大的话,每隔一段时间磁盘空间就会爆满导致,就会出现磁盘空间不足无法构建的 ...

  7. jenkins 插件Copy Artifacts + Artifacts to copy

    问题及遇到的错误: Unable to access upstream artifacts area /var/lib/jenkins/jobs/PROJECTNAME-Master-Branch/b ...

  8. Jenkins遇到问题二:Jenkins服务器磁盘空间管理策略

    Jenkins在帮助我们自动化构建服务的同时也在消耗服务器的磁盘空间,试想如果构建的项目个数很多,而Jenkins 服务器磁盘空间又不是非常大的话,每隔一段时间磁盘空间就会爆满导致Jenkins出现磁 ...

  9. Jenkins的配置

    原文:http://www.cnblogs.com/itech/archive/2011/11/04/2236230.html 1  修改jenkins的根目录,默认地在C:\Documents an ...

随机推荐

  1. 使用Multiplayer Networking做一个简单的多人游戏例子-1/2(换一种方法)

    SynMove.cs using UnityEngine; using System.Collections; using UnityEngine.Networking; public class S ...

  2. ios 获取手机信息(UIDevice、NSBundle、NSLocale)

    iOS的SDK中提供了UIDevice.NSBundle,NSLocale. UIDevice        UIDevice提供了多种属性.类函数及状态通知,帮助我们全方位了解设备状况. 从检測电池 ...

  3. php线性表数组实现的删除操作

    php线性表数组实现的删除操作 一.总结 1.array_pop(): 函数删除数组中的最后一个元素. 二.代码 代码一: //线性表的删除(数组实现) function delete_array_e ...

  4. COOKIE传值

    1.遍历所有cookie foreach (string  _key in Request.Cookies.AllKeys)//遍历主键            {                Htt ...

  5. Python3的取余操作

    https://blog.csdn.net/u014647208/article/details/53368244 取余代码: 输入以下代码: >>>10%2 >>> ...

  6. 【例题 6-21 UVA - 506】System Dependencies

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 记录每个物品它的依赖有哪些,以及它被哪些东西依赖就可以了. 显式安装的东西不能被隐式删除删掉(就是remove item,然后删除i ...

  7. Eclipse导出Library

         在工作中遇到开发SDK,记录下导出Library的过程. 1.导出   选中项目>属性>Android  配置Is library例如以下图: 选中项目>导出>JAR ...

  8. 【几何/数学】概念的理解 —— (非)刚体变换((non-)rigid transformation)

    1. 刚体变换与非刚体变换 What is a non-rigid transformation? 刚体变换(rigid transformation)一般分为如下几种: 平移对象,而不改变形状和大小 ...

  9. 边缘独立(marginal independent)的理解及举例

    1. 定义 ∀xi∈dom(X),yj∈dom(Y),yk∈dom(Y),如果满足, P(X=xi|Y=yj)==P(X=xi|Y=yk)P(X=Xi) 则称随机变量 X 边缘独立于随机变量 Y. 理 ...

  10. 从大整数乘法的实现到 Karatsuba 快速算法

    Karatsuba 快速乘积算法是具有独特合并过程(combine/merge)的分治算法(Karatsuba 是俄罗斯人).此算法主要是对两个整数进行相乘,并不适用于低位数(如 int 的 32 位 ...