大道之行,天下为公。这篇文章主要讲述[Jenkins] Creating Application builds相关的知识,希望能为你提供帮助。
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".
【[Jenkins] Creating Application builds】
文章图片
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.
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.
文章图片
推荐阅读
- 移动(appium)自动化测试-爬虫的另一种手段
- Android配置如果你的模拟器没有生成Hello World程序
- APP接口
- Android 网络编程的陷阱
- Android开始之 入门
- 40. leetcode 202. Happy Number
- Android Studio创建AIDL文件并实现进程间通讯
- Android基础TOP6_2:Gallery +Image完成画廊
- Android中 string.xml资源 如何添加参数()