Background: Back in 2019, I worked on a testing project where application development and maintenance were being done by one organization, and my organization did the testing. We usually start our day at 1 pm, and we expect the testing environments to be released with all hot fixes between 12 pm - 1 pm. There is no connected Jenkins pipeline between the organizations as both have their own on-premise Jenkins setup. This may look fine, but it is a typical problem with many service-based organizations. The problem here is we are losing 1 hour of time between the environment release and our day start. To save an hour, we planned to create an app that triggers the Jenkins pipeline from mobile to run pipelines whenever and from wherever we need it.
Goals: To trigger on-premise Jenkins pipelines from a mobile app.
"Jenkins made a difference by easing testers' lives with jobs, schedulers and pipelines. It decreased the dependency of knowledge for new joiners in the testing team to run sanity or any automation test cases/scripts."
Solution & Results: We approached the solution in four phases:
Phase 1: Design the app using Microsoft PowerApps by adding a welcome screen, and the username of the tester. Next, we added some dropdowns to choose the Jenkins server, pipeline, environment, and job. By this, we completed the front-end design of our app in Microsoft PowerApps.
Phase 2: Connect the app with on-premise Jenkins. Once the UI buttons are complete, we added an API flow from Microsoft PowerAutomate. Microsoft PowerAutomate connects to our on-premise machine using Microsoft Power Platform on-premise data gateway, which securely creates a connection between our desktop machine and power platform.
Phase 3: We wrote different PowerShell scripts with curl commands to run Jenkins Remote API.
Phase 4: Upon connecting all the solutions, we are able to run pipelines from the mobile app by selecting by server, environment, and job. PowerApps sends data to PowerAutomate, which in turn triggers the PowerShell script using Data Gateway.
For results we saw the following:
We can run pipelines Whenever needed, You don’t have to be before your PC.
Run jobs whenever needed.
Zero additional cost, PowerPlatform comes free with an Office365 License.