Embarking on a CI/CD Adventure: My First Foray into Automation Inspired by Lessons from Shanghai Valley
When reflecting on the invaluable lessons learned at my last startup, Shanghai Valley, one stands out prominently: the critical importance of establishing a CI/CD pipeline from the outset. The absence of CI/CD can significantly hinder product iteration speed, impeding the ability to meet fast-paced business demands — a scenario particularly detrimental for resource-constrained startups.
Embracing Trunk Based Development
Prior to CI/CD implementation, we embraced Trunk Based Development (TBD). TBD acts as a bedrock for CI/CD, streamlining focus on a single branch to maintain or approach production quality at all times.
Harnessing Jenkins
Although Jenkins was initially used for basic tasks like building binaries and signing keys, we realized its untapped potential for broader process automation.
- Build Check Automation: Previously, build failures were detected only during the build process or, worse, during release. This not only dampened team morale but also disrupted workflows. Leveraging Jenkins for automated build checks revolutionized our approach. By configuring Jenkins to poll SCM every ten minutes, any build break triggers an immediate notification to our red-alert Slack channel, allowing for swift resolution without managerial oversight.
- Monkey Stress Test: To assure app quality, we shifted from manual to automated monkey testing. Recognizing the inefficiency of relying on reminders for test execution, we automated this process to run nightly. Any detected issues are reported back for immediate attention the following day, ensuring continuous quality control.
- UI Auto Test: Automated UI testing, scheduled during off-hours, serves as our safety net. It guarantees that new iterations do not compromise existing functionalities. Any test failures are promptly communicated, enabling quick action.
Conclusion: The Transformative Power of Automation
By integrating Jenkins into our workflow, we automated previously manual tasks like Auto Build Check, Auto Stress Test, and Auto UI Test. While this only scratches the surface of CI/CD’s capabilities, the time saved and the reduction in human error have been monumental.
Furthermore, centralizing critical notifications in one place, as opposed to scattered emails or system alerts, has streamlined our focus and reduced inter-team friction. Looking ahead, we aim to implement an auto-revert system for any code that fails build and unit tests, fostering a more disciplined and efficient team culture.
In closing, sharing these insights on Facebook led to an unprecedented response, underscoring the broader tech community’s recognition of CI/CD’s significance. This encouragement fuels our commitment to continuous improvement and innovation.