Skip to content

Some fixes

Some fixes #568

Workflow file for this run

name: Install applications on Kubernetes
on:
push:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
jobs:
install:
runs-on: self-hosted
steps:
- name: Cleanup
continue-on-error: true
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@v3
- name: Install dependencies
env:
HELM_VERSION: "v3.11.3"
HELM_DIFF_VERSION: "3.6.0"
HELMFILE_VERSION: "v0.152.0"
YQ_VERSION: "v4.33.3"
run: |
./.github/ci_config/bin/install-dependencies
- name: Prepare the environment (add secrets and enable installation of all components)
run: |
DNAME='CN=CI,O=TheHyve,L=Utrecht,C=NL' ./bin/init
yq -i -f process '.environments.default.values += ["../.github/ci_config/ci-config.yaml", "../.github/ci_config/secrets.yaml.gotmpl"]' environments.yaml
sed -i '/_install: /s/false/true/' etc/production.yaml
test-helmfile-template:
needs: install
runs-on: self-hosted
steps:
- name: Test helmfile template
env:
FIREBASE_ADMINSDK_JSON: ${{ secrets.FIREBASE_ADMINSDK_JSON }}
run: |
helmfile template > /tmp/helmfile.yaml
delete-old-clusters:
runs-on: self-hosted
needs: test-helmfile-template
steps:
- name: Delete old clusters
run: |
k3d cluster delete --all || true
test-k8s-versions:
needs: delete-old-clusters
runs-on: self-hosted
strategy:
matrix:
KUBECTL_VERSION: ["v1.27.0", "v1.28.0", "v1.29.0", "v1.30.0"]
include:
- KUBECTL_VERSION: "v1.27.0"
K3S_VERSION: "v1.27.14+k3s1"
- KUBECTL_VERSION: "v1.28.0"
K3S_VERSION: "v1.28.10+k3s1"
- KUBECTL_VERSION: "v1.29.0"
K3S_VERSION: "v1.29.5+k3s1"
- KUBECTL_VERSION: "v1.30.0"
K3S_VERSION: "v1.30.1+k3s1"
steps:
- uses: nolar/setup-k3d-k3s@v1
with:
version: ${{ matrix.K3S_VERSION }}
k3d-args: --config .github/ci_config/k3d-config.yaml
# Note: k3d adds a 'k3d-' prefix to this name
k3d-name: ${{ matrix.KUBECTL_VERSION }}
# TODO would be better to do this with a command line parameter. I have been unable to get this to work.
- name: Set kubeContext
run: |
sed -i "s/kubeContext: .*/kubeContext: k3d-${{ matrix.KUBECTL_VERSION }}/" etc/production.yaml
- name: Install RADAR-Kubernetes
env:
FIREBASE_ADMINSDK_JSON: ${{ secrets.FIREBASE_ADMINSDK_JSON }}
run: |
kubectl get pods --all-namespaces --context k3d-${{ matrix.KUBECTL_VERSION }}
helmfile sync --concurrency 1
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Manually triggered tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
limit-access-to-actor: true
- name: Report cluster state
if: always()
run: |
kubectl get pods --all-namespaces
# TODO We can remove the k3s uninstallation once the k3d PR is merged.
- name: Delete clusters when job was canceled
if: cancelled()
run: |
k3d cluster delete --all || true
k3s-uninstall.sh || true
check-gitignore:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check gitignore
run: |
echo "Checking whether any files that should be ignored are uploaded"
echo
if find . -not -path './.git/*' -type f | git check-ignore --stdin --no-index; then
echo
echo "Remove the above files from this branch"
exit 1
else
echo "No ignored files have been added"
fi