From d6e472c1382a832e3631001499ee0e259fd4d999 Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Thu, 8 Jan 2026 17:13:02 +0000 Subject: [PATCH 01/12] Bumped tooling versions --- README.md | 435 +--------------------------------------------- argocd.sh | 2 +- bicep.sh | 2 +- helm-plugins.sh | 4 +- helm.sh | 2 +- kubectl.sh | 4 +- oh-my-posh.sh | 2 +- pluto.sh | 2 +- polaris.sh | 2 +- terraform-docs.sh | 2 +- terraform.sh | 2 +- tfsec.sh | 2 +- trivy.sh | 2 +- velero.sh | 2 +- 14 files changed, 20 insertions(+), 445 deletions(-) diff --git a/README.md b/README.md index 198ec58..fcfa9ef 100644 --- a/README.md +++ b/README.md @@ -1,432 +1,7 @@ -# terraform-docs +# Tools Install -[![Build Status](https://github.com/terraform-docs/terraform-docs/workflows/ci/badge.svg)](https://github.com/terraform-docs/terraform-docs/actions) [![GoDoc](https://pkg.go.dev/badge/github.com/terraform-docs/terraform-docs)](https://pkg.go.dev/github.com/terraform-docs/terraform-docs) [![Go Report Card](https://goreportcard.com/badge/github.com/terraform-docs/terraform-docs)](https://goreportcard.com/report/github.com/terraform-docs/terraform-docs) [![Codecov Report](https://codecov.io/gh/terraform-docs/terraform-docs/branch/master/graph/badge.svg)](https://codecov.io/gh/terraform-docs/terraform-docs) [![License](https://img.shields.io/github/license/terraform-docs/terraform-docs)](https://github.com/terraform-docs/terraform-docs/blob/master/LICENSE) [![Latest release](https://img.shields.io/github/v/release/terraform-docs/terraform-docs)](https://github.com/terraform-docs/terraform-docs/releases) +These are setup scripts for tools, SDKs and other things I want on a new system. -![terraform-docs-teaser](./images/terraform-docs-teaser.png) - -## What is terraform-docs - -A utility to generate documentation from Terraform modules in various output formats. - -## Installation - -macOS users can install using [Homebrew]: - -```bash -brew install terraform-docs -``` - -or - -```bash -brew install terraform-docs/tap/terraform-docs -``` - -Windows users can install using [Scoop]: - -```bash -scoop bucket add terraform-docs https://github.com/terraform-docs/scoop-bucket -scoop install terraform-docs -``` - -or [Chocolatey]: - -```bash -choco install terraform-docs -``` - -Stable binaries are also available on the [releases] page. To install, download the -binary for your platform from "Assets" and place this into your `$PATH`: - -```bash -curl -Lo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.19.0/terraform-docs-v0.19.0-$(uname)-amd64.tar.gz -tar -xzf terraform-docs.tar.gz -chmod +x terraform-docs -mv terraform-docs /usr/local/bin/terraform-docs -``` - -**NOTE:** Windows releases are in `ZIP` format. - -The latest version can be installed using `go install` or `go get`: - -```bash -# go1.17+ -go install github.com/terraform-docs/terraform-docs@v0.19.0 -``` - -```bash -# go1.16 -GO111MODULE="on" go get github.com/terraform-docs/terraform-docs@v0.19.0 -``` - -**NOTE:** please use the latest Go to do this, minimum `go1.16` is required. - -This will put `terraform-docs` in `$(go env GOPATH)/bin`. If you encounter the error -`terraform-docs: command not found` after installation then you may need to either add -that directory to your `$PATH` as shown [here] or do a manual installation by cloning -the repo and run `make build` from the repository which will put `terraform-docs` in: - -```bash -$(go env GOPATH)/src/github.com/terraform-docs/terraform-docs/bin/$(uname | tr '[:upper:]' '[:lower:]')-amd64/terraform-docs -``` - -## Usage - -### Running the binary directly - -To run and generate documentation into README within a directory: - -```bash -terraform-docs markdown table --output-file README.md --output-mode inject /path/to/module -``` - -Check [`output`] configuration for more details and examples. - -### Using docker - -terraform-docs can be run as a container by mounting a directory with `.tf` -files in it and run the following command: - -```bash -docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.19.0 markdown /terraform-docs -``` - -If `output.file` is not enabled for this module, generated output can be redirected -back to a file: - -```bash -docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.19.0 markdown /terraform-docs > doc.md -``` - -**NOTE:** Docker tag `latest` refers to _latest_ stable released version and `edge` -refers to HEAD of `master` at any given point in time. - -### Using GitHub Actions - -To use terraform-docs GitHub Action, configure a YAML workflow file (e.g. -`.github/workflows/documentation.yml`) with the following: - -```yaml -name: Generate terraform docs -on: - - pull_request - -jobs: - docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.ref }} - - - name: Render terraform docs and push changes back to PR - uses: terraform-docs/gh-actions@main - with: - working-dir: . - output-file: README.md - output-method: inject - git-push: "true" -``` - -Read more about [terraform-docs GitHub Action] and its configuration and -examples. - -### pre-commit hook - -With pre-commit, you can ensure your Terraform module documentation is kept -up-to-date each time you make a commit. - -First [install pre-commit] and then create or update a `.pre-commit-config.yaml` -in the root of your Git repo with at least the following content: - -```yaml -repos: - - repo: https://github.com/terraform-docs/terraform-docs - rev: "v0.19.0" - hooks: - - id: terraform-docs-go - args: ["markdown", "table", "--output-file", "README.md", "./mymodule/path"] -``` - -Then run: - -```bash -pre-commit install -pre-commit install-hooks -``` - -Further changes to your module's `.tf` files will cause an update to documentation -when you make a commit. - -## Configuration - -terraform-docs can be configured with a yaml file. The default name of this file is -`.terraform-docs.yml` and the path order for locating it is: - -1. root of module directory -1. `.config/` folder at root of module directory -1. current directory -1. `.config/` folder at current directory -1. `$HOME/.tfdocs.d/` - -```yaml -formatter: "" # this is required - -version: "" - -header-from: main.tf -footer-from: "" - -recursive: - enabled: false - path: modules - include-main: true - -sections: - hide: [] - show: [] - -content: "" - -output: - file: "" - mode: inject - template: |- - - {{ .Content }} - - -output-values: - enabled: false - from: "" - -sort: - enabled: true - by: name - -settings: - anchor: true - color: true - default: true - description: false - escape: true - hide-empty: false - html: true - indent: 2 - lockfile: true - read-comments: true - required: true - sensitive: true - type: true -``` - -## Content Template - -Generated content can be customized further away with `content` in configuration. -If the `content` is empty the default order of sections is used. - -Compatible formatters for customized content are `asciidoc` and `markdown`. `content` -will be ignored for other formatters. - -`content` is a Go template with following additional variables: - -- `{{ .Header }}` -- `{{ .Footer }}` -- `{{ .Inputs }}` -- `{{ .Modules }}` -- `{{ .Outputs }}` -- `{{ .Providers }}` -- `{{ .Requirements }}` -- `{{ .Resources }}` - -and following functions: - -- `{{ include "relative/path/to/file" }}` - -These variables are the generated output of individual sections in the selected -formatter. For example `{{ .Inputs }}` is Markdown Table representation of _inputs_ -when formatter is set to `markdown table`. - -Note that sections visibility (i.e. `sections.show` and `sections.hide`) takes -precedence over the `content`. - -Additionally there's also one extra special variable avaialble to the `content`: - -- `{{ .Module }}` - -As opposed to the other variables mentioned above, which are generated sections -based on a selected formatter, the `{{ .Module }}` variable is just a `struct` -representing a [Terraform module]. - -````yaml -content: |- - Any arbitrary text can be placed anywhere in the content - - {{ .Header }} - - and even in between sections - - {{ .Providers }} - - and they don't even need to be in the default order - - {{ .Outputs }} - - include any relative files - - {{ include "relative/path/to/file" }} - - {{ .Inputs }} - - # Examples - - ```hcl - {{ include "examples/foo/main.tf" }} - ``` - - ## Resources - - {{ range .Module.Resources }} - - {{ .GetMode }}.{{ .Spec }} ({{ .Position.Filename }}#{{ .Position.Line }}) - {{- end }} -```` - -## Build on top of terraform-docs - -terraform-docs primary use-case is to be utilized as a standalone binary, but -some parts of it is also available publicly and can be imported in your project -as a library. - -```go -import ( - "github.com/terraform-docs/terraform-docs/format" - "github.com/terraform-docs/terraform-docs/print" - "github.com/terraform-docs/terraform-docs/terraform" -) - -// buildTerraformDocs for module root `path` and provided content `tmpl`. -func buildTerraformDocs(path string, tmpl string) (string, error) { - config := print.DefaultConfig() - config.ModuleRoot = path // module root path (can be relative or absolute) - - module, err := terraform.LoadWithOptions(config) - if err != nil { - return "", err - } - - // Generate in Markdown Table format - formatter := format.NewMarkdownTable(config) - - if err := formatter.Generate(module); err != nil { - return "", err - } - - // // Note: if you don't intend to provide additional template for the generated - // // content, or the target format doesn't provide templating (e.g. json, yaml, - // // xml, or toml) you can use `Content()` function instead of `Render()`. - // // `Content()` returns all the sections combined with predefined order. - // return formatter.Content(), nil - - return formatter.Render(tmpl) -} -``` - -## Plugin - -Generated output can be heavily customized with [`content`], but if using that -is not enough for your use-case, you can write your own plugin. - -In order to install a plugin the following steps are needed: - -- download the plugin and place it in `~/.tfdocs.d/plugins` (or `./.tfdocs.d/plugins`) -- make sure the plugin file name is `tfdocs-format-` -- modify [`formatter`] of `.terraform-docs.yml` file to be `` - -**Important notes:** - -- if the plugin file name is different than the example above, terraform-docs won't -be able to to pick it up nor register it properly -- you can only use plugin thorough `.terraform-docs.yml` file and it cannot be used -with CLI arguments - -To create a new plugin create a new repository called `tfdocs-format-` with -following `main.go`: - -```go -package main - -import ( - _ "embed" //nolint - - "github.com/terraform-docs/terraform-docs/plugin" - "github.com/terraform-docs/terraform-docs/print" - "github.com/terraform-docs/terraform-docs/template" - "github.com/terraform-docs/terraform-docs/terraform" -) - -func main() { - plugin.Serve(&plugin.ServeOpts{ - Name: "", - Version: "0.1.0", - Printer: printerFunc, - }) -} - -//go:embed sections.tmpl -var tplCustom []byte - -// printerFunc the function being executed by the plugin client. -func printerFunc(config *print.Config, module *terraform.Module) (string, error) { - tpl := template.New(config, - &template.Item{Name: "custom", Text: string(tplCustom)}, - ) - - rendered, err := tpl.Render("custom", module) - if err != nil { - return "", err - } - - return rendered, nil -} -``` - -Please refer to [tfdocs-format-template] for more details. You can create a new -repository from it by clicking on `Use this template` button. - -## Documentation - -- **Users** - - Read the [User Guide] to learn how to use terraform-docs - - Read the [Formats Guide] to learn about different output formats of terraform-docs - - Refer to [Config File Reference] for all the available configuration options -- **Developers** - - Read [Contributing Guide] before submitting a pull request - -Visit [our website] for all documentation. - -## Community - -- Discuss terraform-docs on [Slack] - -## License - -MIT License - Copyright (c) 2021 The terraform-docs Authors. - -[Chocolatey]: https://www.chocolatey.org -[Config File Reference]: https://terraform-docs.io/user-guide/configuration/ -[`content`]: https://terraform-docs.io/user-guide/configuration/content/ -[Contributing Guide]: CONTRIBUTING.md -[Formats Guide]: https://terraform-docs.io/reference/terraform-docs/ -[`formatter`]: https://terraform-docs.io/user-guide/configuration/formatter/ -[here]: https://golang.org/doc/code.html#GOPATH -[Homebrew]: https://brew.sh -[install pre-commit]: https://pre-commit.com/#install -[`output`]: https://terraform-docs.io/user-guide/configuration/output/ -[releases]: https://github.com/terraform-docs/terraform-docs/releases -[Scoop]: https://scoop.sh/ -[Slack]: https://slack.terraform-docs.io/ -[terraform-docs GitHub Action]: https://github.com/terraform-docs/gh-actions -[Terraform module]: https://pkg.go.dev/github.com/terraform-docs/terraform-docs/terraform#Module -[tfdocs-format-template]: https://github.com/terraform-docs/tfdocs-format-template -[our website]: https://terraform-docs.io/ -[User Guide]: https://terraform-docs.io/user-guide/introduction/ +They should be safe to run at any time (idempotent). Where possible I install via APT, or from an "official" +remote setup script URL. Where binaries are downloaded and un-tarred directly, they will be placed in +`~/.local/bin` diff --git a/argocd.sh b/argocd.sh index 64e0705..15b6e07 100755 --- a/argocd.sh +++ b/argocd.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/argoproj/argo-cd/releases -version="2.10.18" +version="3.1.10" start "Argo CD $version" diff --git a/bicep.sh b/bicep.sh index 2deeae2..80e7ba3 100755 --- a/bicep.sh +++ b/bicep.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/Azure/bicep/releases/ -VERSION="v0.24.24" +VERSION="v0.39.26" start "bicep $VERSION" diff --git a/helm-plugins.sh b/helm-plugins.sh index 7165074..4a9afdb 100755 --- a/helm-plugins.sh +++ b/helm-plugins.sh @@ -10,11 +10,11 @@ echo # https://github.com/databus23/helm-diff/releases helm plugin uninstall diff 2>/dev/null -helm plugin install https://github.com/databus23/helm-diff --version v3.9.2 +helm plugin install https://github.com/databus23/helm-diff --version v3.14.1 # https://github.com/helm/helm-mapkubeapis/releases helm plugin uninstall mapkubeapis 2>/dev/null -helm plugin install https://github.com/helm/helm-mapkubeapis --version v0.4.1 +helm plugin install https://github.com/helm/helm-mapkubeapis --version v0.6.1 echo -e "\nHelm Plugins:" helm plugin list diff --git a/helm.sh b/helm.sh index 9e70a34..5c0ac1b 100755 --- a/helm.sh +++ b/helm.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/helm/helm/releases -ver="3.18.2" +ver="3.19.4" start "Helm v$ver" diff --git a/kubectl.sh b/kubectl.sh index 45ae3ae..1022410 100755 --- a/kubectl.sh +++ b/kubectl.sh @@ -6,8 +6,8 @@ source "$DIR/.lib.sh" # show available versions (only available after adding k8s apt repo): # apt-cache madison kubectl | head -n 30 -VERSION="1.27.8-1.1" -MINOR_VERSION="v1.27" +VERSION="1.32.9-1.1" +MINOR_VERSION="v1.32.9" start "kubectl $VERSION" diff --git a/oh-my-posh.sh b/oh-my-posh.sh index ba795ca..6b46a52 100755 --- a/oh-my-posh.sh +++ b/oh-my-posh.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/JanDeDobbeleer/oh-my-posh3/releases -ver="v21.6.0" +ver="v29.0.1" start "oh-my-posh $ver" diff --git a/pluto.sh b/pluto.sh index e3bcefd..7c0fb3d 100755 --- a/pluto.sh +++ b/pluto.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/FairwindsOps/pluto/releases -ver="5.19.0" +ver="5.22.7" start "Pluto $ver" diff --git a/polaris.sh b/polaris.sh index d24740e..23def19 100755 --- a/polaris.sh +++ b/polaris.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/fairwindsops/polaris/releases -ver="8.5.4" +ver="10.1.3" start "Polaris $ver" diff --git a/terraform-docs.sh b/terraform-docs.sh index b6cecd9..9a04253 100755 --- a/terraform-docs.sh +++ b/terraform-docs.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/terraform-docs/terraform-docs/releases -VERSION="v0.20.0" +VERSION="v0.21.0" start "terraform-docs $VERSION" diff --git a/terraform.sh b/terraform.sh index c1c3b60..b026f51 100755 --- a/terraform.sh +++ b/terraform.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/hashicorp/terraform/releases -VERSION="1.12.1" +VERSION="1.13.3" start "Terraform $VERSION" diff --git a/tfsec.sh b/tfsec.sh index 58202fb..55930e3 100755 --- a/tfsec.sh +++ b/tfsec.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/aquasecurity/tfsec/releases -VERSION="v1.28.5" +VERSION="v1.28.14" start "tfsec $VERSION" diff --git a/trivy.sh b/trivy.sh index eb3a603..b2daf80 100755 --- a/trivy.sh +++ b/trivy.sh @@ -6,7 +6,7 @@ source "$DIR/.lib.sh" # https://aquasecurity.github.io/trivy/latest/getting-started/installation/ # https://github.com/aquasecurity/trivy/releases -ver="0.48.3" +ver="0.68.2" start "Trivy $ver" diff --git a/velero.sh b/velero.sh index 380c99f..e9139d8 100755 --- a/velero.sh +++ b/velero.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/vmware-tanzu/velero/releases -ver="v1.16.1" +ver="v1.17.1" start "Velero $ver" From 30f18688dc9ff7bf2d0c8bdc0a55980b2294aa36 Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Fri, 9 Jan 2026 18:54:05 +0000 Subject: [PATCH 02/12] Updated tooling scripts --- azure-cli.sh | 11 ++++++++++- install-common.sh | 1 + kubectl.sh | 20 ++++++++------------ powershell.sh | 24 ++++++++++++++++-------- pre-commit.sh | 2 +- 5 files changed, 36 insertions(+), 22 deletions(-) diff --git a/azure-cli.sh b/azure-cli.sh index 35d4df5..39c659d 100755 --- a/azure-cli.sh +++ b/azure-cli.sh @@ -4,6 +4,15 @@ trap "echo 'error: Script failed: see failed command above'" ERR DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" +# use the highest version used in environment +# KUBECTL_VERSION="latest" +KUBECTL_VERSION="1.33.7" + +# use latest kubelogin version from: +# https://github.com/Azure/kubelogin/releases +# https://github.com/Azure/kubelogin/blob/main/CHANGELOG.md +KUBELOGIN_VERSION="0.2.14" + start 'Azure CLI' # install @@ -15,7 +24,7 @@ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash # https://github.com/Azure/kubelogin # use default aks version -sudo az aks install-cli +sudo az aks install-cli --client-version ${KUBECTL_VERSION} --kubelogin-version ${KUBELOGIN_VERSION} # version info command -v kubectl diff --git a/install-common.sh b/install-common.sh index 49715ce..cfe5462 100755 --- a/install-common.sh +++ b/install-common.sh @@ -10,6 +10,7 @@ sudo apt upgrade -y echo -e "\e[34m»»» 🚀 \e[32mInstalling \e[33m'Common Tools'\e[32m ... \e[39m" ~/tools/azure-cli.sh ~/tools/helm.sh +~/tools/kubectl.sh ~/tools/kube-tools.sh ~/tools/misc.sh ~/tools/powershell.sh diff --git a/kubectl.sh b/kubectl.sh index 1022410..d33239e 100755 --- a/kubectl.sh +++ b/kubectl.sh @@ -6,8 +6,8 @@ source "$DIR/.lib.sh" # show available versions (only available after adding k8s apt repo): # apt-cache madison kubectl | head -n 30 -VERSION="1.32.9-1.1" -MINOR_VERSION="v1.32.9" +VERSION="1.33.7-ubuntu24.04u1" +MINOR_VERSION="v1.35" start "kubectl $VERSION" @@ -16,17 +16,13 @@ start "kubectl $VERSION" # Update the apt package index and install packages needed to use the Kubernetes apt repository: sudo apt-get update -sudo apt-get install -y apt-transport-https ca-certificates curl +# apt-transport-https may be a dummy package; if so, you can skip that package +sudo apt-get install -y apt-transport-https ca-certificates curl gnupg -# Download the public signing key for the Kubernetes package repositories. -# The same signing key is used for all repositories so you can disregard the version in the URL -curl -fsSL https://pkgs.k8s.io/core:/stable:/${MINOR_VERSION}/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg - -# This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list -echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/${MINOR_VERSION}/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list - -# sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg -# echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list +# If the folder `/etc/apt/keyrings` does not exist, it should be created before the curl command, read the note below. +# sudo mkdir -p -m 755 /etc/apt/keyrings +curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.35/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg +sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # allow unprivileged APT programs to read this keyring sudo apt-get update sudo apt-get install -y kubectl=$VERSION diff --git a/powershell.sh b/powershell.sh index 67e399f..cb7ba78 100755 --- a/powershell.sh +++ b/powershell.sh @@ -8,7 +8,10 @@ source "$DIR/.lib.sh" # apt-cache madison powershell | head -n 40 # apt list update && apt list -a powershell -start "PowerShell (ubuntu-2204)" +start "PowerShell" + +################################### +# Prerequisites # Update the list of packages sudo apt-get update @@ -16,23 +19,28 @@ sudo apt-get update # Install pre-requisite packages. sudo apt-get install -y wget apt-transport-https software-properties-common -# Download the Microsoft repository GPG keys -wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" +# Get the version of Ubuntu +source /etc/os-release + +# Download the Microsoft repository keys +wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb -# Register the Microsoft repository GPG keys +# Register the Microsoft repository keys sudo dpkg -i packages-microsoft-prod.deb +# Delete the Microsoft repository keys file +rm packages-microsoft-prod.deb + # Update the list of packages after we added packages.microsoft.com sudo apt-get update +################################### # Install PowerShell sudo apt-get install -y powershell -# Cleanup -rm packages-microsoft-prod.deb - # Install modules -pwsh --command "Install-Module -Name posh-git, PSReadLine -Verbose" +pwsh --command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose" +pwsh --command "Install-Module -Name posh-git, PSReadLine, Microsoft.PowerShell.SecretManagement, Microsoft.PowerShell.SecretStore -Verbose" pwsh --command "Get-Module" end 'pwsh' '--version' diff --git a/pre-commit.sh b/pre-commit.sh index 2fa2977..cbbd03d 100755 --- a/pre-commit.sh +++ b/pre-commit.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://pypi.org/project/pre-commit/#history -VERSION='4.2.0' +VERSION='4.5.1' start "pre-commit $VERSION" From 4e912cb9d3143837a305a05224aeed171f268f2d Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Mon, 12 Jan 2026 17:47:33 +0000 Subject: [PATCH 03/12] Refactor installation scripts for common tools and PowerShell modules --- install-common.sh | 22 +++++++++++++--------- misc.sh | 6 +++--- powershell-modules.sh | 14 ++++++++++++++ powershell.sh | 6 +++--- 4 files changed, 33 insertions(+), 15 deletions(-) create mode 100755 powershell-modules.sh diff --git a/install-common.sh b/install-common.sh index cfe5462..fdb1811 100755 --- a/install-common.sh +++ b/install-common.sh @@ -4,20 +4,24 @@ trap "echo 'error: Script failed: see failed command above'" ERR DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" -sudo apt update -y -sudo apt upgrade -y +sudo apt update -y && sudo apt upgrade -y echo -e "\e[34m»»» 🚀 \e[32mInstalling \e[33m'Common Tools'\e[32m ... \e[39m" -~/tools/azure-cli.sh ~/tools/helm.sh -~/tools/kubectl.sh -~/tools/kube-tools.sh -~/tools/misc.sh ~/tools/powershell.sh -~/tools/pre-commit.sh -~/tools/python-tools.sh -~/tools/python.sh +~/tools/powershell-modules.sh + ~/tools/terraform-docs.sh ~/tools/terraform.sh ~/tools/velero.sh + +# TO FIX +~/tools/azure-cli.sh # az aks install-cli currently getting blocked +~/tools/kubectl.sh +~/tools/kube-tools.sh # waiting to get kubectl working first +~/tools/misc.sh # are WSL Utilities still required so Azure CLIs can open browser windows for login? + +~/tools/pre-commit.sh +~/tools/python-tools.sh +~/tools/python.sh echo -e "\e[34m»»» 💪 \e[32mFinished Installing \e[33m'Common Tools'\e[32m. \e[39m" diff --git a/misc.sh b/misc.sh index ec4ccbb..78a8901 100755 --- a/misc.sh +++ b/misc.sh @@ -7,6 +7,6 @@ sudo apt-get update -y sudo apt-get install -y jq pv unzip tree # Install WSL Utilities - Azure CLIs can open browser windows for login -sudo add-apt-repository ppa:wslutilities/wslu -sudo apt update -sudo apt install wslu +# sudo add-apt-repository ppa:wslutilities/wslu +# sudo apt update +# sudo apt install wslu diff --git a/powershell-modules.sh b/powershell-modules.sh new file mode 100755 index 0000000..6b41ca2 --- /dev/null +++ b/powershell-modules.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "echo 'error: Script failed: see failed command above'" ERR +DIR=$(cd "$(dirname "$0")" && pwd) +source "$DIR/.lib.sh" + +start "PowerShell Modules" + +# Install modules +pwsh --command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted'" +pwsh --command "Install-Module -Name Az, Microsoft.Graph, Microsoft.Graph.Beta" +pwsh --command "Get-Module -Name Az, Microsoft.Graph, Microsoft.Graph.Beta -ListAvailable" + +end 'pwsh' '--version' diff --git a/powershell.sh b/powershell.sh index cb7ba78..0705935 100755 --- a/powershell.sh +++ b/powershell.sh @@ -39,8 +39,8 @@ sudo apt-get update sudo apt-get install -y powershell # Install modules -pwsh --command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose" -pwsh --command "Install-Module -Name posh-git, PSReadLine, Microsoft.PowerShell.SecretManagement, Microsoft.PowerShell.SecretStore -Verbose" -pwsh --command "Get-Module" +pwsh --command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted'" +pwsh --command "Install-Module -Name posh-git, PSReadLine, Microsoft.PowerShell.SecretManagement, Microsoft.PowerShell.SecretStore" +pwsh --command "Get-Module -Name posh-git, PSReadLine, Microsoft.PowerShell.SecretManagement, Microsoft.PowerShell.SecretStore -ListAvailable" end 'pwsh' '--version' From 9d3291e7a5ad17170f4b7e85ac7ca30b61ec60bb Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Mon, 12 Jan 2026 17:53:16 +0000 Subject: [PATCH 04/12] Update installation scripts to include Python3 and bump Terraform version to 1.13.5 --- misc.sh | 2 +- terraform.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/misc.sh b/misc.sh index 78a8901..9f2cb44 100755 --- a/misc.sh +++ b/misc.sh @@ -4,7 +4,7 @@ trap "echo 'error: Script failed: see failed command above'" ERR # Misc system utilities sudo apt-get update -y -sudo apt-get install -y jq pv unzip tree +sudo apt-get install -y jq pv unzip tree python3 # Install WSL Utilities - Azure CLIs can open browser windows for login # sudo add-apt-repository ppa:wslutilities/wslu diff --git a/terraform.sh b/terraform.sh index b026f51..3457c3b 100755 --- a/terraform.sh +++ b/terraform.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/hashicorp/terraform/releases -VERSION="1.13.3" +VERSION="1.13.5" start "Terraform $VERSION" From 9a58b139955cd6d4f17372b66be93fc4edb04307 Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Mon, 12 Jan 2026 18:05:33 +0000 Subject: [PATCH 05/12] Fixed python issues --- install-common.sh | 2 +- misc.sh | 2 +- pre-commit.sh | 13 ++++++++++++- python-tools.sh | 17 ++++++++++++++--- python.sh | 19 ++++++++++++++----- 5 files changed, 42 insertions(+), 11 deletions(-) diff --git a/install-common.sh b/install-common.sh index fdb1811..034fa06 100755 --- a/install-common.sh +++ b/install-common.sh @@ -21,7 +21,7 @@ echo -e "\e[34m»»» 🚀 \e[32mInstalling \e[33m'Common Tools'\e[32m ... \e[39 ~/tools/kube-tools.sh # waiting to get kubectl working first ~/tools/misc.sh # are WSL Utilities still required so Azure CLIs can open browser windows for login? +~/tools/python.sh ~/tools/pre-commit.sh ~/tools/python-tools.sh -~/tools/python.sh echo -e "\e[34m»»» 💪 \e[32mFinished Installing \e[33m'Common Tools'\e[32m. \e[39m" diff --git a/misc.sh b/misc.sh index 9f2cb44..78a8901 100755 --- a/misc.sh +++ b/misc.sh @@ -4,7 +4,7 @@ trap "echo 'error: Script failed: see failed command above'" ERR # Misc system utilities sudo apt-get update -y -sudo apt-get install -y jq pv unzip tree python3 +sudo apt-get install -y jq pv unzip tree # Install WSL Utilities - Azure CLIs can open browser windows for login # sudo add-apt-repository ppa:wslutilities/wslu diff --git a/pre-commit.sh b/pre-commit.sh index cbbd03d..a7267e7 100755 --- a/pre-commit.sh +++ b/pre-commit.sh @@ -8,8 +8,19 @@ source "$DIR/.lib.sh" VERSION='4.5.1' start "pre-commit $VERSION" +# Default venv: allow override with PRE_COMMIT_VENV env var +VENV_DIR="${PRE_COMMIT_VENV:-$DIR/.venv}" +if [ ! -d "$VENV_DIR" ]; then + echo "Creating virtualenv at $VENV_DIR" + python3 -m venv "$VENV_DIR" +fi +# activate venv +# shellcheck disable=SC1090 +source "$VENV_DIR/bin/activate" -# https://pre-commit.com/#install +# upgrade pip inside venv and install pre-commit there +python -m pip install --upgrade pip +pip --version pip install --no-input pre-commit==${VERSION} end 'pre-commit' '--version' diff --git a/python-tools.sh b/python-tools.sh index 00ab34b..f4b9dc0 100755 --- a/python-tools.sh +++ b/python-tools.sh @@ -5,9 +5,20 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://pypi.org/project/tldr/#history -TLDR_VERSION='3.4.1' +TLDR_VERSION='3.4.3' # PACKAGE_VERSION='x.x.x' +# Default venv: allow override with PYTHON_TOOLS_VENV env var +VENV_DIR="${PYTHON_TOOLS_VENV:-$DIR/.venv}" +if [ ! -d "$VENV_DIR" ]; then + echo "Creating virtualenv at $VENV_DIR" + python3 -m venv "$VENV_DIR" +fi +# shellcheck disable=SC1090 +source "$VENV_DIR/bin/activate" + +python -m pip install --upgrade pip +pip --version + pip install --no-input \ - tldr==${TLDR_VERSION} \ - # package_name==${PACKAGE_VERSION} \ + tldr==${TLDR_VERSION} diff --git a/python.sh b/python.sh index b324570..90ae9b9 100755 --- a/python.sh +++ b/python.sh @@ -4,11 +4,20 @@ trap "echo 'error: Script failed: see failed command above'" ERR DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" -# install pip +# install system packages (skip by setting SKIP_APT=1) python3 --version -sudo apt update -sudo apt install -y python3-pip +if [ "${SKIP_APT:-0}" -ne 1 ]; then + sudo apt update + sudo apt install -y python3-pip python3-venv +else + echo "SKIP_APT=1 set; skipping apt install" +fi -# upgrade pip -python3 -m pip install --upgrade pip +# Instead of upgrading the OS-managed pip (PEP 668 prevents this), +# create and use a virtual environment and upgrade pip inside it. +VENVDIR="$DIR/.venv" +python3 -m venv "$VENVDIR" +# shellcheck disable=SC1090 +source "$VENVDIR/bin/activate" +python -m pip install --upgrade pip pip --version From b2aada8e0bff2ad0eb3ada59b13683db4a17873c Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Tue, 13 Jan 2026 10:39:40 +0000 Subject: [PATCH 06/12] Fixed azure-cli --- install-common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-common.sh b/install-common.sh index 034fa06..3fe5d96 100755 --- a/install-common.sh +++ b/install-common.sh @@ -7,6 +7,7 @@ source "$DIR/.lib.sh" sudo apt update -y && sudo apt upgrade -y echo -e "\e[34m»»» 🚀 \e[32mInstalling \e[33m'Common Tools'\e[32m ... \e[39m" +~/tools/azure-cli.sh ~/tools/helm.sh ~/tools/powershell.sh ~/tools/powershell-modules.sh @@ -16,7 +17,6 @@ echo -e "\e[34m»»» 🚀 \e[32mInstalling \e[33m'Common Tools'\e[32m ... \e[39 ~/tools/velero.sh # TO FIX -~/tools/azure-cli.sh # az aks install-cli currently getting blocked ~/tools/kubectl.sh ~/tools/kube-tools.sh # waiting to get kubectl working first ~/tools/misc.sh # are WSL Utilities still required so Azure CLIs can open browser windows for login? From c1fb9e3231ba90313a0aa44a555fe2be6bedeecc Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Tue, 13 Jan 2026 13:45:33 +0000 Subject: [PATCH 07/12] Refactor installation of WSL utilities and clean up comments --- misc.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/misc.sh b/misc.sh index 78a8901..d4939e6 100755 --- a/misc.sh +++ b/misc.sh @@ -3,10 +3,7 @@ set -euo pipefail trap "echo 'error: Script failed: see failed command above'" ERR # Misc system utilities +# wslu is a set of utilities for WSL to improve integration with Windows +# - required so Azure CLIs can open browser windows for login sudo apt-get update -y -sudo apt-get install -y jq pv unzip tree - -# Install WSL Utilities - Azure CLIs can open browser windows for login -# sudo add-apt-repository ppa:wslutilities/wslu -# sudo apt update -# sudo apt install wslu +sudo apt-get install -y jq pv unzip tree wslu From 3b01cb3c354159f860a76354af381d2452eafa42 Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Tue, 13 Jan 2026 14:44:59 +0000 Subject: [PATCH 08/12] Refactor installation scripts: reorder tool installations and fix minor version for kubectl --- install-common.sh | 9 +++------ kubectl.sh | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/install-common.sh b/install-common.sh index 3fe5d96..3f28e56 100755 --- a/install-common.sh +++ b/install-common.sh @@ -9,18 +9,15 @@ sudo apt update -y && sudo apt upgrade -y echo -e "\e[34m»»» 🚀 \e[32mInstalling \e[33m'Common Tools'\e[32m ... \e[39m" ~/tools/azure-cli.sh ~/tools/helm.sh -~/tools/powershell.sh +~/tools/kube-tools.sh +~/tools/misc.sh ~/tools/powershell-modules.sh - +~/tools/powershell.sh ~/tools/terraform-docs.sh ~/tools/terraform.sh ~/tools/velero.sh # TO FIX -~/tools/kubectl.sh -~/tools/kube-tools.sh # waiting to get kubectl working first -~/tools/misc.sh # are WSL Utilities still required so Azure CLIs can open browser windows for login? - ~/tools/python.sh ~/tools/pre-commit.sh ~/tools/python-tools.sh diff --git a/kubectl.sh b/kubectl.sh index d33239e..544a69b 100755 --- a/kubectl.sh +++ b/kubectl.sh @@ -7,7 +7,7 @@ source "$DIR/.lib.sh" # show available versions (only available after adding k8s apt repo): # apt-cache madison kubectl | head -n 30 VERSION="1.33.7-ubuntu24.04u1" -MINOR_VERSION="v1.35" +MINOR_VERSION="v1.33" start "kubectl $VERSION" From accbfcf66672f800f1c1a1f12f052f3efe499ab0 Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Tue, 13 Jan 2026 15:12:24 +0000 Subject: [PATCH 09/12] Add k9s script --- install-common.sh | 1 + k9s.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 k9s.sh diff --git a/install-common.sh b/install-common.sh index 3f28e56..b526e74 100755 --- a/install-common.sh +++ b/install-common.sh @@ -9,6 +9,7 @@ sudo apt update -y && sudo apt upgrade -y echo -e "\e[34m»»» 🚀 \e[32mInstalling \e[33m'Common Tools'\e[32m ... \e[39m" ~/tools/azure-cli.sh ~/tools/helm.sh +~/tools/k9s.sh ~/tools/kube-tools.sh ~/tools/misc.sh ~/tools/powershell-modules.sh diff --git a/k9s.sh b/k9s.sh new file mode 100755 index 0000000..fe63723 --- /dev/null +++ b/k9s.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "echo 'error: Script failed: see failed command above'" ERR +DIR=$(cd "$(dirname "$0")" && pwd) +source "$DIR/.lib.sh" + +# installs k9s https://github.com/derailed/k9s + +# vars +VERSION='0.50.18' +TOOL_NAME='k9s' +DOWNLOAD_URL="https://github.com/derailed/k9s/releases/download/v${VERSION}/k9s_linux_amd64.deb" +DOWNLOAD_DIR=$(mktemp --directory) +DOWNLOAD_PATH="$DOWNLOAD_DIR/k9s.deb" + +# prep +start "$TOOL_NAME" +mkdir -p "$DOWNLOAD_DIR" + +# download +curl --location "$DOWNLOAD_URL" --output "$DOWNLOAD_PATH" + +# install +# sudo dpkg-query -l | grep k9s +# sudo dpkg --remove k9s +sudo dpkg --install "$DOWNLOAD_PATH" + +# cleanup +rm -fr "$DOWNLOAD_DIR" + +# info +end "$TOOL_NAME" 'version' From f252105df8495919feca64454839816ffb6fdaf7 Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Tue, 13 Jan 2026 15:13:48 +0000 Subject: [PATCH 10/12] Update oh-my-posh version to v29.0.2 --- oh-my-posh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-posh.sh b/oh-my-posh.sh index 6b46a52..104a7ed 100755 --- a/oh-my-posh.sh +++ b/oh-my-posh.sh @@ -5,7 +5,7 @@ DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" # https://github.com/JanDeDobbeleer/oh-my-posh3/releases -ver="v29.0.1" +ver="v29.0.2" start "oh-my-posh $ver" From 1548c811725917f95df81012ee8aa084783760d5 Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Tue, 13 Jan 2026 18:06:42 +0000 Subject: [PATCH 11/12] Fixed python issues --- install-common.sh | 9 +++------ pre-commit.sh | 26 -------------------------- python-tools.sh | 19 ++++++------------- python.sh | 17 ++--------------- 4 files changed, 11 insertions(+), 60 deletions(-) delete mode 100755 pre-commit.sh diff --git a/install-common.sh b/install-common.sh index b526e74..52213cf 100755 --- a/install-common.sh +++ b/install-common.sh @@ -12,14 +12,11 @@ echo -e "\e[34m»»» 🚀 \e[32mInstalling \e[33m'Common Tools'\e[32m ... \e[39 ~/tools/k9s.sh ~/tools/kube-tools.sh ~/tools/misc.sh -~/tools/powershell-modules.sh ~/tools/powershell.sh +~/tools/powershell-modules.sh +~/tools/python.sh +~/tools/python-tools.sh ~/tools/terraform-docs.sh ~/tools/terraform.sh ~/tools/velero.sh - -# TO FIX -~/tools/python.sh -~/tools/pre-commit.sh -~/tools/python-tools.sh echo -e "\e[34m»»» 💪 \e[32mFinished Installing \e[33m'Common Tools'\e[32m. \e[39m" diff --git a/pre-commit.sh b/pre-commit.sh deleted file mode 100755 index a7267e7..0000000 --- a/pre-commit.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -trap "echo 'error: Script failed: see failed command above'" ERR -DIR=$(cd "$(dirname "$0")" && pwd) -source "$DIR/.lib.sh" - -# https://pypi.org/project/pre-commit/#history -VERSION='4.5.1' - -start "pre-commit $VERSION" -# Default venv: allow override with PRE_COMMIT_VENV env var -VENV_DIR="${PRE_COMMIT_VENV:-$DIR/.venv}" -if [ ! -d "$VENV_DIR" ]; then - echo "Creating virtualenv at $VENV_DIR" - python3 -m venv "$VENV_DIR" -fi -# activate venv -# shellcheck disable=SC1090 -source "$VENV_DIR/bin/activate" - -# upgrade pip inside venv and install pre-commit there -python -m pip install --upgrade pip -pip --version -pip install --no-input pre-commit==${VERSION} - -end 'pre-commit' '--version' diff --git a/python-tools.sh b/python-tools.sh index f4b9dc0..d8e1591 100755 --- a/python-tools.sh +++ b/python-tools.sh @@ -4,21 +4,14 @@ trap "echo 'error: Script failed: see failed command above'" ERR DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" +# PACKAGE_VERSION='x.x.x' + # https://pypi.org/project/tldr/#history TLDR_VERSION='3.4.3' -# PACKAGE_VERSION='x.x.x' -# Default venv: allow override with PYTHON_TOOLS_VENV env var -VENV_DIR="${PYTHON_TOOLS_VENV:-$DIR/.venv}" -if [ ! -d "$VENV_DIR" ]; then - echo "Creating virtualenv at $VENV_DIR" - python3 -m venv "$VENV_DIR" -fi -# shellcheck disable=SC1090 -source "$VENV_DIR/bin/activate" +# https://pypi.org/project/pre-commit/#history +PRECOMMIT_VERSION='4.5.1' -python -m pip install --upgrade pip -pip --version +python3 -m pip install --break-system-packages --upgrade pip -pip install --no-input \ - tldr==${TLDR_VERSION} +pip3 install --break-system-packages --no-input tldr==${TLDR_VERSION} pre-commit==${PRECOMMIT_VERSION} diff --git a/python.sh b/python.sh index 90ae9b9..7dd04c0 100755 --- a/python.sh +++ b/python.sh @@ -4,20 +4,7 @@ trap "echo 'error: Script failed: see failed command above'" ERR DIR=$(cd "$(dirname "$0")" && pwd) source "$DIR/.lib.sh" -# install system packages (skip by setting SKIP_APT=1) python3 --version -if [ "${SKIP_APT:-0}" -ne 1 ]; then - sudo apt update - sudo apt install -y python3-pip python3-venv -else - echo "SKIP_APT=1 set; skipping apt install" -fi -# Instead of upgrading the OS-managed pip (PEP 668 prevents this), -# create and use a virtual environment and upgrade pip inside it. -VENVDIR="$DIR/.venv" -python3 -m venv "$VENVDIR" -# shellcheck disable=SC1090 -source "$VENVDIR/bin/activate" -python -m pip install --upgrade pip -pip --version +sudo apt update +sudo apt install -y python3-pip python3-venv From 14d6718b82f93e1abc4eb62ae59497f9e070e25b Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Tue, 27 Jan 2026 15:19:57 +0000 Subject: [PATCH 12/12] Update kubectl.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- kubectl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubectl.sh b/kubectl.sh index 544a69b..30050ab 100755 --- a/kubectl.sh +++ b/kubectl.sh @@ -21,7 +21,7 @@ sudo apt-get install -y apt-transport-https ca-certificates curl gnupg # If the folder `/etc/apt/keyrings` does not exist, it should be created before the curl command, read the note below. # sudo mkdir -p -m 755 /etc/apt/keyrings -curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.35/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg +curl -fsSL https://pkgs.k8s.io/core:/stable:/${MINOR_VERSION}/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # allow unprivileged APT programs to read this keyring sudo apt-get update