Anda di halaman 1dari 45

Oracle Cloud Platform

Development
Partner Workshop

Practice Labs for


Development Generics
DevOps and CI/CD Support with the Oracle
DevCloud Service
Contents

Step 1: Create a project from template ........................................................................................................ 3

Step 2: Connect to ODCS from OEPE. Modify and push your project to the cloud. ................................... 11

Step 3: Create a new issue using ODCS Web Dashboard and resolve it within the OEPE IDE.................... 16

Step 4: Work with Branches in the GIT repository and with Code Reviews ............................................... 25

Step 5: Build the Contacts SOAP Service project ........................................................................................ 34

Step 6: Deploy the project to Oracle Java Cloud Service SaaS Extension (JCS-SX) ..................................... 36

Step 7: Learn about the support for Agile Development ............................................................................ 40

Step 8: Explore Wikis .................................................................................................................................. 43

Step 9: Explore Administration Functionality ............................................................................................. 44

Summary ..................................................................................................................................................... 45
Using Oracle Cloud to Power Your Application Development Lifecycle
In this lab youll create a project from template in Oracle Developer Cloud Service (ODCS) Web
Dashboard. This is a simple Java EE SOAP web service application that will be the basis for
exploring ODCS both within the web dashboard and through integration within Oracle Enterprise
Pack for Eclipse (OEPE).

In the first part of the lab, youll log in to your ODCS web instance and start with creating a
project from template. After creating the project youll explore the features of ODCS and then
proceed to create a couple tasks that you will activate and complete within OEPE. As part of this
lab youll build this project using Hudson Continuous Integration Tooling within ODCS and
automatically deploy the application to Oracle Java Cloud Service (OJCS). You will then
validate the web service url endpoint.

Why ODCS? In recent years the world of application development has adopted new
methodologies that aim to improve the quality and speed in which applications are being
delivered. The introduction of innovative development approaches such as test driven
development and agile development gave rise to a set of new techniques and tools that enable
those methodologies. Tools such as automatic build utilities combined with continuous
integration platforms, as well as enhanced collaborative tools such as wikis and code review
utilities aim to simplify the adoption of these new methodologies. However, for many IT shops
setting up these environments and maintaining them was difficult and cost prohibiting, resulting
in many organizations sticking to the old way of building applications. Now Oracle is aiming to
change this by introducing a new simpler way to adopt modern development methodology and
tools with a cloud based offering known as ODCS.

Step 1: Create a project from template


1. Begin by logging in to your ODCS web dashboard. [You should have received your
developer cloud service instance URL and credentials by now]

2. Provide the Identity Domain, User Name, Password that were given to you.

3. Once you have authenticated, you will see a Dashboard that displays all your active
platform services. Select the Developer (Developer) service link.
4. Select the Open Service Console button. This open the ODCS Projects view.

5. Select New Project button.

6. Give your project a Name such as Contacts Soap Service and Description similar to the
following: Contacts SOAP Service created from the Simple SOAP Service Template. You can
leave the Privacy setting to Private. Select the Next button.
7. Select the Simple SOAP Service Template followed by the Next button.

8. Go with the defaults for the rest and click Finish button
9. Project services are now being provisioned and can take up to a minute.

When the process is complete you will find green ticks on all the tools.

10. Refresh the browser page and you will notice all the tools required for supporting the
DevOps pipeline.

11. Explore the various Features of ODCS. The Home tab for instance provides details about
the newly created project including the location of the Git source code repositories as well
as the Maven repository. You will also notice new activities within the project as they occur.

12. Click on the Code tab. The Code tab shows the project root folder from the GIT
repository including the latest commit comments.
13. Next click on Snippets tab. Snippets are reusable sections of code that can be shared
between developers, for increasing productivity and reusability of code.

14. Click on the next tab i.e. Merge Requests. A merge request is the process to bring together
two branches of code into one and unify the code in the master repository (or other
branches depending on the coding approach)

15. The next is the Issues tab. We can add and examine Issues through the Issues tab. This can
be either bugs that have been identified in the development/test phase or they can be
tasks/features that will be available in the backlog that is used to build up the Sprints.
16. The Build tab is where you create new Hudson build jobs, further configure your jobs,
start builds, check the status of builds, view build history, etc Until you have a project that
your building, this tab will provide limited details.
17. The Deploy tab allows you to create new deployment configurations for your project. You
can start a deployment, undeploy an application, redeploy an application, edit and delete a
deployment configuration.

