dev: support pining image tags by release version
Created by: michaellzc
Dependency of https://github.com/sourcegraph/sourcegraph/pull/31141, a new flag -pin-tag
is added to specific the target sg release or arbitrary tag (e.g., insiders
).
Test plan
Helm
clone helm chart repo somewhere
git clone https://github.com/sourcegraph/deploy-sourcegraph-helm ~/Code/sourcegraph/deploy-sourcegraph-helm
Switch to sg
directory
cd dev/sg
go run . ops update-images -kind helm -pin-tag 3.36.3 ~/Code/sourcegraph/deploy-sourcegraph-helm/charts/sourcegraph/.
Inspect the content of ~/Code/sourcegraph/deploy-sourcegraph-helm/charts/sourcegraph/values.yaml, all defaultTag should be replaced with the latest image tag+digest.
K8S (kustomize)
clone deploy-sourcegraph repo somewhere
git clone https://github.com/sourcegraph/deploy-sourcegraph ~/Code/sourcegraph/deploy-sourcegraph
Switch to sg
directory
cd dev/sg
go run . ops update-images -kind k8s -pin-tag 3.36.3 ~/Code/sourcegraph/deploy-sourcegraph/base/.
All resources in base/*
should have their images tags updated