Week 2 – Setting up Automated Builds

It’s so cool to see version 0.01 of your app in Production.
It was only our second week, but my goal was to deploy whatever we had to Prod.
Of course, I could have gone the easy way and manually copy over the binaries and get it to work.
But no, easy is no fun! And I’m big believer of not wasting time, so I decided to try and automate the build.
With our limited budget, I went with Jenkins.
I had used Jenkins before, but never had to go through the setup from scratch.
Don’t get me wrong, Jenkins is a great open source tool, but you pretty much start from blank slate. I got it to work after some time and a lot of googling.

Here is the basic flow:

1. Checkout code from Bitbucket
2. Build on the Jenkins agent server. ( You’d have to make sure, agent has all the necessary software installed to build your project.
3. Publish artifacts using SSH/SFTP to target server
4. Restart the target web server
5. Setup hooks so anytime code is merged into main repo, auto-start the build/deploy process.
Sounds simple, but the integrations between different servers/credentials etc, tool a lot of time.
But it was all worthwhile after seeing the app in Prod!
By the way, my SaaS will try to simplify this process.
What’s your build process like?