Filter Dropdown
Learning Jenkins
Mar 20, 2025Application Type: Deployment Pipeline
I've been wanting to learn a continuous deployment tool for a while now, at NOAA they used jenkins and while I knew enough to handle deploying my code I'd never set up a jenkins server or built my own pipeline and stages.
For the portfolio project your seeing now I decided to learn more of jenkins. Here are the goals I set out to accomplish:
- Install Jenkins onto my digital ocean linux server and make it discoverable from external networks
- Create a github webhook that sends requests to my jenkins server when pull requests are merged into branches
- Create jenkins pipelines which handle automatically building my test and and main branch into a docker container when I merge a branch into them
To do this I implemented 2 seperate jenkins files, one for production and one for test, they had similar steps but slight differences that I felt warranted seperating them into their own jenkins file, it also made their jenkins files easier to read for someone new to jenkins like me.
The stages are simple and listed below:
- Detect Pull Request: This stage simply detects what branch is peforming the pull request and ensures we are building for the right request
- Notify Discord: This stage sends out a notification to discord using a discord webhook to let me know the build process has started without having to log into jenkins everytime to check
- Build .NET MVC Project: This stage cleans, builds and publishes the .net project to a temporary workspace
- Deploy Docker Image: This stage creates a docker image and feeds it required environment variables through jenkins credentials it then runs a container based off of the image
- Post: After all runs I have a success or failure that will also send a discord message to the same discord webhook mentioned earlier
I have used nginx to set up a reverse proxy that directs users from conor-mcquillan.com and conor-mcquillan-test.com to the respective docker containers which host my mvc project.
The discord output looks like this:
I'm pretty happy with how this turned out it feels like a good workflow and makes deploying changes to my website quick and easy.