Oracle by Example brandingCreating a Build Job in Oracle Developer Cloud Service

section 0Before You Begin

This 15-minute tutorial shows you how to create and configure a build job to run Apache Maven goals in an Oracle Developer Cloud Service project.

Background

A Job is a configuration that defines the software builds of your software application in the Oracle Developer Cloud project. In this tutorial, you create a job that runs Maven goals and archives the build artifacts.

What Do You Need?

  • A web browser
  • An Oracle Cloud account with an active Oracle Developer Cloud subscription
  • Your Oracle Cloud account credentials
  • Basic understanding of Maven, POM file, and Maven goals
  • An Oracle Developer Cloud Service project with a Maven application in the project Git repository
    See the Create and Populate a Git Repository of Developer Cloud OBE to push an Employee sample application to the project Git repository. Review the contents of the sample application's pom.xml file in the Code page before you begin this tutorial.
  • A Build VM configured to use a Basic Build VM Template template with minimum required software
    Ask the Oracle Developer Cloud Organization Administrator to create a Build VM template named as Basic Build VM Template with minimum required software, and then add a Build VM to use it. See Creating Build VM Templates in Oracle Developer Cloud Service and Adding Build VMs in Oracle Developer Cloud Service OBEs to learn how to create a Build VM Template and add a Build VM.

section 1Create and Configure a Job

You can create and configure a job from the Build page.

  1. In the navigation bar of your project, click Build.
    Oracle Developer Cloud Service project navigation bar
    Description of the illustration devcs_navbar_build.png
  2. On the Build page, in the Jobs tab, click + New Job.
    Jobs tab
    Description of the illustration devcs_jobs_tab.png
  3. In the New Job dialog box, enter the following details, and click Create Job.
    • Name: employee-app-build
    • Description: Simple build job to compile the employee webapp, package the jar dependencies, and zip up the manifest.json descriptor.
    • Software Template: Basic Build VM Template
    New Job dialog box
    Description of the illustration devcs_newjob_dialog.png
  4. In the Source Control tab of the Job Configuration page, click Add Source Control and select the Git option.
    Source Control tab of the Configure build job page
    Description of the illustration devcs_jobconfig_sourcecontrol.png
  5. In the in the Repository list of the Git section, select the employee-app.git Git repository.
    Source Control tab of the Configure build job page
    Description of the illustration devcs_jobconfig_sourcecontrol_repo.png
  6. Click the Builders tab, click Add Builder, and then select Maven Builder.
    The Builders tab of the Configure build job page
    Description of the illustration devcs_jobconfig_builder.png
  7. In the Goals field, enter clean install package Maven goals. In the POM File field, enter employees-app/pom.xml as the path of the POM file.
    Builders tab of the Configure build job page
    Description of the illustration devcs_jobconfig_mavenbuilder.png

    Tip: You can copy the path of the POM file from the Code page. Browse and open the pom.xml file and click Copy copyicon to copy its path.

    The Code page showing path of the POM file
    Description of the illustration devcs_code_filepathcopy.png
  8. Click the Post Build tab, click Add Post Build Action, and select the Artifact Archiver option.
    Post Build tab of the Configure build job page
    Description of the illustration devcs_jobconfig_postbuild.png
  9. In the Artifacts from files field, enter employees-app/target/*, and then click Save.
    Post Build tab of the Configure build job page
    Description of the illustration devcs_jobconfig_postbuild_artifactarchiver.png

    After saving the job, you return to the job details page.

    Job Details page
    Description of the illustration devcs_job_jobdetails.png

next stepNext Tutorial

After creating and configuring a job, you can run its build and generate artifacts. See the Running a Build of a Job in Oracle Developer Cloud Service in the Want to Learn More section.


more informationWant to Learn More?