18. The Wiki tab allows you to create new Wiki pages for collaboration with members of your
development team. This is a good starting point to start collecting creating use cases and
other design documents for your application.
19. Create a new Wiki page, select the New Page button now and provide some descriptive
text for your project as seen in this image. Click Save.

20. Click on Agile tab. Agile team development is supported through the two main menu
options Issues and Agile. Issues as we have seen allow you to create your issues/bugs and
tasks/features that will be added to the backlog. From there the Scrum master will be able
to drag and drop them to the sprints and easily perform the sprint planning. At the
beginning of the lab you will not see any boards as none have been created as yet.

21. The last tab is Administration. Through the Administration tab we can perform repository
deletion, track usage metrics and integrate with other related platforms and tools using
Webhooks (e.g. to HipChat or Jira).

Step 2: Connect to ODCS from OEPE. Modify and push your


project to the cloud.

First open OEPE (Eclipse). Look for the OEPE icon on your desktop.
1. Within OEPE switch to the Java EE perspective by selecting the open perspective icon
on the top right of the IDE as shown below. [This is also accessible from Window >
Perspective > Open Perspective > Other > Java EE]
2. Select the OK button.

3. In the bottom left of your IDE you should now have a cloud view Oracle Cloud where
you can connect to your ODCS instance. Select the Connect link.

4. Enter the credentials supplied to you and select the Finish button.

5. Double click on the Developer instance to Activate the service and fetch your existing
cloud projects.
6. Double click on the Contacts SOAP Service or the project name that you created
earlier if different to Activate.

7. Expand the Code item in the tree. Your Git repo will be named developer-
oracletemplates_simple-soap-service.git.

8. Right click on Git Repository and select Activate. A Cloning GIT Repository dialog
box will appear momentarily. Now your Git repo is activated.
9. Expand the Git Repository and you will find Eclipse Projects node.

10. Right click on contacts project and select Import into Workspace
11. A project will appear with its contents in your Project Explorer tab. We are now is sync
on the project available in Developer Cloud Service and on your local client Eclipse.
Step 3: Create a new issue using ODCS Web Dashboard and
resolve it within the OEPE IDE

1. Select the Issues tab within the ODCS Web Dashboard. [If the screen does not update
immediately, please refresh the browser.]

2. Select the New Issue button to create a new Issue. Enter details similar to these
provided here. For Owner, assign the task to yourself. Enter the Due Date as two days
after todays date. Select the Create Issue button once complete.
3. Youve created your first issue and can edit this task and/or post comments as desired.

4. Now go to your Oracle Cloud view in the lower left of your IDE (OEPE) and double click
on Issues to activate them. Select Open issues in the tree and expand it to see the
issue you just created in the ODCS Web Dashboard browser.
5. There are various ways to work with issues so now within your IDE as opposed to
working within the Oracle Cloud view in the bottom left corner of OEPE, lets take a
look at the Task List in the upper right corner of OEPE beneath Resources.
6. Open the ContactsService.java object within the Project Explorer in OEPE and add
the web methods create, update, and delete. Copy the following code and paste it into
you the ContactsService.java object and be sure to save your work. Note: In a real
development scenario you may want to create a branch that you could add your code to
and once validated, merge that code back into master.
@WebMethod
public void createContact() {
return;
}

@WebMethod
public void updateContact() {
return;
}

@WebMethod
public void deleteContact() {
return;
}
7. Your code should now look like the following:

8. Now that you have added the methods as requested within the task that you create, you
can commit your changes to the local Git repo and then push your changes to the
remote repo. This can be done in one step within OEPE. Right select on the
ContactsService.java object within the Project Explorer and select Team |
Commit.
9. You will see a dialogue that asks you to Please identify yourself. Provide appropriate
information for Name and User e-mail and select the ok button. You can update the
Commit message or go with the default as preferred. Select the Commit and Push
button to commit and push your changes to the remote repo.
10. You will receive a dialogue with the results of the commit / push operation. Select the
ok button to exit the notification.

