[Jenkins] Creating Application Builds

Source: Internet
Author: User

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 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 a 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 was not the app's root dir, you can click on "Advanced" button to add more information. (see the pic above)

6. After those step, your is able to build the application by clicking "Build Now".

So now Jenkins would 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) would be also put inside the This folder.

Usually the output files would be some file we want to use, for example a Web app, the output might is the bundle files tha T we want to served.

Now everytime you click on "Build Now" button, it'll re-generate new files and discard the previous files. But we might want to keep the history instead of the 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 is just one "dist" folder.

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

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

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

MVN CLEANMVN Package

Those Jenkins job is actually saved into a config. file inside "Workspace/[job_name]" folder.

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

[Jenkins] Creating Application Builds

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.