Continuous build integration using Eclipse with Developer Cloud Service & Application Container Cloud Service
You can access Oracle Developer Cloud Service projects from Integrated Development Environments (IDEs) such as Oracle Enterprise Pack for Eclipse (OEPE), Oracle JDeveloper, and NetBeans IDE. The Eclipse IDE and the Oracle Enterprise Pack for Eclipse (OEPE) includes integration for Oracle Developer Cloud Service, which conveniently exposes the most common Cloud development tasks from within the IDE.
Oracle Developer Cloud Service integration with the Eclipse IDE includes the following:
- A dedicated Oracle Cloud view that displays Oracle Developer Cloud Service projects of which you are a member
- Integration with Mylyn and the Oracle Developer Cloud Service Issues system
- Source control system integration with the Oracle Developer Cloud Service Git repository
You can download the Eclipse IDE from http://www.eclipse.org/ and OEPE from http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html.
If you are using the Eclipse IDE, download and install the Oracle Cloud Tools plugin from the Eclipse IDE marketplace. In OEPE, the plugin is installed by default.
This tutorial demonstrates how to:
- Do continuous build integration using Eclipse with Developer Cloud Service & Application Container Cloud Service
- Create and Deploy a SpringBoot Microservice with Developer Cloud Service & Application Container Cloud Service
- You have configured a Build for the springboot-sample app based on SCM polling schedule
- (Optional) You have configured a Deploy configuration with Automatic deployment of springboot-sample app to Application Container Cloud Service
- You need Eclipse IDE with Oracle Cloud Tools plugin or Oracle Enterprise Plugin for Eclipse installed either:
- by importing distributed by Oracle Virtual Box image
- or by installing Eclipse IDE with Oracle Cloud Tools plugin or Oracle Enterprise Plugin for Eclipse into your local system
- (Optional) You are familiar how to use the Agile Methodology in Oracle Developer Cloud Service
During the steps below you can apply Agile methodology in Developer Cloud Service according to your activities on the springboot-sample project.
Open OEPE (using desktop icon ) and set (leave the default, home/oracle/workspace
) workspace location. Close the Welcome page. To open the Oracle Cloud view from the Window menu, click Show View and then Other.
From the list open Oracle Cloud and select Oracle Cloud.
If you are connecting to Oracle Developer Cloud Service for the first time, click the Connect link.
In the Oracle Cloud Service Connection dialog, enter the following:
- Identity Domain: Enter the identity domain of Oracle Developer Cloud Service.
- Username and Password: Enter the user name and password.
- Connection Name: Enter a name for the service instance, if necessary. By default, the connection name is set to the identity domain name.
Provide a master password to store securely your credentials, so in the future you don't need to enter every time when you open OEPE. Don't forget to note the master password.
After your credentials have been validated, you are logged in to Oracle Developer Cloud Service and the Oracle Cloud view displays all projects that are assigned to you.
NOTE: If Oracle Cloud plugin hangs on Fetching for a long time, and you are not within an Oracle VPN Network, then most likely you have set the Oracle Proxy ON. To resolve this you have to disable the Oracle Proxy: first close Eclipse, then on the OVM Linux Desktop click on the icon Oracle Proxy OFF. Launch Eclipse again and navigate to Oracle Cloud view.
Oracle Cloud view displays all projects that are assigned to you. Open the tree view myOracle Cloud(Cloud connection name) -> Developer -> springboot(DevCS project name) -> Code and there you can see the Git repository hosted on Oracle Developer Cloud Service.
To clone the Git repository to your machine double click or right click -> Activate on the Git repository and clone will start.
After the successful clone your local copy will be available in your workspace.
To import a Maven based project right click on the Project Exporer area and will pop up the menu where you can select Import projects -> Import...
Select Existing Maven Projects and click Next.
Browse the location of the cloned repository in /home/oracle/workspace/
folder and select acc/springboot-sample
subfolder. If the workspace location is the default it should look like similar to the following: /home/oracle/workspace/springboot.git-9534/springboot-sample
Please note, that you need to give one of the subfolder of the local repository.
Click Finish.
OEPE now starts to validate and build the project which can take few seconds. Finally you can see the imported project in the Project Explorer area.
The project hosted on Oracle Developer Cloud Service has build job which ensures that new application build and deployment to Application Container Cloud Service happens when any developer push code changes to Git repository.
Check the process modifying small piece on the application. First check the default page of the application. Open the tree view myOracleCloud -> Applications -> springboot-demo. Right click on springboot-demo and select Open In Browser menu item.
New browser is opened and you should see the application's home page.
Go back to OEPE and in the Project Explorer area find the springbootdemo project and open the Deployed Resources -> webapp -> WEB-INF -> views -> welcome.jsp
Modify the following part:
<br>SpringBoot application demo. Current server time: <%= new java.util.Date() %> <br>
To what you would like to see on the page. For example:
<br>SpringBoot application demo. <font color="red">MODIFIED IN OEPE.</font> Current server time: <%= new java.util.Date() %> <br>
Save the changes. To commit and push changes to Git right click on project and select Team -> Commit...
Git Staging view is displayed. First make sure the welcome.jsp
is in the Staged Changes area. Type a commit message e.g. 'Home page modified in OEPE'. Optionally enter your name or cloud username and give a (valid or fake) email address in the following format as the screenshot shows. Click Commit and Push...
In the Push dialog leave the default branch and click OK.
Now change back to the browser and check the Build page in the Oracle Developer Cloud Service project. You should see that a new build (in our case: springboot_build) has been fired by the Git changes.
Once the job is done change to the tab to Deploy and you can see that a new deployment has been started too. If you remember the Deployment was configured to redeploy every time when a new successful build artifact is ready.
Now check the changes of the home page of the application. There are many ways to open the application's home page:
- from Application Container Cloud Service: on your Cloud Servies Dashboard click on the Application Container Cloud Service and then click Open Service Console. On the Application Container Cloud Service console,click Applicaitons and either select directly the URL under the name of your springboot-sample applicaiton, or click on your springboot-sample applicaiton name and then inside the app page, click its URL.
- from Developer Cloud Service: navigate to Deploy page and under Deployments section, click the name of the deployed aplication (eg. springboot-sample).
- from Eclipse: open the tree view myOracleCloud -> Applications -> springboot-demo. Right click on springboot-demo and select Open In Browser menu item.
Choose your prefered way to open the application's home in the browser and review the changes you made.
(Additional info) The tutorial Developing Applications with Eclipse and Oracle Developer Cloud Service shows another example of using Eclipse with Developer Cloud Service.