Part 2: Making Changes to an Application

In the previous section of this tutorial, you created an OEPE project, imported a starter application, and pushed the project to Oracle Developer Cloud Service. You also used OEPE to create an application branch in the Git repository.

Now that you have an application branch to work in, you will create some Oracle Developer Cloud Service tasks to track progress, create a review for code review and approval, and deploy and test your application.

Step 1: Creating Tasks

One of the features of Oracle Developer Cloud Service is the ability to initiate, assign, and track tasks related to your project. In this section, you will create a task in Oracle Developer Cloud Service web ui and then resolve it in OEPE.

  1. Navigate back to your browser connected to your Oracle Developer Cloud Service project.

    alt text
  2. Click the Tasks tab.

    alt text
  3. Click New Task to create a task. Enter details similar to the ones below. For the Owner property, assign the task to yourself. Click Create Task once you have completed the form.

    alt text

    You can edit this task or post additional comments any time.

  4. Now go back to the Oracle Cloud view in the lower left of OEPE and double-click Tasks to activate them. Expand Open tasks in the tree to see the task you just created in the Oracle Developer Cloud Service web ui.

    alt text
  5. Double-click the the Create web methods task to open it in OEPE.

    alt text

    Now that you have a coding task created and assigned to you, let's make the required code changes.

Step 2: Changing Code and Pushing to Oracle Developer Cloud Service

In this section, you make the code changes that have been assigned to you. After you have completed the code, you will update the task. As part of the normal process, you will need to add a code review in Oracle Developer Cloud Service, so that others on your team can see what has changed and make any comments they see necessary. In the environment you are using for this tutorial, you may be the only one on the team, so you will need to add a comment and approve the code.

In these first few steps, you add code to ContactsService.java.

  1. In the Project Editor, expand contacts > Java Resources > src/main/java > Services and double-click ContactsService.java. This will open the file in the code editor.

    alt text
  2. In the code editor, add the following code, just after the getContact() WebMethod.

  3. @WebMethod
    public void createContact() {
        return;
    }
    @WebMethod
    public void updateContact() {
        return;
    }
    @WebMethod
    public void deleteContact() {
        return;
    }

    The code should look something like the following:

    alt text
  4. Save your work.

    Now that you have added the methods that were requested within the task, you can commit your changes to the local Git repository and then push your changes to the remote repository. This can be done in one step within OEPE.

  5. In the Project Explorer, right-click contacts and select Synchronize with Oracle Cloud.

    alt text
  6. Add a Git commit message in the Synchronize dialog and click Finish.

    alt text
  7. So now let's go up to Oracle Developer Cloud Service Web Dashboard and see that the changes are there.

  8. In the browser connected to your Oracle Developer Cloud Service instance, click the Home tab. Notice in the Latest Activity, you can see the latest commit, the code changes that include the CRUD operations.

    alt text
  9. You can update tasks from either the OEPE interface or from the web ui. Click Tasks to see the active tasks.

    alt text
  10. Click the task to edit it and add a new comment such as “Methods for create, update, and delete have been added in the ContactsService.java object. This task is now complete." Click Post Comment to save the comment. Set the Status property to Resolved and Fixed and click Save.

    alt text
  11. Next, let's look at the code changes you made. Click the Browse tab and then click View Commits.

    alt text
  12. On the Commits page, use the Branches drop-down to select AddCRUDOps.

    alt text
  13. Click Files to see the changed files.

    alt text
  14. Click the file that was changed (ContactsService.java) to see the changes.

    alt text
  15. The left panel shows the file before this commit, and the right side shows the changes after the commit.

    alt text
Step 3: Adding a Review

Now that you have added code and pushed it to Oracle Developer Cloud Service, the next step will be to create a review. A review allows other team members to see, evaluate, and comment on the code. They can also approve or reject the code. Once the code is approved, you can mark the code segment as complete.

  1. Click the Reviews tab and click New Review.

    alt text
  2. In the Create Review dialog, enter details similar to those below. In your environment you will probably need to add yourself as the reviewer.

    alt text

    Team members that you added to this code review would receive email messages stating that they've been asked to collaborate in a code review on the project. They can approve or reject the code review and provide descriptive text to support their decision.

  3. Click Approve to approve the code. Provide an appropriate description of the approval, and then click OK.

    alt text
  4. After the other team members have approved and commented on the review, you can mark the review as complete. Click Complete to finish this review cycle.

    alt text
  5. Click Yes to mark the review as complete.

    alt text

    The Review page shows the description, the reviewers' comments and the review status.

    alt text
  6. Click Dashboard to see all the recent events that include the code review.

    alt text

    Now that you have added code and the code has been approved, you can build and deploy the application

Step 4: Building and Deploying the Application

In this section, you will take the completed code, run a build, and then deploy the application.

  1. Click the Build tab. Notice the status of the build. Notice the status of the contacts-build which was created when you uploaded the project from OEPE.

    alt text
  2. We want to examine the configuration of the build job, so click contacts-build.

    alt text
  3. On the Job contacts-build page, click Configure to see the job configuration.

    alt text
  4. On the Job Configuration page, scroll down to verify that the build branch is set to AddCRUDOps. This is the branch you created to hold the web method changes. When you created the AddCRUDOps branch in OEPE and synchronized with the Cloud, the synchronize wizard updated the build job to point to the new branch.

    alt text
  5. Now that you have verified that the build branch is set correctly, click Build Now to launch the build.

    alt text

    When you click Build Now, your job will be in line for the next available executor. The status of the build job will change. Here are a few of the statuses you may see:

    alt text alt text

    When the build job is complete, you will see the following:

    alt text
  6. After the build is successful, click the Deploy tab.

    alt text

    Since you created this project without using a template, there are no built-in deployment configurations.

  7. Click New Configuration.

    alt text
  8. Complete the New Deployment Configuration dialog as shown below paying particular attention to the following:

    • Use a prefix for the Application Name that is unique to you. There may be others that are deploying to the same JCS instance.

    • Set the Type to On Demand

    • Choose the Job that you just ran

    • Choose the latest successful build

    • Choose the .war file that was created from your build

    alt text
  9. Click Save and Deploy.

    alt text
  10. When the deployment is complete, you will see the following:

    alt text
  11. Click the application name to test the deployed application..

    alt text
  12. Oracle Developer Cloud Service will open a browser window pointing to the deployed application. It will look like the following.

    alt text

    In this section, you ran a build job, created a deployment configuration, and deployed the application.

In this tutorial, you created an Oracle Developer Cloud Service project and populated it from an OEPE project. You learned how to:

For more information about using Oracle Developer Cloud Service, refer to the product page:

http://cloud.oracle.com/developer


Bookmark Print Expand all | Hide all
Back to top
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.