This GitHub repository contains the information for the Customer Order Services microservices based application. This application is now composed of several microservices. Best practices for microservices is that each of them have their own GitHub repository and be as independent of any other component as possible. Hence, this repository serves as the umbrella for all the microservices that make up the final Customer Order Services application.
- Shopping WEB BFF Microservice
- Product Search Microservice
- Customer Order Microservice
- Legacy Application
Follow the steps mentioned here to build and deploy the Backend applications
Follow the below steps to build and deploy the Microservices.
Continuous Delivery service on Bluemix is used to create end-to-end deployment of 3 microservices on Bluemix Kubernetes Container Service.
-
Create a Kubernetes Cluster on Bluemix. Follow steps here : https://console.bluemix.net/docs/containers/cs_tutorials.html#cs_tutorials to create the cluster
-
On Bluemix Dashboard, create a toolchain.
-
Add Github Tool integration and mention git repository URL for CustomerOrderService micro service
-
Add Github Tool integration and mention git repository URL for ProductSearchService micro service
-
Add Github Tool integration and mention git repository URL for ShoppingWebBFFService micro service
-
Add Delivery Pipeline Tool integration and follow below steps to create deployment flow for CustomerOrderService microservice
- Click on Delivery Pipeline toll integration which is just added
- Add a stage to build the microservice code
- In Input tab, select git repository for CustomerOrderService which was added in step 2
- Make sure Stage Trigger is set to “Run jobs whenever a change is pushed to Git”
- In Jobs tab, Add a Build Job
- Select Builder type as “Maven” and Working Directory as “CustomerOrderService” and Save it
- Add another stage to build docker image
- In Input tab, select Stage and Build from the previous stage added above
- Make sure Stage trigger is set to “Run jobs when the previous stage is completed”
- In Jobs tab, add a new Build job
- Select Builder type as “IBM Container Service” and select rest of the input parameters appropriately (like Organization, space, etc). Secify image name as customerorderservice.
- In Build script, add below script towards the end
if [ -f customerorderservice.yaml ]; then #Update customerorderservice.yml with image name echo "UPDATING DEPLOYMENT MANIFEST:" sed -i "s~^\([[:blank:]]*\)image: ${IMAGE_NAME}*$~\1image: ${FULL_REPOSITORY_NAME}~" customerorderservice.yaml cat customerorderservice.yaml cp customerorderservice.yaml $ARCHIVE_DIR/ else echo -e "${red}Kubernetes deployment file 'customerorderservice.yaml' not found at the repository root${no_color}" exit 1 fi
This script is required to update images name in Kubernetes deployment file with the image which is built in this step. Save it 13. Add another stage to trigger kubernetes deployment. 14. In Input tab, select Stage and Job from the previous stage of Container build 15. Make sure Stage trigger is set to “Run jobs when the previous stage is completed” 16. Add a new Deploy job. 17. Select Deployer type as Kubernetes and specify input parameters as appropriate 18. In deploy script add below lines in place of “kubectl create -f pods.yml” and save
`kubectl delete -f customerorderservice.yaml` `kubectl create -f customerorderservice.yaml`
-
Add Delivery Pipeline Tool integration and follow below steps to create deployment flow for ProductSearchService microservice. Specify image and filename as “productsearchservice” in step 5.11
-
Add Delivery Pipeline Tool integration and follow below steps to create deployment flow for ShoppingWebBFFService microservice. Specify image and filename as “shoppingwebbffservice” in step 5.11