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. JAVA 多线程和进程概念的引入

    1.并发和并行 并行:指两个或多个时间在同一时刻发生(同时发生): 并发:指两个或多个事件在一个时间段内发生. 在操作系统中,安装了多个程序,并发指的是在一段时间内宏观上有多个程序同时运行,这在单 C ...

  2. php訪问mysql数据库

    PHP訪问Mysql数据库 PHP能够通过mysql接口和mysqli接口訪问mysql数据库. 须要加入mysql和mysqli接口才干訪问mysql数据库. windows下配置amp: a.安装 ...

  3. ListView Item 点击展开隐藏问题

    public class ListAdapter extends BaseAdapter {     private Context mContext;     private View mLastV ...

  4. Android判断App是否在前台运行

    版权声明:本文为博主原创文章,未经博主允许不得转载. //当前应用是否处于前台 private boolean isForeground(Context context) { if (context ...

  5. AVCaptureSession音频视频采集

    // // AudioVideoCaptureViewController.m // live // // Created by lujunjie on 2016/10/31. // Copyrigh ...

  6. 方正飞越 A600硬改BIOS激活win7的工具与方法。

    硬件:方正飞越A600-4E57:主板,H61 IPISB-VR:BIOS版本,方正A007SB0(AMI) 软件:Win7专业版 目标:修改BIOS,添加SLIC2.1,硬激活win7 OEM版 具 ...

  7. python登录验证程序

    自己写的一个python登录验证程序: 基础需求: 让用户输入用户名密码 认证成功后显示欢迎信息 输错三次后退出程序 升级需求: 可以支持多个用户登录 (提示,通过列表存多个账户信息) 用户3次认证失 ...

  8. Mongodb总结5-通过装饰模式,用Mongodb解决Hbase的不稳定问题

    最近继续学习Mongodb的根本原因,是为了解决今天的问题.项目中用到了Hbase,生产环境服务器用了3台,但是不够稳定,每2天左右,就连不上了.重启就好了,当然,这是一个历史遗留问题.我在想,是不是 ...

  9. debian 9 安装后需做的几件事

    debian 9 安装后需做的几件事 安装环境:X86 >> Debian 9 Linux/GNU apt源更新 注意连上有线网络 刚安装好的debian系统中,/etc/apt/sour ...

  10. 展示C代码覆盖率的gcovr工具简单介绍及相关命令使用演示样例

    (本人正在參加2015博客之星评选,诚邀你来投票,谢谢:username=zhouzxi">http://vote.blog.csdn.net/blogstar2015/candida ...