Skip to content

Commit 1634b86

Browse files
authored
Automate updating the self-hosted artifact tracker's vizier, operator and cli version (#2076)
Summary: Automate updating the self-hosted artifact tracker's vizier, operator and cli version This was previously done manually and from talking with end users in Slack people are often running very old Vizier versions as a result. Let's include updating this file in the same automation that updates the README on releases. Relevant Issues: Closes #1907 Type of change: /kind cleanup Test Plan: Tested the script with the various release types ``` $ ./ci/update_files_with_release_versions.sh vizier 0.14.15 '<!--vizier-latest-release' $ git diff k8s diff --git a/k8s/cloud/public/base/artifact_tracker_versions.yaml b/k8s/cloud/public/base/artifact_tracker_versions.yaml index 69fbcaf..1aa87c7e5 100644 --- a/k8s/cloud/public/base/artifact_tracker_versions.yaml +++ b/k8s/cloud/public/base/artifact_tracker_versions.yaml @@ -12,7 +12,7 @@ spec: - name: artifact-tracker-server env: - name: PL_VIZIER_VERSION - value: "0.14.14" + value: "0.14.15" - name: PL_CLI_VERSION value: "0.8.5" - name: PL_OPERATOR_VERSION # Remove changes $ git checkout -- k8s $ ./ci/update_files_with_release_versions.sh cli 0.14.15 '<!--cli-latest-release' ddelnano@dev-vm:~/code/pixie-extra (ddelnano/update-artifact-versions-on-release) $ git diff k8s/ diff --git a/k8s/cloud/public/base/artifact_tracker_versions.yaml b/k8s/cloud/public/base/artifact_tracker_versions.yaml index 69fbcaf..e0b50ee83 100644 --- a/k8s/cloud/public/base/artifact_tracker_versions.yaml +++ b/k8s/cloud/public/base/artifact_tracker_versions.yaml @@ -14,6 +14,6 @@ spec: - name: PL_VIZIER_VERSION value: "0.14.14" - name: PL_CLI_VERSION - value: "0.8.5" + value: "0.14.15" - name: PL_OPERATOR_VERSION value: "0.1.7" # Remove changes $ git checkout -- k8s $ ./ci/update_files_with_release_versions.sh operator 0.14.15 '<!--operator-latest-release' $ git diff k8s diff --git a/k8s/cloud/public/base/artifact_tracker_versions.yaml b/k8s/cloud/public/base/artifact_tracker_versions.yaml index 69fbcaf..6466f8a4b 100644 --- a/k8s/cloud/public/base/artifact_tracker_versions.yaml +++ b/k8s/cloud/public/base/artifact_tracker_versions.yaml @@ -16,4 +16,4 @@ spec: - name: PL_CLI_VERSION value: "0.8.5" - name: PL_OPERATOR_VERSION - value: "0.1.7" + value: "0.14.15" # Remove changes and verify cloud release results in no changes $ git checkout -- k8s/ $ ./ci/update_files_with_release_versions.sh cloud 0.14.15 '<!--cloud-latest-release' $ git diff k8s/ ``` Changelog Message: Add automation to ensure self-hosted Cloud deployments receive updated vizier, operator and cli version manifests --------- Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent a63b134 commit 1634b86

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

.github/workflows/release_update_readme.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: |
4545
export COMPONENT="$(echo "${TAG_NAME}" | cut -d'/' -f2)"
4646
export VERSION="$(echo "${TAG_NAME}" | cut -d'/' -f3)"
47-
./ci/update_readme_with_latest_release.sh "${COMPONENT}" "${VERSION}" "${URL}"
47+
./ci/update_files_with_release_versions.sh "${COMPONENT}" "${VERSION}" "${URL}"
4848
- name: Create PR
4949
shell: bash
5050
env:
@@ -56,6 +56,7 @@ jobs:
5656
export BRANCH="${VERSION}-update-readme"
5757
git checkout -b "${BRANCH}"
5858
git add README.md
59+
git add k8s/cloud/public/base/artifact_tracker_versions.yaml
5960
git commit -s -m "$(cat pr_title)"
6061
git push -f fork "${BRANCH}"
6162
gh pr create --repo pixie-io/pixie \

.yamllint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ rules:
99
max: 120
1010
truthy:
1111
check-keys: false
12+
comments:
13+
min-spaces-from-content: 1
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ version="$2"
2929
url="$3"
3030

3131
readme_path="README.md"
32+
at_versions_path="k8s/cloud/public/base/artifact_tracker_versions.yaml"
3233

3334
latest_release_comment="<!--${artifact_type}-latest-release-->"
3435

@@ -45,6 +46,11 @@ latest_release_line() {
4546
echo "- [$(pretty_artifact_name) ${version}](${url})${latest_release_comment}"
4647
}
4748

49+
# environment variable is uppercased
50+
artifact_tracker_env_name="PL_${artifact_type^^}_VERSION"
51+
52+
yq -i ".spec.template.spec.containers[] |= select(.name == \"artifact-tracker-server\").env[] |= select(.name == \"${artifact_tracker_env_name}\").value = \"${version}\"" "${at_versions_path}"
53+
4854
sed -i 's|.*'"${latest_release_comment}"'.*|'"$(latest_release_line)"'|' "${readme_path}"
4955

5056
echo "[bot][releases] Update readme with link to latest ${artifact_type} release." > pr_title
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# autogenerated do not edit manually
12
---
23
apiVersion: apps/v1
34
kind: Deployment
@@ -7,11 +8,11 @@ spec:
78
template:
89
spec:
910
containers:
10-
- name: artifact-tracker-server
11-
env:
12-
- name: PL_VIZIER_VERSION
13-
value: "0.14.14"
14-
- name: PL_CLI_VERSION
15-
value: "0.8.5"
16-
- name: PL_OPERATOR_VERSION
17-
value: "0.1.7"
11+
- name: artifact-tracker-server # yamllint disable rule:indentation
12+
env:
13+
- name: PL_VIZIER_VERSION
14+
value: "0.14.14"
15+
- name: PL_CLI_VERSION
16+
value: "0.8.5"
17+
- name: PL_OPERATOR_VERSION
18+
value: "0.1.7"

0 commit comments

Comments
 (0)