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. 解决使用SecureCRT不能连接Ubuntu的问题

    一.现象 SecureCRT是远程登陆工具及串口,可以远程进行登陆Linux服务器或者串口打印数据.但我下载安装了之后想通过SecureCRT来远程登陆我的Ubuntu,出现一直连接不上. 二.问题原 ...

  2. CISP/CISA 每日一题

    CISA 业务流程控制鉴证中要考虑的特定因素: 1.流程图 2.流程控制 3.在流程中评估业务风险 4.对最佳实践进行标杆管理 5.角色与责任 6.活动与任务 7.数据限制   信息系统审计师的任务是 ...

  3. Bag of Features (BOF)图像检索算法

    1.首先.我们用surf算法生成图像库中每幅图的特征点及描写叙述符. 2.再用k-means算法对图像库中的特征点进行训练,生成类心. 3.生成每幅图像的BOF.详细方法为:推断图像的每一个特征点与哪 ...

  4. HDU 1848(sg博弈) Fibonacci again and again

    Fibonacci again and again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Jav ...

  5. node.js服务器核心http和文件读写

    使用htpp给客服端的数据,把数据交给浏览器渲染.利用 http创建服务器,如客户端请求为:127.0.0.1:3000或127.0.0.1:3000/xxx.html时 ,判断www文件夹中,文件  ...

  6. upf用到的工具

    emulator          : PXP zebu simulator :

  7. jemter--录制的脚本设置循环次数不起作用

    以下是比较jmeter线程组中设置循环次数和循环控制器中设置循环次数的区别 1.jmeter生成的脚本没有step1(循环控制器)控制器,故循环在线程组中设置   2.badboy录制的脚本有setp ...

  8. 【Codeforces Round #433 (Div. 2) B】Maxim Buys an Apartment

    [链接]h在这里写链接 [题意] 你有n个位置,然后其中有k个地方是已经被人占据了的. 一个"好的位置"的定义是指,这个位置相邻的地方其中至少有一个被人占据了. k个被人占据的位置 ...

  9. springmvc+shiro+freemarker实现的安全及权限管理

    本文讲述了基于springmvc+shiro实现安全管理,shiro+freemarker实现权限验证. 首先我们从web.xml开始: <?xml version="1.0" ...

  10. C语言深度剖析-----指针数组和数组指针的分析

    指针数组和数组指针的分析 数组类型 定义数组类型 数组指针 这个不可能为数组指针,指向数组首元素 例 指针数组 例    main函数的参数 例 小结