⮤ sablecliff.
an online garden for thoughts and projectsAutomated Deployment
Greener pastures -- 2 minute(s) readI’ve recently set up an CI/CD pipeline for a side project (and also this blog!). It’s the first time I’ve setup one myself and I recognise it’s still a long way from being robust. For the last 4 years I’ve been working for a company that preaches the ‘digital transformation’ and how much it pays to have automation take the reins. There’s been continuous discussion about ‘unbreakable pipelines’ and how our monitoring system fits within that paradigm.
So, after all this time (and waiting patiently for my vps provider to support docker) I’ve finally started implementing pipelines. It’s basic: Each new commit will have tests run (and must pass) before ansible runs a deployment playbook to re-instance the running copy.
- Gitea
- Self-hosted Github-like git UI - Gitea is a github clone written in GO-lang.
- Supplied as a single executable with only a database dependancy it’s been very simple to configure and run without Docker
- Docker
- Deployment of smaller components - mainly a DroneCI server, Postgres Database (for DroneCI) and a DroneCI Runner
- Lets me deploy application components like lego bricks - only worrying about how they fit together, not how to deploy them
- Terraform
- Used to declaratively manage the DroneCI docker containers.
- Using Terraform to manage my containers over docker-compose et al was a choice based on my interest in the technology and simplicity. It mostly just works
- DroneCI
- A ‘container native’ CI/CD tool that runs in and uses containers for task execution.
- Has support and plugins for Gitea, Hugo, Discord and more
- Ansible
- Deploying code can be messy. Ansible makes it easy to write structured ‘recipes’ rather than relying on handwritten scrawls
- This is used to ensure the machine my code is being deployed to is correctly configured and handles the actual moving of code from my Gitea repo to the server
- PM2
- PM2 is a NodeJS process manager that helps manage the environment for my Node app
- Also watches the app and restarts it if it crashes for any reason
It’s worth noting that this blog’s CD system is much more straight forward - Gitea -> DroneCI -> Hugo (compile) -> Push to server
I’ve still not made up my mind on how I want to treat this Blog. It’s possible I’ll revisit each of these components to expand upon how I’ve gone about it.
Until next time.