May 15, 2017 | Written by: Robin Bobbitt
Categorized: DevOps | How-tos
Share this post:
In 2015, I shared the great things
IBM® Bluemix® DevOps Services can do for you and your favorite GitHub repo. Since then, the DevOps Services team has taken the best of DevOps Services and rebuilt it as IBM Bluemix Continuous Delivery
, with even more and better GitHub integrations for you and your team. By making your repo a part of a Continuous Delivery toolchain, you can automatically build and deploy your code to Bluemix, trace your changes from commit to your deployment targets, edit your code in a fully functional browser-based IDE, and gain valuable insights into your code and your development team. Let’s take a look at each of these capabilities.
With this toolchain, I’m developing a simple Node.js app for checking the weather.
My code is stored in a GitHub repo, and I’m tracking my work in the same GitHub project. I use Delivery Pipeline to automatically build, test, and deploy my app to Bluemix.
Delivery pipeline with four stages and two deployment targets
With my pipeline, I can organize the continuous delivery of my app into several stages, each consisting of one or more discrete jobs. The BUILD stage grabs my latest code changes and runs a set of unit tests against the code. If the tests pass, the pipeline proceeds to the STAGING stage and deploys my app to my staging environment on Bluemix. FVT tests are then run against the deployed app. If everything succeeds, I use a Deployment Risk gate from DevOps Insights to decide whether it’s safe to proceed to production based on predefined criteria. My criteria are that all critical tests must pass and that code test coverage must show no regressions. My pipeline automatically deploys to production when the GATE stage passes. If I want to add another layer of checking, I can configure my PRODUCTION stage to run manually only.
As you can see, Delivery Pipeline is the way that my app goes from code in GitHub to live on Bluemix. I can make this path as simple or as complex as my app requires. For more information about Delivery Pipeline, see Working with Delivery Pipeline
Because I enabled the option to track the deployment of code changes when I configured my GitHub repo in my toolchain, I can trace the flow of my code changes to Bluemix. As Delivery Pipeline deploys my changes, the commits are tagged with an indicator of where they were deployed and the time of the deployment. Likewise, the linked issues are automatically labeled to indicate where they were deployed.
A commit tagged with deployment details
A linked issue labeled with deployment targets
By adding DevOps Insights to my toolchain, I used the Deployment Risk gates that you read about earlier. When I also allow DevOps Insights to analyze my GitHub repo and issues, I can gain developer and team insights. As you can see from this example, I’m not doing a great job of linking my commits to issues, and I need to make
sure that I’m keeping my code changes quick and small. I can also identify risky, defect-prone files and make sure that I reduce the number of those files over time.
Developer Insights: Developer Best Practices
I can also ensure that my team is properly balanced, with developers contributing equally where appropriate and collaborating on code. I can use this data to determine where it might make sense to cross-train developers or assign mentors to new developers.
Team Dynamics: Social Coding