Hello everyone,
This is the first post in a blog series aimed at exploring Oracle’s various cloud capabilities available for developers. If you wish to join me along this journey, simply head to OTN and register an account (avoid popular domains e.g. gmail). Then, request a PaaS and IaaS trial.
Our objective is to create a RESTful service that exposes data from a MySQL database. We will use Spring Boot for this series. In the future, I hope to give other frameworks such as Dropwizard and Ratpack a spin as well.
Create the project in Developer Cloud
- Login to Developer Cloud
- Create a new project in Developer Cloud. Let’s call it springmedrec
- Select “Initial Repository”
-
Select your preferred Markup format and Click Finish.
Create your project in your IDE
- In Netbeans, select Maven > Spring Boot Initializr (available as a plugin in Netbeans)
-
Enter the details:
-
In dependencies, select the following options (we’ll add more later):
- DevTools
- Lombok
- Web
- JPA
- H2
- MySQL
- Actuator
- Finish.
Add Version Control
-
Once the project is created, you need to initialize your local repo:
- cd medrec
- $ git init
- If you’ve got the git plugin for Netbeans, you can use it too. I prefer to use the terminal.
-
Start tracking your code
- $ git add . && git commit –am ‘first commit’
- With Spring Boot Initializr, you can safely do this in the beginning as it will include a .gitignore with the necessary file formats to ignore.
- If you are using another framework, language or build tool, you’ll find this github project to be useful: https://github.com/github/gitignore. It includes a very useful list of .gitignore files that you can readily copy and use.
-
Add your remote repo:
- $ git remote add devcs https://<devcloudurl>/springmedrec.git
- devcs is the short name I’m using for the remote repository in Developer Cloud.
-
Push to devcs:
- $ git push – -force devcs master
- As this is the very first commit, we’ll just force the push to devcs.
Add a build job
-
Create a build job
- In DevCloud, click on Build
- Click on New Job
- Give your build job a name
- Click on source control tab
- Select git > springmedrec.git
- Click on Triggers and check ‘Based on SCM polling schedule’
-
Click on Build Steps
- Add a build step > select Maven 3
- Save and click on ‘Build Now’
- Verify your build is successful.
3 thoughts on “Exploring Oracle Cloud capabilities as a developer”