-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts: add operator-core FB mapping (#231)
Signed-off-by: Patrick Stephens <[email protected]>
- Loading branch information
1 parent
ac83f79
commit 7afd9d1
Showing
3 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"v2.0.21": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.11.1", | ||
"v2.0.20": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.11.1", | ||
"v2.0.19": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.11.1", | ||
"v2.0.18": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.3", | ||
"v2.0.17": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.3", | ||
"v2.0.16": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.3", | ||
"v2.0.15": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.3", | ||
"v2.0.13": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.2", | ||
"v2.0.12": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.2", | ||
"v2.0.11": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.2", | ||
"v2.0.10": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.2", | ||
"v2.0.9": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.2", | ||
"v2.0.8": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.2", | ||
"v2.0.7": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.10.1", | ||
"v2.0.6": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.9.9", | ||
"v2.0.5": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.9.9", | ||
"v2.0.4": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.9.9", | ||
"v2.0.3": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.9.9", | ||
"v2.0.2": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.9.8", | ||
"v2.0.1": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.9.8", | ||
"v2.0.0": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.9.7", | ||
"v1.1.4": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.9.7", | ||
"v1.1.3": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.9.7", | ||
"v1.1.2": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.9.1", | ||
"v1.1.1": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.8.9", | ||
"v1.1.0": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.8.9", | ||
"v1.0.15": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.8.5", | ||
"v1.0.14": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.8.2", | ||
"v1.0.13": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.8.1", | ||
"v1.0.12": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.7.5", | ||
"latest": "ghcr.io/calyptia/core/calyptia-fluent-bit:23.11.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
set -u | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
# Used to authenticate with gh api CLI | ||
export GH_TOKEN=${GITHUB_TOKEN:?} | ||
OPERATOR_REPO=${OPERATOR_REPO:-calyptia/core-operator-releases} | ||
SCHEMA_FILENAME=${SCHEMA_FILENAME:-$SCRIPT_DIR/../operator/core-fluent-bit-default-versions.json} | ||
|
||
TAGS=$(gh api \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/"${OPERATOR_REPO}"/releases --jq '.[].tag_name') | ||
|
||
rm -fv "$SCHEMA_FILENAME" | ||
echo '{' > "$SCHEMA_FILENAME" | ||
|
||
for TAG in $TAGS; do | ||
echo "Operator release: $TAG" | ||
# mkdir -p "${SCHEMA_DIR}/${TAG}" | ||
# Grab the manifest for each release | ||
MANIFEST_URL=$(gh api \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/"${OPERATOR_REPO}"/releases/tags/"${TAG}" --jq '.assets[]|select(.name == "manifest.yaml")|.browser_download_url') | ||
echo "manifest.yaml: $MANIFEST_URL" | ||
|
||
# Select the CRD for pipelines then extract the image field from that | ||
CORE_FLUENT_BIT_VERSION=$(curl -sSfL "$MANIFEST_URL" | yq 'select(.kind == "CustomResourceDefinition")| select(.metadata.name == "pipelines.core.calyptia.com")|.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.image.default') | ||
|
||
echo "$TAG : $CORE_FLUENT_BIT_VERSION" | ||
echo "\"$TAG\": \"$CORE_FLUENT_BIT_VERSION\"," >> "$SCHEMA_FILENAME" | ||
done | ||
|
||
# Add latest at end to close off the object fields - no need to cope with commas not at end of last entry then | ||
MANIFEST_URL=$(gh api \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/"${OPERATOR_REPO}"/releases/latest --jq '.assets[]|select(.name == "manifest.yaml")|.browser_download_url') | ||
echo "manifest.yaml: $MANIFEST_URL" | ||
|
||
CORE_FLUENT_BIT_VERSION=$(curl -sSfL "$MANIFEST_URL" | yq 'select(.kind == "CustomResourceDefinition")| select(.metadata.name == "pipelines.core.calyptia.com")|.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.image.default') | ||
echo "\"latest\": \"$CORE_FLUENT_BIT_VERSION\"" >> "$SCHEMA_FILENAME" | ||
|
||
echo '}' >> "$SCHEMA_FILENAME" |