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

GitHub Action workflow to validate changes to Helm chart #1882

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Simplified init container and other changes based on code review sugg…
…estions.

Signed-off-by: Kevin Mellott <[email protected]>
Co-authored-by: Kevin Mellott <[email protected]>
  • Loading branch information
Kevin Mellott and KevinMellott91 committed Mar 2, 2022
commit 86b04998b4be6f5e6389f8ab6d44ebd3989bf0ee
2 changes: 0 additions & 2 deletions .actrc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint and Test Chart
name: test-chart

on:
pull_request:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.swp
./**/*.class
./out/*
.actrc
.DS_Store
.classpath
.editorconfig
Expand Down
14 changes: 12 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,23 @@ To setup the git hook scripts run:
$ pre-commit install
```

# GitHub Actions
# `.github/workflows`

Each Pull Request executes a series of quality checks, mostly relying upon CircleCI for validation. However, there are
certain validation checks that execute via GitHub Actions and can be run locally using the steps below.

Install [act](https://github.com/nektos/act) and run the following command, which will evaluate the GitHub Actions
checks that apply to each Pull Request.
checks that apply to each Pull Request. The first time you run _act_ you will be asked to choose a
[runner](https://github.com/nektos/act#runners).

Alternatively, you can store your preferred runner within a local user profile named _.actrc_.

```bash
# .actrc file example (https://github.com/nektos/act#configuration)
-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
```

Once you have configured a runner, use _act_ to invoke GitHub Actions and evaluate the workflow.

```bash
act pull_request
Expand Down
36 changes: 3 additions & 33 deletions chart/templates/marquez/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,48 +24,18 @@ spec:
# This init container is for avoiding CrashLoopback errors in the Marquez container because the PostgreSQL container is not ready
initContainers:
- name: wait-for-db
image: {{ include "common.images.image" (dict "imageRoot" .Values.postgresql.image "global" .Values.global) }}
imagePullPolicy: {{ .Values.postgresql.image.pullPolicy }}
image: postgres:12.1
imagePullPolicy: IfNotPresent
command:
- /bin/bash
args:
- -ec
- |
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

. /opt/bitnami/scripts/libos.sh
. /opt/bitnami/scripts/liblog.sh
. /opt/bitnami/scripts/libpostgresql.sh

check_postgresql_connection() {
echo "SELECT 1" | postgresql_remote_execute "$POSTGRES_HOST" "$POSTGRES_PORT" "$POSTGRES_DB" "$POSTGRES_USER" "$POSTGRES_PASSWORD"
}

info "Connecting to the PostgreSQL instance $POSTGRES_HOST:$POSTGRES_PORT"
if ! retry_while "check_postgresql_connection"; then
error "Could not connect to the database server"
return 1
else
info "Connected to the PostgreSQL instance"
fi
- until pg_isready -h ${POSTGRES_HOST} -p ${POSTGRES_PORT}; do echo waiting for database; sleep 2; done;
env:
- name: POSTGRES_HOST
value: {{ include "marquez.database.host" . | quote }}
- name: POSTGRES_PORT
value: {{ include "marquez.database.port" . | quote }}
- name: POSTGRES_DB
value: {{ include "marquez.database.name" . | quote }}
- name: POSTGRES_USER
value: {{ include "marquez.database.user" . | quote }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "marquez.postgresql.secretName" . }}
key: {{ include "marquez.database.existingsecret.key" . }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
Expand Down
10 changes: 10 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ postgresql:
## @param postgresql.enabled Deploy PostgreSQL container(s)
##
enabled: false
## Bitnami PostgreSQL image version
## ref: https://hub.docker.com/r/bitnami/postgresql/tags/
## @param image.registry PostgreSQL image registry
## @param image.repository PostgreSQL image repository
## @param image.tag PostgreSQL image tag (immutable tags are recommended)
##
image:
registry: docker.io
repository: bitnami/postgresql
tag: 12.1.0
## @param postgresql.postgresqlUsername PostgreSQL username
## ref: https://hub.docker.com/_/postgres/
##
Expand Down