Skip to content

Commit

Permalink
chore: update README.md and add gh workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
nashtsai committed May 6, 2023
1 parent ac4d43d commit b33e600
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
ADDON DEVELOPERS: If you are submitting a new addon
- Make sure you read the Addon Naming Guide:
- Verify you can install your addon locally: kbcli builder addon validate <ADDON_MANIFEST>
`kbcli` PLUGIN DEVELOPERS: If you are submitting a new `kbcli` plugin
- Make sure you read the CLIPlugin Naming Guide:
- Verify you can install your addon locally: kbcli builder plugin validate <ADDON_MANIFEST>
`krew` compatible PLUGIN DEVELOPERS: If you are submitting a new `krew` compatible plugin
- Make sure you read the Plugin Naming Guide:
- Verify you can install your addon locally: kubectl krew install --manifest=[...] --archive=[...]
-->
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: block-index CI

on:
push:
branches:
- main
pull_request:

jobs:
build:
name: Validate krew plugin manifests
runs-on: ubuntu-latest
env:
KREW_VERSION: v0.4.3
GO111MODULE: on
steps:

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.20'
id: go

- name: Go module cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.KREW_VERSION }}
restore-keys: |
${{ runner.os }}-go-
- name: Check out PR branch
uses: actions/checkout@v3
with:
fetch-depth: 0 # disable shallow clones

- name: Fetch base branch
if: github.event_name == 'pull_request'
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF}
- name: Install kubectl
run: |
set -euo pipefail
sudo curl -fsSL -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.26.3/bin/linux/amd64/kubectl
sudo chmod +x /usr/bin/kubectl
- name: Install krew
run: |
set -euo pipefail
cd "$(mktemp -d)"
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/${KREW_VERSION}/krew.yaml"
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/${KREW_VERSION}/krew-linux_amd64.tar.gz"
tar zxvf krew-linux_amd64.tar.gz
./krew-linux_amd64 install --manifest=krew.yaml --archive=krew-linux_amd64.tar.gz
- name: Install validate-krew-manifest plugin
run : |
set -euo pipefail
export GOBIN=$HOME/bin
go get sigs.k8s.io/krew/cmd/validate-krew-manifest@${KREW_VERSION}
- name: Validate updated krew plugin manifests
if: github.event_name == 'pull_request'
run : |
set -x
set -euo pipefail
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
git diff --name-only --diff-filter=AM origin/${GITHUB_BASE_REF} ${{ github.sha }} -- plugins/ |
tee /dev/stderr |
xargs -I _ $HOME/bin/validate-krew-manifest -manifest _
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# block-index
KubeBlocks extensions "Blocks" registry index repository
This is KubeBlocks' Addon and Plugin extensions index repository. It is meant to be useful only for extensions developers.

## Submitting new extensions

To learn how to create an `Addon` or `Plugin` extension and submit it to `block-index`, read the [Developer Guide][dev-guide]
and make a pull request to this repository.


## The `block-index` file and directory structure

```bash
addons/ # A directory containing `addons.extensions.kubeblocks.io` manifests.
plugins/ # A directory containing `cliplugins.extensions.kubeblocks.io` manifests.
krew-plugins/ # A directory containing `plugins.krew.googlecontainertools.github.com` manifests.
```
Empty file added addons/.gitkeep
Empty file.
Empty file added krew-plugins/.gitkeep
Empty file.
Empty file added plugins/.gitkeep
Empty file.

0 comments on commit b33e600

Please sign in to comment.