Skip to content

Commit

Permalink
feat: add redis operator helm chart and release workflow (#941)
Browse files Browse the repository at this point in the history
* copy operator chart from helm-charts repo

Signed-off-by: drivebyer <wuyangmuc@gmail.com>

* add chart release workflow

Signed-off-by: drivebyer <yang.wu@daocloud.io>

* change operator image

Signed-off-by: drivebyer <yang.wu@daocloud.io>

---------

Signed-off-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: drivebyer <yang.wu@daocloud.io>
  • Loading branch information
drivebyer committed May 27, 2024
1 parent e021986 commit 8ba7390
Show file tree
Hide file tree
Showing 18 changed files with 32,231 additions and 1 deletion.
97 changes: 97 additions & 0 deletions .github/workflows/publish-charts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Release Charts

on:
push:
tags:
- "v*.*.*"

jobs:
release-charts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: "${{ github.repository_owner }}/redis-operator"
path: "redis-operator"
fetch-depth: 0

- name: Checkout helm-charts
uses: actions/checkout@v3
with:
repository: "${{ github.repository_owner }}/helm-charts"
# use token for helm-charts repo
token: "${{ secrets.HELM_CHARTER_TOKEN }}"
path: "helm-charts"
fetch-depth: 0

- name: Get chart version
run: |
echo "chart_version=$(echo ${GITHUB_REF##*/v})" >> $GITHUB_ENV
- name: Install Helm
uses: azure/setup-helm@v4.2.0

- name: Make charts
shell: bash
working-directory: redis-operator
run: |
VERSION=$(echo ${{ env.chart_version }} | cut -c 2-)
sed -i "s/appVersion:.*/appVersion: \"$VERSION\"/g" charts/redis-operator/Chart.yaml
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm dependency update charts/redis-operator
helm package charts/redis-operator -d .cr-release-packages
- name: Install chart-releaser
uses: helm/chart-releaser-action@v1.5.0
with:
install_only: true

# upload charts to helm-charts repos's release
- name: Upload charts
shell: bash
working-directory: redis-operator
run: |
cr upload
env:
# GitHub repository
CR_GIT_REPO: "helm-charts"
# Path to directory with chart packages (default ".cr-release-packages")
CR_PACKAGE_PATH: ".cr-release-packages"
# use token for helm-charts repo
CR_TOKEN: "${{ secrets.HELM_CHARTER_TOKEN }}"
# owner
CR_OWNER: "${{ github.repository_owner }}"
# skip existing charts
CR_SKIP_EXISTING: "true"

# copy artifacts to helm-charts repo, we need those for update index
- name: Copy artifacts
run: |
cp -r redis-operator/.cr-release-packages helm-charts/
- name: Configure Git
working-directory: helm-charts
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
# this step will directly push to the main branch, so make sure you have the right permissions
- name: Update index
working-directory: helm-charts
run: |
cr index --push
env:
# GitHub repository
CR_GIT_REPO: "helm-charts"
# The GitHub pages branch (default "gh-pages")
CR_PAGES_BRANCH: "gh-pages"
# Path to directory with chart packages (default ".cr-release-packages")
CR_PACKAGE_PATH: ".cr-release-packages"
# use token for helm-charts repo
CR_TOKEN: "${{ secrets.HELM_CHARTER_TOKEN }}"
# owner
CR_OWNER: "${{ github.repository_owner }}"
# index path
CR_INDEX_PATH: "index.yaml"
1 change: 0 additions & 1 deletion .github/workflows/publish-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ env:
jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions charts/redis-operator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tgz
6 changes: 6 additions & 0 deletions charts/redis-operator/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: cert-manager
repository: https://charts.jetstack.io
version: v1.12.4
digest: sha256:026d03c56e2f8369b0f7d79f9560d5a33b2c5ae8a7d751213e56e2a0176cb874
generated: "2023-10-02T14:14:45.164829041+05:30"
28 changes: 28 additions & 0 deletions charts/redis-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
apiVersion: v2
version: 0.15.9
appVersion: "0.15.1"
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
engine: gotpl
maintainers:
- name: iamabhishek-dubey
- name: sandy724
- name: shubham-cmyk
name: redis-operator
sources:
- https://github.com/OT-CONTAINER-KIT/redis-operator
home: https://github.com/OT-CONTAINER-KIT/redis-operator
icon: https://github.com/OT-CONTAINER-KIT/redis-operator/raw/master/static/redis-operator-logo.svg
keywords:
- operator
- redis
- opstree
- kubernetes
- openshift

dependencies:
- name: cert-manager
version: v1.12.4
repository: https://charts.jetstack.io
alias: certmanager
condition: certmanager.enabled
Loading

0 comments on commit 8ba7390

Please sign in to comment.