11. Now that youve committed and pushed your changes to the Git repository, you need to
update the task. Right click on the task in the Task List within OEPE and select Open.
This opens the task within OEPE so that you can update it as resolved. Add a new
comment such as Method for create, update, and delete have been added in the
ContactsService.java object. This task is now complete. Select the radio button
Resolve as and select FIXED from the list-of-values. Select the Submit button to
update this task.

12. Go back to you ODCS Web Dashboard browser. Select the Home tab to see the new
activity stream.

13. Select the Code Tab followed by the Commits button.


14. Click on Show Details link available for the latest commit. Select the
ContactsService.java object to see a diff of the changes youve made.
Step 4: Work with Branches in the GIT repository and with Code
Reviews

1. Within OEPE create a new code branch by expanding the Git repository (developer-
oracletemplates_simple-soap-service.git) tree within the Oracle Cloud view and Right
clicking on Branches and selecting Switch to | New Branch.

2. Provide a name for your branch such as crudbranch. Select Configure upstream for
push and pull. Go with defaults for the rest of the options and select the Finish button.

3. Expand the node called Local. You will see the newly created local branch.

4. Push this newly created branch to the remote repository by Right clicking on the Local
crudbranch and selecting Push. For Branch name provide crudbranch. Go with the
defaults for the rest of the options.
5. Go with the defaults for Push Confirmation and select the Next and Finish button.

6. Review the results of the Push operation and select the OK button to exit.

7. You can see that you create the remote branch by looking at the Oracle Cloud window
within OEPE. Expand the Remote Tracking node for seeing this.
8. To see how the Branch feature works in a simple way, let us insert a comment into our
ContactsService.java file. Notice that you are inserting this change in the local
crudbranch. Save this file.

Let us commit this change. Right click on the contacts project and select Team >
Commit as below:
The Commit Change dialog box will open

Insert a comment and click Commit and Push. This will commit to the local repository
and push the changes to the remote repository. Note that this will on the crudbranch at
both ends. You will see a push confirmation dialog that you can dismiss with the Ok
button.
9. Now that youve created a branch and committed and pushed a change up, lets see this
in ODCS. Switch back to your browser and navigate to Code. Drop down the branch
dropdown as shown. Notice the two branches master and crudbranch.

You will see the commits to this branch (instead of the master that you were seeing
previously)

We can see the details of the branch using the Branch button as well. Click on this
button as shown below.
10. We will now request a Code Review from the Merge Requests menu item. To do this
select Merge Requests menu and click the New Request button

11. Enter the following details or similar information in the Code Review form.
12. Team members that youve added to this code review would now receive messaging
(email) that theyve been asked to collaborate in a code review on the project. In this lab
you are the only team member.

13. You can Approve or Reject the code review. Select the Assigned to Me item from the
left menu. You will see the code reviews assigned to you.

14. Select the code review and a screen with the details appears.
Here on the different tabs you can see the commits

and the changed files.


15. Back on the Conversations tab, you can Approve, Reject or Close the code review. Or
you can decide to merge the new branch. Explore the options but do not Approve,
Reject or Close. We will now merge the crudbranch with the Master.

16. To merge the branches, click on the Merge button from the menu shown above and
provide commit message to support the decision. Click Merge button to complete this
task.

17. The merge will be completed. Following this switch to the Code menu and dropdown
the branches and select Master. Notice that our crudbranch commit message now
shows on the Master code indicating that the merge is done.
Step 5: Build the Contacts SOAP Service project

1. To build the Contacts SOAP Service project go to the Build tab on the ODCS Web
Dashboard browser.

In the project creation from template at the beginning of this lab the Hudson build job
called contacts-build was created for you. It was actually copied from the Simple SOAP
Service template. You can even see that the Contacts SOAP Service project has
successfully built by the green icon in the first row of the table. This is because the
Hudson Build job has been configure to run automatically upon commits.
2. You can build this project again by simply selecting the icon to Schedule a build which
is the last column of the first row of this table.

3. The project is queued up in the Build Queue and once a Build Executor is available,
the project begins the build process.
5. Select the build job contacts-build link (in the first row of the table above) to view the
history of the builds for your project and to see the results of your most recent build.

