CI Builder
My CI testing pipeline for a django project.
Prereqs
-
k3d: https://k3d.io/
-
You'll be using "*.localhost" domains for testing. This means you'll either have to use Chrome (which has these built in) or firefox. In Firefox:
- Type
about:configin the url field of your browser and press enter - Search for
network.dns.localDomains - Double click to edit the field
- Add these values:
button.localhost, pgadmin.localhost, traefik.localhost - As you build your own sites you can add more to test!
- Type
Docker
# build the docker image. This uses the build step from docker-compose.yml.
docker compose build
# Now start postgres, pgadmin and traefik
docker compose up -d postgres pgadmin traefik
# Navigate to http://traefik.localhost to see your ingress routes
# View the logs to check the container status
docker compose logs
# Now start the init container and wait for migrations to apply
docker compose up init
# Now start the button container
docker compose up -d button
# View the site logs
docker compose logs --follow button
# Navigate to http://button.localhost
# Take down the site
docker compose down
K3D
# Create a cluster for our button app
k3d cluster create button -p "80:8000@loadbalancer" --volume $HOME/.kube/registries.yaml:/var/lib/rancher/k3s/registries.yaml