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

ci: ensure needed namespace exists #127

Closed
wants to merge 2 commits into from
Closed
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
20 changes: 18 additions & 2 deletions .github/workflows/helm-test-open-webui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
pull_request:
paths:
- "charts/open-webui/**"
- ".github/workflows/helm-test-open-webui.yml"
push:
paths:
- "charts/open-webui/**"
- ".github/workflows/helm-test-open-webui.yml"

jobs:
lint-chart:
Expand All @@ -28,6 +30,8 @@ jobs:
name: Test Chart Deployment
runs-on: ubuntu-latest
needs: lint-chart
env:
NAMESPACE: test-namespace

steps:
- name: Checkout Code
Expand All @@ -45,10 +49,22 @@ jobs:
- name: Template open-webui Helm Chart
run: |
helm template open-webui ./charts/open-webui \
--namespace test-namespace --create-namespace > open-webui.yaml
--namespace "$NAMESPACE" > open-webui.yaml

- name: Ensure test namespace
run: |
# Create the namespace
kubectl create namespace "$NAMESPACE"

# Wait for the namespace to be ready
for i in {1..30}; do
kubectl get namespace "$NAMESPACE" --no-headers && break || sleep 2
echo "Waiting for namespace '$NAMESPACE' to become available..."
done

echo "Namespace '$NAMESPACE' is now available."

- name: Verify open-webui
run: |
kubectl create namespace test-namespace
kubectl apply --namespace test-namespace -f open-webui.yaml
kubectl wait --namespace test-namespace pod/open-webui-0 --for=condition=Ready --timeout=600s
19 changes: 18 additions & 1 deletion .github/workflows/helm-test-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
pull_request:
paths:
- "charts/pipelines/**"
- ".github/workflows/helm-test-pipelines.yml"
push:
paths:
- "charts/pipelines/**"
- ".github/workflows/helm-test-pipelines.yml"

jobs:
lint-chart:
Expand All @@ -28,6 +30,8 @@ jobs:
name: Test Chart Deployment
runs-on: ubuntu-latest
needs: lint-chart
env:
NAMESPACE: test-namespace

steps:
- name: Checkout Code
Expand All @@ -45,7 +49,20 @@ jobs:
- name: Template open-webui Helm Chart
run: |
helm template pipelines ./charts/pipelines \
--namespace test-namespace --create-namespace > pipelines.yaml
--namespace "$NAMESPACE" > pipelines.yaml

- name: Ensure test namespace
run: |
# Create the namespace
kubectl create namespace "$NAMESPACE"

# Wait for the namespace to be ready
for i in {1..30}; do
kubectl get namespace "$NAMESPACE" --no-headers && break || sleep 2
echo "Waiting for namespace '$NAMESPACE' to become available..."
done

echo "Namespace '$NAMESPACE' is now available."

- name: Verify pipelines
run: |
Expand Down
Loading