forked from actions/clevermicro
87 lines
3.4 KiB
YAML
87 lines
3.4 KiB
YAML
name: Deploy CleverMicro
|
|
description: Deploy CleverMicro to a Kubernetes cluster using Kind
|
|
|
|
inputs:
|
|
registry-url:
|
|
description: Registry URL
|
|
required: true
|
|
registry-user:
|
|
description: Registry user
|
|
required: true
|
|
registry-password:
|
|
description: Registry password
|
|
required: true
|
|
amqp-router-tag:
|
|
description: AMQP Router docker image tag
|
|
required: true
|
|
management-service-tag:
|
|
description: Management service docker image tag
|
|
required: true
|
|
install-timeout:
|
|
description: Timeout for Helm install command
|
|
required: false
|
|
default: 10m
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Decide kind cluster name
|
|
id: cluster-name
|
|
shell: bash
|
|
run: |
|
|
rand=$(head /dev/urandom | tr -dc a-z0-9 | head -c 16)
|
|
timestamp=$(date +%s)
|
|
echo "cluster-name=$(echo clevermicro-test-$timestamp-$rand)" >> "$FORGEJO_OUTPUT"
|
|
|
|
- name: Bring up Kubernetes cluster using Kind
|
|
uses: https://git.cleverthis.com/actions/kubernetes@master
|
|
with:
|
|
cluster-name: ${{ steps.cluster-name.outputs.cluster-name }}
|
|
kind-config-path: ${{ forge.action_path }}/clevermicro-kind-config.yaml
|
|
registry-url: ${{ inputs.registry-url }}
|
|
registry-user: ${{ inputs.registry-user }}
|
|
registry-password: ${{ inputs.registry-password }}
|
|
|
|
- name: Add Helm chart repositories
|
|
shell: bash
|
|
run: |
|
|
echo "==================== Adding helm chart repositories ===================="
|
|
helm repo add kedacore https://kedacore.github.io/charts
|
|
helm repo add cleverthis "https://${{ inputs.registry-url }}/api/packages/infra/helm" \
|
|
--username "${{ inputs.registry-user }}" \
|
|
--password "${{ inputs.registry-password }}"
|
|
helm repo update
|
|
echo "==================== Done adding helm chart repositories ===================="
|
|
|
|
- name: Install KEDA and wait for ready
|
|
shell: bash
|
|
run: |
|
|
echo "==================== Installing KEDA ===================="
|
|
helm install keda kedacore/keda --namespace keda --create-namespace --wait --timeout ${{ inputs.install-timeout }}
|
|
echo "==================== Done installing KEDA ===================="
|
|
|
|
- name: Install CleverMicro and wait for ready
|
|
shell: bash
|
|
run: |
|
|
echo "==================== Installing CleverMicro ===================="
|
|
helm install clevermicro cleverthis/clevermicro-deployment-dev \
|
|
--set "clevermicro-dev.amqp-router.image.tag=${{ inputs.amqp-router-tag }}" \
|
|
--set "clevermicro-dev.management-service.image.tag=${{ inputs.management-service-tag }}" \
|
|
--wait --timeout ${{ inputs.install-timeout }}
|
|
echo "==================== Done installing CleverMicro ===================="
|
|
|
|
- name: Create additional resources for CleverMicro testing
|
|
shell: bash
|
|
run: |
|
|
echo "==================== Applying service file ===================="
|
|
kubectl apply -f ${{ forge.action_path }}/service.yaml
|
|
echo "==================== Done applying service file ===================="
|
|
|
|
- name: Wait for all pods ready
|
|
shell: bash
|
|
run: |
|
|
echo "==================== Waiting for all pods ready ===================="
|
|
kubectl wait pod --for=condition=Ready --timeout=10m --all
|
|
kubectl get pod
|
|
echo "==================== All pods ready ===================="
|