Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .github/runs-on.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_extends: .github-private
47 changes: 23 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

jobs:
release-please:
runs-on: ubuntu-latest
runs-on: runs-on=${{ github.run_id }}/runner=evertrust
steps:
- uses: googleapis/release-please-action@v4
id: release
Expand All @@ -21,27 +21,26 @@ jobs:
release_created: ${{ steps.release.outputs.release_created }}

release:
runs-on: ubuntu-22.04
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Helm
uses: azure/setup-helm@v3

- name: Build chart
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm dependencies build
helm package .

- name: Upload to Sonatype repo
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
PACKAGE="$(find . -type f -name 'stream-*.tgz' -maxdepth 1 | head -n 1)"
curl -F file=@$PACKAGE --user "$NEXUS_USERNAME:$NEXUS_PASSWORD" --fail https://repo.evertrust.io/service/rest/v1/components?repository=charts
runs-on: runs-on=${{ github.run_id }}/runner=evertrust
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Helm
uses: azure/setup-helm@v3

- name: Build chart
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm dependencies build
helm package .

- name: Upload to Sonatype repo
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
PACKAGE="$(find . -type f -name 'stream-*.tgz' -maxdepth 1 | head -n 1)"
curl -F file=@$PACKAGE --user "$NEXUS_USERNAME:$NEXUS_PASSWORD" --fail https://repo.evertrust.io/service/rest/v1/components?repository=charts
18 changes: 18 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test

on:
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: runs-on=${{ github.run_id }}/runner=evertrust
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Helm
uses: azure/setup-helm@v3

- name: Test chart
run: make test
41 changes: 0 additions & 41 deletions .gitlab-ci.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
.vscode/
# Dev value files
values.*.yml
/*.tgz
/*.tgz
# Helm tests
tests/
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
all: gen-schema package
all: gen-schema dependencies package test setup-unittest

gen-schema:
readme-generator -r README.md -v values.yaml -s values.schema.json

package:
helm dependencies build
dependencies:
helm dependencies build .

package: dependencies
helm package .

test: setup-unittest
helm unittest . -v tests/values.yaml

setup-unittest:
@if ! helm plugin list | grep -q "unittest"; then \
echo "Installing helm unittest plugin..."; \
helm plugin install https://github.com/helm-unittest/helm-unittest.git; \
else \
echo "helm unittest plugin already installed"; \
fi
42 changes: 42 additions & 0 deletions tests/config_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: configuration features
templates:
- deployment.yml
- config.yml
tests:
- it: should properly configure extraConfig when provided
set:
extraConfig: |
Hello
template: config.yml
asserts:
- isKind:
of: ConfigMap
- matchRegex:
path: data["application.conf"]
pattern: ".*Hello.*"

- it: should properly mount custom startup scripts via extraVolumes and extraVolumeMounts
set:
extraVolumes:
- name: horizon-entrypoint-scripts
configMap:
name: horizon-entrypoint-scripts
extraVolumeMounts:
- name: horizon-entrypoint-scripts
mountPath: /docker-entrypoint.d/
template: deployment.yml
asserts:
- isKind:
of: Deployment
- contains:
path: spec.template.spec.volumes
content:
name: horizon-entrypoint-scripts
configMap:
name: horizon-entrypoint-scripts
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: horizon-entrypoint-scripts
mountPath: /docker-entrypoint.d/
7 changes: 7 additions & 0 deletions tests/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
license:
secretKey: "test"
secretName: "test"

keyset:
secretKey: "test"
secretName: "test"
Loading