-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(from b67d356)
- Loading branch information
Showing
16 changed files
with
325 additions
and
49 deletions.
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,42 @@ | ||
""" | ||
This script generates the releaser configuration file for the following `Run chart-releaser` step. | ||
Releases are separated into two categories: beta and stable. | ||
Beta releases are created from branches with name pattern <version>-beta | ||
Stable releases are created from branches with a valid version number (e.g. `1.0.0`). | ||
""" | ||
import os | ||
import re | ||
import sys | ||
from pathlib import Path | ||
import fileinput | ||
|
||
ROOT = Path.cwd() | ||
BRANCH = os.environ["GITHUB_REF_NAME"] | ||
SHA = os.environ["GITHUB_SHA"][:7] | ||
VERSION = ROOT.joinpath("version.txt").read_text().strip().lstrip("v") | ||
CHART = ROOT / "charts" / "vastcsi" / "Chart.yaml" | ||
|
||
if __name__ == '__main__': | ||
if not re.search('[0-9]+\.[0-9]+\.?[0-9]*', BRANCH): | ||
sys.stderr.write( | ||
f"Branch name must contain a valid version number. " | ||
f"Got: {BRANCH}. Skipping release...\n" | ||
) | ||
sys.exit(0) | ||
is_beta = "beta" in BRANCH | ||
|
||
release_name_template = "helm-{{ .Version }}" | ||
pages_branch = "gh-pages-beta" if is_beta else "gh-pages" | ||
version = f"{VERSION}-beta.{SHA}" if is_beta else VERSION | ||
|
||
# Create unique release name based on version and commit sha | ||
for line in fileinput.input(CHART, inplace=True): | ||
if line.startswith("version:"): | ||
line = line.replace(line, f"version: {version}\n") | ||
sys.stdout.write(line) | ||
|
||
ROOT.joinpath("releaser-config.yml").open("w").write( | ||
f""" | ||
pages-branch: {pages_branch} | ||
release-name-template: {release_name_template} | ||
""") |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
name: Release Charts | ||
|
||
on: | ||
push: | ||
branches: | ||
- v2.2 | ||
on: [push] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
|
@@ -14,12 +14,20 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Prepare releaser configuration | ||
run: | | ||
python .github/workflows/prepare_releaser_configuration.py | ||
- name: Configure Git | ||
if: ${{ hashFiles('releaser-config.yml') != '' }} | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
if: ${{ hashFiles('releaser-config.yml') != '' }} | ||
uses: helm/[email protected] | ||
with: | ||
config: releaser-config.yml | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
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
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,49 @@ | ||
# Install CSI driver with Helm 3 | ||
|
||
## Prerequisites | ||
- [install Helm](https://helm.sh/docs/intro/quickstart/#install-helm) | ||
|
||
|
||
### install production version of the driver: | ||
```console | ||
helm repo add vastcsi https://vast-data.github.io/vast-csi | ||
helm install csi-driver vastcsi/vast-csi -f values.yaml -n vast-csi --create-namespace | ||
``` | ||
|
||
### install beta version of the driver: | ||
```console | ||
helm repo add vastcsi https://raw.githubusercontent.com/vast-data/vast-csi/gh_pages_beta | ||
helm install csi-driver vastcsi/vast-csi -f values.yaml -n vast-csi --create-namespace | ||
``` | ||
|
||
> **NOTE:** Optionally modify values.yaml or set overrides via Helm command line | ||
|
||
### install a specific version | ||
```console | ||
helm install csi-driver vastcsi/vast-csi -f values.yaml -n vast-csi --create-namespace --version 2.3.0 | ||
``` | ||
|
||
### Upgrade driver | ||
```console | ||
helm upgrade csi-driver vastcsi/vast-csi -f values.yaml -n vast-csi | ||
``` | ||
|
||
### Upgrade helm repository | ||
```console | ||
helm repo update vastcsi | ||
``` | ||
|
||
### Uninstall driver | ||
```console | ||
helm uninstall csi-driver -n vast-csi | ||
``` | ||
|
||
### search for all available chart versions | ||
```console | ||
helm search repo -l vastcsi | ||
``` | ||
|
||
### troubleshooting | ||
- Add `--wait -v=5 --debug` in `helm install` command to get detailed error | ||
- Use `kubectl describe` to acquire more info |
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,14 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: csi-pvc-clone | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
storageClassName: vastdata-filesystem | ||
resources: | ||
requests: | ||
storage: 2Gi | ||
dataSource: | ||
kind: PersistentVolumeClaim | ||
name: csi-pvc |
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
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
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
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
Oops, something went wrong.