Skip to content

Commit

Permalink
Merge pull request #3 from shakahl/feature/helm-chart-hasura-graphql-…
Browse files Browse the repository at this point in the history
…engine

[hasura-graphql-engine] Feature/helm chart hasura graphql engine
  • Loading branch information
shakahl authored Dec 9, 2020
2 parents d67026f + 44df811 commit 2393760
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 54 deletions.
13 changes: 7 additions & 6 deletions .github/.ct.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# See https://github.com/helm/chart-testing#configuration
remote: origin
target-branch: master
remote: 'origin'
target-branch: 'master'
chart-dirs:
- charts
- './charts'
chart-repos:
- stable=https://charts.helm.sh/stable
- shakahl=https://shakahl.github.io/helm-charts
helm-extra-args: --timeout 600s
- 'stable=https://charts.helm.sh/stable'
# - shakahl=https://shakahl.github.io/helm-charts
helm-extra-args: '--timeout 600s'
excluded-charts: []
check-version-increment: false
59 changes: 42 additions & 17 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,75 @@
name: Lint and Test Charts

on: pull_request
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: ['*', '!master', '!main', '!gh-pages']
pull_request:
branches: ['*', '!master', '!main', '!gh-pages']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
GITHUB_TOKEN: '${{ secrets.SECRET_GITHUB_TOKEN }}'

jobs:
lint-test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

# with:
# fetch-depth: 0
- name: Fetch history
run: git fetch --prune # --unshallow
run: |
git fetch --prune --unshallow || echo "Unable to do git fetch --prune --unshallow ..."
git fetch --prune || echo "Unable to do git fetch --prune ..."
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
# - name: Install ACT deps
# if: ${{ !env.ACT }}
# run: |
# /bin/sh -c "ls"
git config user.name "$GITHUB_ACTOR" || echo "Unable to set git config user.name ..."
git config user.email "[email protected]" || echo "Unable to set git config user.email ..."
- name: Set up Helm
uses: azure/setup-helm@v1
id: install
# See https://github.com/helm/chart-releaser-action/issues/6
- name: Install Helm
run: |
curl -fsSLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- uses: actions/setup-python@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
token: '${{ secrets.SECRET_GITHUB_TOKEN }}'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - uses: actions/setup-python@v2
# with:
# token: '${{ secrets.SECRET_GITHUB_TOKEN }}'
# python-version: '3.8' # ${{ matrix.python-version }}
# # architecture: 'x64'

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
changed=$(ct list-changed --config .github/.ct.yaml )
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint
run: ct lint --config .github/.ct.yaml
# - name: Create kind cluster
# uses: helm/[email protected]
# if: steps.list-changed.outputs.changed == 'true'
Expand Down
39 changes: 26 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,34 @@ on:
push:
branches:
- master
- main
paths:
- '.github/workflows/release.yaml'
- '**/Chart.yaml'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
GITHUB_TOKEN: '${{ secrets.SECRET_GITHUB_TOKEN }}'
CR_TOKEN: '${{ secrets.SECRET_GITHUB_TOKEN }}'

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

# - name: Install local dependencies for "act"
# if: ${{ !env.ACT }}
# run: |
# /bin/sh -c "ls"

- name: Fetch history
run: git fetch --prune # --unshallow
run: |
git fetch --prune --unshallow || echo "Unable to do git fetch --prune --unshallow ..."
git fetch --prune || echo "Unable to do git fetch --prune ..."
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
# - name: Set up Helm
# uses: azure/setup-helm@v1
# id: install
git config user.name "$GITHUB_ACTOR" || echo "Unable to set git config user.name ..."
git config user.email "[email protected]" || echo "Unable to set git config user.email ..."
# See https://github.com/helm/chart-releaser-action/issues/6
- name: Install Helm
Expand All @@ -39,10 +40,22 @@ jobs:
chmod 700 get_helm.sh
./get_helm.sh
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
token: '${{ secrets.SECRET_GITHUB_TOKEN }}'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Add dependency chart repos
run: |
helm repo add stable https://charts.helm.sh/stable/
helm repo add shakahl https://shakahl.github.io/helm-charts/
# helm repo add shakahl https://shakahl.github.io/helm-charts/
- name: Run chart-releaser
uses: helm/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion charts/hasura-graphql-engine/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@
.project
.idea/
*.tmproj
.vscode/
# helm/charts
OWNERS
hasura-graphql-engine-*.tgz
12 changes: 9 additions & 3 deletions charts/hasura-graphql-engine/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v2

name: hasura-graphql-engine

icon: https://raw.githubusercontent.com/hasura/graphql-engine/master/assets/brand/hasura_icon_blue.svg

description: Hasura is an instant GraphQL with built-in authorization for your data.

keywords:
Expand All @@ -13,20 +15,24 @@ keywords:
- microservice
- distributed
- api
- framework

engine: gotpl

type: application

version: 0.0.1

appVersion: "v1.0.0"

kubeVersion: ">=1.16.0-0"

home: https://github.com/hasura/graphql-engine

sources:
- https://github.com/shakahl/helm-charts/charts/hasura-graphql-engine/
- https://github.com/shakahl/helm-charts/
- https://github.com/hasura/graphql-engine

maintainers:
- name: shakahl
email: [email protected]

engine: gotpl
37 changes: 23 additions & 14 deletions charts/hasura-graphql-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@ The Hasura GraphQL Engine Helm chart uses the [Helm](https://helm.sh) package ma

## Prerequisites

- Helm v2 or later
- Kubernetes 1.4+
- Helm v3+
- Kubernetes 1.16+
- PostgreSQL database (11+)

## Get Repo Info

```console
helm repo add shakahl https://shakahl.github.io/helm-charts/
helm repo add stable https://charts.helm.sh/stable/
helm repo update
```

_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._

## Install the chart

1. Add the Helm repository:
Expand Down Expand Up @@ -112,7 +122,7 @@ The following table lists configurable parameters, their descriptions, and their
| hpa.targetCPUUtilizationPercentage | | 80 |
| podDisruptionBudget.enabled | | false |
| podDisruptionBudget.maxUnavailable | | 1 |
| hasura.graphql.* | | {} |
| hasura.env.* | | {} |
| hasura.serverOptions.* | | {} |
| hasura.envPrefix | | `HASURA_GRAPHQL_` |
| hasura.config.* | See [config options](#hasura-config-options) | {} |
Expand Down Expand Up @@ -150,19 +160,18 @@ For information about running **Hasura GraphQL Engine** in Docker, see the [full
# Hasura graphql-engine configuration
hasura:
# graphql:
# # PostgreSQL database DSN
# database_url: "postgres://username:password@hostname:port/dbname"
# # Enables the web console
# enable_console: "true"
# # Enabled log types
# enabled_log_types: "startup, http-log, webhook-log, websocket-log, query-log"
# admin:
# secret: ""
env:
- name: HASURA_GRAPHQL_DATABASE_URL
value: "postgres://username:password@hostname:port/dbname"
- name: HASURA_GRAPHQL_ENABLE_CONSOLE
value: "false"
- name: HASURA_GRAPHQL_ENABLE_LOG_TYPES
value: "startup, http-log, webhook-log, websocket-log, query-log"
- name: HASURA_GRAPHQL_ADMIN_SECRET
value: ""
serverOptions: {}
#- name: HASURA_GRAPHQL_ADMIN_SECRET
# value: "{{ .Values.hasura.graphql.admin.secret }}"
envPrefix: "HASURA_GRAPHQL_"
Expand Down

0 comments on commit 2393760

Please sign in to comment.