Dynamic Runtime Configuration in Angular 19

󰃭 2025-06-06 | #Angular #docker #guide #Javascript #TypeScript

Angular applications traditionally require separate builds for different environments (development, staging, production). This approach has limitations: longer CI/CD pipelines, multiple artefacts to manage, and the inability to change configuration without rebuilding. Let’s implement a better solution using runtime configuration.

The Problem with Traditional Environment Files

Angular’s default environment files require compile-time configuration:

// environment.prod.ts
export const environment = {
  production: true,
  apiUrl: 'https://api.prod.example.com',
  authClientId: 'prod-client-id'
};

This means you need a separate build for each environment, which violates the “build once, deploy anywhere” principle.

Continue reading 

Managing Multiple Git Accounts with direnv

󰃭 2025-05-24 | #automation #cli #direnv #git #github

Working for multiple clients often requires maintaining separate GitHub accounts for each organisation. This means managing different SSH keys, commit signing configurations, and project-specific environment variables. Whilst you could manually switch configurations or maintain complex shell scripts, I believe there is a more elegant solution: direnv.

If you are not familiar with direnv then you are in for a treat! direnv is a powerful shell extension that automatically loads and unloads environment variables based on your current directory. This makes it perfect for managing client-specific Git configurations whilst keeping everything organised and automated.

Continue reading 

Targeted Use of GNU Tools on macOS using direnv

󰃭 2024-11-28 | #bash #macos

Working with bash scripts on macOS often leads to an interesting predicament. MacOS ships with the BSD variants of sed, date, base64 and others that diverge just enough from their GNU counterparts to cause incompatibilities.

Take sed for example:

# GNU (Linux) version - works fine
sed -i 's/foo/bar/' file.txt

# macOS version - fails
sed -i 's/foo/bar/' file.txt
# Error: sed: 1: "file.txt": undefined label 'ile.txt'

# macOS version - requires an extension
sed -i '' 's/foo/bar/' file.txt

There are similar stories for date

Continue reading 

DIY kubectl plugins as aliases

󰃭 2024-10-27 | #bash #k8s #kubernetes #zsh

The Problem

I often find myself googling for some kubectl command that I have used before but can’t quite recall. If I thought long enough about it, I could usually construct most of these, but I like to choose where I deploy my brain cycles carefully, and repetitive CLI commands are not usually at the top of my list of things I want to think deeply about. For example, the command for pulling the initial admin password from a freshly deployed ArgoCD. The command is not that complex:

Continue reading 

DevOps Is A Culture Not A Function

󰃭 2024-10-25 | #DevOps #essay #infra #rant

DevOps is not a function, it is not a team, it is not a role. There, I said it. Click bait deployed. I am by no means the first to express this sentiment (and I urge you to go and read There Is No Such Thing as a DevOps Engineer to get a far more cogent analysis than I will offer here), but having recently been involved with clients that have a DevOps Team and are hiring for DevOps Engineers, I feel it is a point worth revisiting.

Continue reading 