##Prerequisites## ###Accounts### Each new hire will need to set up the following accounts to start the lab content provided in this repository.
- Red Hat Access Portal Account (https://access.redhat.com)
- An OpenShift Online Account (https://www.openshift.com/app/account/new -- use your RH email address)
###Installations### Each new hire will need the following installations downloaded and unzipped prior to the start of the New Hire Bootcamp.
Install | URL |
---|---|
Java Development Kit 7 | OpenJDK, Oracle JDK |
Apache Maven (Latest) | link |
Git | link |
JBoss EAP 6.4.0 | link |
JBoss BPM Suite 6.1.0 | link |
OpenShift Command Line Tools | link |
##Day 1 - OpenShift Application Management## ###Goals###
- Learn how to use OpenShift Online to enable quick POCs (Proof-of-Concepts)
- To get familiar with both the UI and CLI experience in OpenShift
- To get familiar with the format for the lab content in the remaining days of the Bootcamp
###Instructions###
-
Run the following commands on the command line to create a new EAP 6 project in OpenShift:
rhc app-create nchlab jbossews-2.0 -g large
- These commands will output the generated credentials and locations for the OpenShift Git repository our application will use. Save this information in a text file for safekeeping.
-
Enter the newly cloned git directory
cd nchlab/
-
Connect the starter code on GitHub to the OpenShift repository:
git remote add upstream -m master git://github.com/justincohler/nch-bootcamp.git git pull -s recursive -X theirs upstream master
- An editor will ask you to enter a merge message. Enter the following to (w)rite the merge record and (q)uit out of the editor:
> :wq
- An editor will ask you to enter a merge message. Enter the following to (w)rite the merge record and (q)uit out of the editor:
-
Finally, push the starter code to OpenShift:
git push
- This will output the generated users and passwords for the EAP Admin Console, which you can use to configure persistence in the webapp.
-
In your browser, navigate to https://nchlab-.rhcloud.com/
- You now have a web application running business rules and Camel services on top of a MongoDB database!
Now we will import the projects from the "nchlab" repository into the JBDS (JBoss Developer Studio) IDE.
- Start JBDS and once you have opened a workspace, click File->Import...
- In the Import wizard, Expand the "Maven" folder, and click "Existing Maven Projects"
- Select the directory where you cloned your nchlab repository.
- Select all the projects in the parent directory, and complete the wizard. In the Project Editor, you should have 9 projects imported.
- Right click on the "lab" project, then click Run As->Maven Build...
- In the Build popup, enter:
- Goals: clean install
- Profiles: openshift
- Click 'Run' to perform the Maven build and ensure that the project build is successful.
No let's set up a local server to test out our application.
- Make sure that you have locally installed either JBoss EWS 2 and have a local MongoDB database running.
- In the "Servers" view of JBDS, right click and click on New->Server...
- In the following dialogues, select a new Tomcat 7 server and point to the EWS installation on your machine.
- On the "Add and Remove" screen, add the lab-web project in the "Available" column to the "Configured" column and click finish.
- In the web.xml of the lab-web project, under the "spring.profiles.active" context-param, change "openshift" to "default" to switch the Spring profile to your local configuration.
- Start the new server by right clicking on the new server and clicking "Start"
- Point to localhost:8080/ in your web browser and you should have the application running on your local machine with a local database.
##Day 2 - Business Rules and Process Modeling## ###Goals###
- To get familiar with BDD (Behavior-Driven-Development) by using the Cucumber test Framework
- Learn how to write Business Rules, and touch integration endpoints in Business Processes
###Note### All exercises in the code are marked by the 'XXX' label, which shows up by default the JBDS Tasks view. To expose this view in JBDS, in the top toolbar, click Window->Show View->Other..., and under "General", open "Tasks".
You can also search for 'XXX' in the File Search. In JBDS, in the top toolbar, click Search->File... and search on "XXX" in the "Containing Text" field.
###Instructions###
- To check out today's repository branch, pull all of the branches from the upstream bootcamp repository into the directory you created yesterday:
git fetch upstream
- Next, checkout the Day 2 branch of the bootcamp repository:
git checkout day2
- Open JBDS and build the project as you did yesterday. The project should now fail to build. Now comes the fun part!
The first goal of the day is to learn some basic concepts of BDD. Cucumber is a popular BDD tool we use frequently on projects. The framework uses text files containing application "features", and connects the steps of each feature to a corresponding JUnit test, called a "step". There are a number of test features found in the following location:
```
lab-test-harness/src/test/resources/features/lab.feature
```
The JUnit tests which implement these features are found at the following location:
```
lab-test-harness/src/test/java/com/rhc/lab/test/cucumber/BaseSteps.java
```
-
To start today's exercises inside of BaseSteps.java, there are two methods which have to be implemented. They are marked by the 'XXX' comment. Fill in each of these methods according to the instructions in the comments, and run the following Cucumber test to verify your results:
lab-test-harness/src/test/java/com/rhc/lab/test/cucumber/RunCukesTest.java
- In the Junit window, the features should still fail, but the "Given" steps should all pass successfully.
-
Next, you will implement the rules that will confirm or revoke a venue booking request. Locate the business rules at the following location:
lab-knowledge/src/main/resources/rules/createBooking.drl
-
Several empty rules have to be implemented. They are marked by the 'XXX' comments. Fill in each of these rules according to the instructions in the comments, and run RunCukesTest.java to verify the rules pass the features written.
-
Verify the project builds successfully by running a Maven build.
-
Once the project builds, make sure that your local application can save booking requests.
-
Then run the following Git commands to commit the files to your local repository and push the new code to your OpenShift instance:
git add . git commit -m "YOUR COMMIT MESSAGE" git push origin master
Your application is now back to a known good state and you've completed the exercises for Day 2!
###Instructions### ##Day 3 - Integrating Services with Camel## ###Goals###
- Learn how to write Camel routes for code-less integration
- Learn how to expose and consume Web Services with Camel
###Instructions ##Day 4 - Continuous Integration and Delivery## ###Goals###
- Learn how to add and use plugins in Jenkins on top of OpenShift
- Deploy our completed web application to OpenShift with Jenkins CI (Continuous Integration)
###Instructions### ##Day 5 - Breakfix Playground## ###Goals###
- TODO
###Instructions###