6. From the above screen you can also further configure the Hudson build job using the
Configure button, see the Console for details of the build (particularly if it has failed),
etc Explore some these features.

Step 6: Deploy the project to Oracle Java Cloud Service SaaS


Extension (JCS-SX)

1. In order to deploy the Contacts SOAP Service project that you just built, select the
Deploy tab in the ODCS Web Dashboard browser. Initially you will have no
Deployment configurations
2. Click on the New Configuration button to create a new deployment configuration and
provide the following configuration details.

Configuration Name: contacts


Application Name: contacts
Java Service: (Select the only one item in the dropdown which refers to the JCS
instance provisioned to you)
Type: On Demand (you can select Automatic as well in which case the deploy of the
latest build will take place automatically)
Job: contacts-build
Build: Select your most recent successful build (this option will not be there if you had
selected Automatic type above)
Artifact: contacts/target/contacts.war
Once youve completed the New Deployment Configuration select the Save and
Deploy button.
3. Once you select the Save and Deploy button your project will be saved and deployed
to OJCS and you can view the status of your configuration creation and deployment.

4. Select the Deploy to JCS-SaaS link as below.

5. A new tab will open with your Java Cloud Service SaaS Extensions automatically SSO
into. Notice your contact application here. Click on the application to see its details.
6. Select the Application URL link to launch a test jsp page that is part of the Contacts
SOAP Service project.

7. You now see the test jsp page for your project that has been successfully built and
deployed from ODCS to OJCS appear in another tab.
Step 7: Learn about the support for Agile Development

1. ODCS supports Agile Development out of box. In order to learn about this let us go
through a typical set of steps take to
a. create an issue
b. pick it up from the back log
c. create a sprint for achieving this

2. In ODCS, click on the Issues menu item and select New Issue

3. Enter sample data similar to the screen below. Click on the Create Issue button.
Note that after the issue is created, a message in green will appear temporarily and the
screen will remain at the same page. Click on the Issues menu item again and you will
see that the new issue has been created.

4. Now that this issue has been lodged, let us see how we can use an Agile method to
process it. Switch to the Agile menu item on top of the ODCS dashboard. You will first
create a New Board where the issues backlog and the Sprints will be worked on.
5. A dialog box for the new Board will appear. Fill in the name similar to the data below and
click Create.

6. A new board appears with the Current Backlog from the list of Issues.

7. Click on the + New Sprint button. In the dialog box that appears, enter a name for the
sprint and click the OK button.
8. A page appears with the new Sprint open. You can now drag and drop issues from the
Backlog to this Sprint. Drag and drop your new issue titled here as Extraneous
comments .. from the Backlog to the June Core Code Issues Sprint.

9. In the real world you would start the Sprint when it is ready to go (but for this lab you
need not start the Sprint).

Step 8: Explore Wikis

ODCS also has built in support for Wikis. Let us explore this feature.

1) Click on the Wiki menu item on the top of the Developer Cloud dashboard. You will be
shown the Wiki Home where you can create Wiki Pages for your project. By default a
few pages have been created for you as part of the Simple SOAP Service Project
2) Click on the + New Page button. This will take you to an editor where you can give a
title and enter the page content similar to the one below.

3) Once the content is entered, click the Save button and final page is displayed. You can
create a child page as well if required.

4) For the lab try creating one called Customer Originated. You final structure should look
similar to the screenshot below.

Step 9: Explore Administration Functionality

The Administration tab allows you to customize the application, monitor and control the
usage, integrate with other DevOps tools through Webhooks and even delete the
project. You can explore these aspects (except delete!) by clicking on the
Administration tab.

Summary

In this tutorial you created an ODCS project from template. You:


Worked with ODCS and the various features provided within the dashboard
Imported a Maven project into your IDE (OEPE)
Connected to your ODCS instance from within your IDE
Committed/pushed your contacts project to Git within ODCS
Created tasks within ODCS and resolved those tasks within your IDE
Created Code Review
Built your project with Hudson Continuous Integration in ODCS
Deployed your contacts application to OJCS
Saw how the Agile method is supported and how you can work with Wikis
Explored the Administration functionality available with ODCS

Anda mungkin juga menyukai