Skip to content

Commit

Permalink
feat: add oteldb 0.2.0@8b3ae3ab73fdadde6e061830fd4209584d1d9038
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr Razumov <ernado@go-faster.org>
  • Loading branch information
ernado committed Feb 11, 2024
1 parent 71c5f4d commit 09b0e52
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# charts [![Go Reference](https://img.shields.io/badge/go-pkg-00ADD8)](https://pkg.go.dev/github.com/go-faster/charts#section-documentation) [![codecov](https://img.shields.io/codecov/c/github/go-faster/charts?label=cover)](https://codecov.io/gh/go-faster/charts) [![experimental](https://img.shields.io/badge/-experimental-blueviolet)](https://go-faster.org/docs/projects/status#experimental)
This repository holds helm templates for the following oteldb releases:

Work in progress.
* [v0.2.0](https://github.com/go-faster/oteldb/releases/tag/v0.2.0) (_[source](https://github.com/go-faster/oteldb/tree/v0.2.0/install/kubernetes/oteldb)_)
2 changes: 0 additions & 2 deletions charts.go

This file was deleted.

22 changes: 22 additions & 0 deletions fix_dates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -eo pipefail

linesWithDate=($(git blame index.yaml --date=iso-strict \
| awk '/created/ { print $5; }' \
| sed 's/)$//'))

# Lines with the date were overwritten. Take an adjacent line for real date.
dates=($(git blame index.yaml --date=iso-strict \
| grep -A 1 created \
| grep -v created \
| awk '{ print $4 }'))

for i in ${!linesWithDate[@]}; do
if ! date --date ${dates[$i]} >/dev/null; then
>&2 echo "unclean git tree, stash all changes before running this script."
exit 1
fi

sed -i "${linesWithDate[$i]}s/\"[^\"]*\"/\"${dates[$i]}\"/" index.yaml
done
33 changes: 33 additions & 0 deletions generate_readme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -e

cat << EOF
This repository holds helm templates for the following Cilium releases:
EOF

for version in $(find -- * -name 'cilium-*.tgz' ! -name "*dev*" | cut -d - -f 2- | cut -d . -f -3 | sed '/-/!{s/$/_/}' | sort -Vr | sed 's/_$//'); do
echo "* [v$version](https://github.com/go-faster/cilium/releases/tag/v$version) (_[source](https://github.com/go-faster/cilium/tree/v$version/install/kubernetes/cilium)_)"
done

cat << EOF
This repository holds helm templates for the following Tetragon releases:
EOF

for version in $(find -- * -name 'tetragon-*.tgz' ! -name "*dev*" | cut -d - -f 2- | cut -d . -f -3 | sed '/-/!{s/$/_/}' | sort -Vr | sed 's/_$//'); do
echo "* [v$version](https://github.com/go-faster/tetragon/releases/tag/v$version) (_[source](https://github.com/go-faster/tetragon/tree/v$version/install/kubernetes)_)"
done

cat << EOF
The following Cilium development releases pull the latest backports for the corresponding branch:
EOF

for version in $(find -- * -name 'cilium-*-dev.tgz' | cut -d - -f 2 | sort -Vr ); do
echo "* [v$version-dev](https://github.com/go-faster/cilium/tree/v$version) (_[source](https://github.com/go-faster/cilium/tree/v$version/install/kubernetes/cilium)_)"
done

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/go-faster/charts
module github.com/cilium/charts

go 1.20
go 1.17
6 changes: 0 additions & 6 deletions go.test.sh

This file was deleted.

13 changes: 13 additions & 0 deletions helm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium

package helm

import (
"embed"
)

var (
//go:embed *.tgz
HelmFS embed.FS
)
14 changes: 14 additions & 0 deletions index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
entries:
oteldb:
- apiVersion: v2
appVersion: v0.6.1
created: "2024-02-11T14:58:52+03:00"
description: A Helm chart for oteldb
digest: 48f80960b8b35f22f45072f67950f3c267e03451da6c1ae02c1e2b2862e8fe16
name: oteldb
type: application
urls:
- oteldb-0.2.0.tgz
version: 0.2.0
generated: "2024-02-11T14:58:52.381040763+03:00"
Binary file added oteldb-0.2.0.tgz
Binary file not shown.
30 changes: 30 additions & 0 deletions prepare_artifacts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

CWD=$(dirname $(readlink -ne $BASH_SOURCE))

set -e

OTELDB_DIR=$1
if [ $# -lt 1 ] || [ ! -d "$OTELDB_DIR" ]; then
echo "usage: $0 </path/to/oteldb/repository>" 1>&2
exit 1
fi

if [ ! -e "$OTELDB_DIR/helm/oteldb/values.yaml" ]; then
echo "Did you specify a oteldb repository path correctly?"
echo "command: $0 $1"
exit 1
fi

CHART_PATH="$OTELDB_DIR/helm/oteldb/Chart.yaml"
VERSION="$(awk '/version:/ { print $2; exit; } ' "$CHART_PATH")"
cd "$OTELDB_DIR/helm/oteldb"
helm package --destination "$CWD" oteldb
cd -
helm repo index . --merge index.yaml
./generate_readme.sh > README.md
git add README.md index.yaml "oteldb-$VERSION.tgz"
git commit -s -m "feat: add oteldb $VERSION@$(cd "$OTELDB_DIR"; git rev-parse HEAD)"
./fix_dates.sh
git add index.yaml
git commit --amend --no-edit

0 comments on commit 09b0e52

Please sign in to comment.