Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store supported grafana versions in file #594

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions docs/releasing-grafana-foundation-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,20 @@ As such, it's options and behavior are identical to what was described previousl
DRY_RUN=no ./scripts/release-all.sh
```

> [!NOTE]
> A list of all supported Grafana versions can be found in `./scripts/versions.sh`.

## Releasing a specific Grafana version

Start a dry-run release for the desired version of the schemas:

```console
./scripts/release-version.sh "next;v11.2.x;v11.1.x;v11.0.x;v10.4.x;v10.3.x;v10.2.x;v10.1.x" v10.2.x
./scripts/release-version.sh v10.2.x
```

This will perform the release process without pushing any change to give a safe opportunity to review the release.
Details on where to find the generated code and inspect it will be written to the standard output.

> [!NOTE]
> To generate accurate READMEs, a list of all supported Grafana versions needs to be given to the script.
> An accurate list can be found in the `./scripts/release-all.sh` file.

If everything looks good, proceed for real:

```console
Expand Down
2 changes: 1 addition & 1 deletion internal/codegen/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Output struct {
// ```
// package_templates
// ├── go
// │ ├── LICENSE.md
// │ ├── LICENSE
// │ └── README.md
// └── typescript
// ├── babel.config.json
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions scripts/release-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ normal=$(tput sgr0)

__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${__dir}/libs/logs.sh"
source "${__dir}/versions.sh"

versions="next;v11.2.x;v11.1.x;v11.0.x;v10.4.x;v10.3.x;v10.2.x;v10.1.x"

for version in ${versions//;/ } ; do
for version in ${ALL_GRAFANA_VERSIONS//;/ } ; do
info "🪧 Releasing ${bold}${version}${normal}"
$__dir/release-version.sh "${versions}" "${version}"
$__dir/release-version.sh "${version}"
done
4 changes: 2 additions & 2 deletions scripts/release-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ set -o pipefail
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${__dir}/libs/logs.sh"
source "${__dir}/libs/git.sh"
source "${__dir}/versions.sh"

# These environment variables can be used to alter the behavior of the release script.

DRY_RUN=${DRY_RUN:-"yes"} # Some kind of fail-safe to ensure that we're only pushing something when we mean it.

ALL_GRAFANA_VERSIONS=${1:-"next"} # all the versions for which we do releases (";"-separated list).
GRAFANA_VERSION=${2:-"next"} # version of the schemas/grafana to run the codegen for.
GRAFANA_VERSION=${1:-"next"} # version of the schemas/grafana to run the codegen for.
COG_VERSION="v0.0.x" # hardcoded for now

COG_CMD=${COG_CMD:-"go run ./cmd/cli"} # Command used to run `cog`
Expand Down
3 changes: 3 additions & 0 deletions scripts/versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

ALL_GRAFANA_VERSIONS="next;v11.2.x;v11.1.x;v11.0.x;v10.4.x;v10.3.x;v10.2.x;v10.1.x"
Loading