loading...
Cover image for A CI/CD Hello World Pipeline: Is it possible?

A CI/CD Hello World Pipeline: Is it possible?

glsolaria profile image G.L Solaria ・2 min read

I haven't had experience working with a full CI/CD pipeline yet so I thought I would build a "Hello, World!" one. I realise CI/CD is a complex subject and it will take me time to learn and build but I want to give it my best shot to keep it simple ... ish.

There are probably many technology combinations that could be used but I want to use the following criteria to narrow it down:

  • Tooling shall be free for individual use - preferably Open Source or have a Community Edition available.
  • Tooling shall run on my Ubuntu 18.04 machine.
  • Tooling shall be able to run on Windows and Mac.

Now I am a very confident Bash scripter and I think I could use Bash as the glue for my rinky-dink (?!!) pipeline but I don't want to because I want to have fun and learn all the things!

So I after some google-foo I cobbled together the following line up:

  • Git and GitHub for source/configuration control.
  • GitHub for issue tracking.
  • Jenkins to run build and tests.
  • Docker containers to run each of the 2 hello-world-ish micro-services.
  • Kubernetes to orchestrate container deployment to give continuous user access to the micro-services.
  • I may have to use Virtual Box to simulate a multi-node architecture.

I realise that Azure Devops has a free tier which looks great. I know that GitHub is working on a CI/CD pipeline with free (I think) self-hosted runners. But I feel like more of a challenge. However, I reserve the right to change my mind if things get out of control!

So that's the rough plan. Feel free to tell me what I am missing, where I am over-tooling, or what you would do differently in the comments.

Posted on by:

glsolaria profile

G.L Solaria

@glsolaria

Windows by day, Linux by night

Discussion

markdown guide
 

Welcome to CI / CD!
To me this looks like a great list. Few things that I would add:

  • use Jenkinsfile with Jenkins so that your pipeline is described with code. That Jenkinsfile sits in your git repo and follows the CI/CD workflow you are just setting up
  • secrets, passwords and other credentials can go in Jenkins credential store. Use “withCredentials” directive in your Jenkinsfile to leverage that
  • protect your master branch in github to force the pull request workflow, and force test status to pass before you can merge to master
  • to configure your Jenkins, use the Jenkins as code plugin which sources all config from a yaml file. You get a transportable Jenkins this way.
  • yes, GitHub actions can be an alternative to Jenkins - I personally use it as a complement
 

Lately I've been trying to land a DevOps job (I'm a Build/Release Engineer) but since I have no "production experience" with tools like Docker/Kubernetes/AWS I've been turned down a lot. This project would be an excellent way to have something to show that I'm familiar with the tools.

 

Thank you for all your great suggestions! I will try to work them in to my project.

 

This sounds like a great plan!

I would go like this:
Start developing a Hello World app
Publish it to source control
Create a Kubernetes cluster
Create a build pipeline that builds, tests, packages it in a container, pushes your app to a container registry
Create a deployment pipeline that deploys the container to the Kubernetes cluster

Later you can add more apps to your pipeline and change to a private container registry to mimic the real world.

I have done sort of the same with Gitlab, Jenkins, a local Kubernetes cluster and an Azure Kubernetes cluster. The hardest part was linking Gitlab with Jenkins. Also, Jenkins is a very powerful beast once you get the hang of scripted pipelines and shared libraries!

But you could also use Azure Devops using their free pipeline and Git offering, so without Gitlab and Jenkins to make it simple in the beginning.

 

Thanks for the advice! Cheers.

 

I hope that you post progress on this. I am exactly after the same thing. I made a list of my own and very much overlaps with yours.
What I am thorn about is either on looking at a cloud provider (like you mentioned Azure) or just run everything in my Mac (some challenges setting it all up). This is great! thanks for the posting the idea.

 

Try using Jenkins X instead of Jenkins. It's designed for a kubernetes deployment.

 

Thanks for the tip. I didn't know about Jemkins X! I was hoping to find an official docker image for it on docker hub but couldn't. I did find an unofficial one though!

 

Have you looked into gitlab and gitlab runners?

 

Second GitLab cicd. It's a great, easy to start service.

 

No I haven't. I will look into it. Thanks for the suggestion!

 

Try Codefresh, it has a generous free tier with unlimited builds and uses ultra-modern container-based pipelines with a brilliant caching system.

I think you'll be pleasantly surprised 😄

 

Here is a simple YAML-based build pipeline for a Python project:

github.com/francisco-ltech/transfo...

Hope that helps with the CI bit.

 

Thanks. I can't seem to get the link to work though?

 

Sorry I forgot to make the repo public, should be accesible now.