Skip to content

Commit

Permalink
Run helm install against KinD cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Jun 27, 2020
1 parent b34fa40 commit 59dc727
Showing 1 changed file with 82 additions and 1 deletion.
83 changes: 82 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,85 @@ jobs:
- run: |
php -r "exit(strpos('${HELM_OUTPUT}', 'https://helm.wyrihaximus.net/') !== false ? 0 : 255);"
env:
HELM_OUTPUT: ${{ steps.helm3.outputs.helm_output }}
HELM_OUTPUT: ${{ steps.helm3.outputs.helm_output }}
tests-helm-install:
name: "Testing Helm Install"
needs:
- build-docker-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: sed -i "s/master/sha-${GITHUB_SHA}/g" Dockerfile
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.0.0-rc.1
- name: Get running image ID
id: ps
run: printf "::set-output name=id::%s" $(docker ps --format "{{.ID}}")
env:
IMAGE: ${{ steps.build.outputs.tag }}
- name: Get running image IP
id: inspect
run: printf "::set-output name=ip::%s" $(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${IMAGE_ID})
env:
IMAGE_ID: ${{ steps.ps.outputs.id }}
- run: sed -i "s/127.0.0.1:32768/${KIND_IP}:6443/g" ~/.kube/config
env:
KIND_IP: ${{ steps.inspect.outputs.ip }}
- name: Make kubeconfig available to Helm3 action
run: |
kubeconfig=$(cat ~/.kube/config)
kubeconfig="${kubeconfig//'%'/'%25'}"
kubeconfig="${kubeconfig//$'\n'/'%0A'}"
kubeconfig="${kubeconfig//$'\r'/'%0D'}"
echo "::set-output name=kubeconfig::$kubeconfig"
id: kubeconfig
- name: List installed packages
uses: ./
id: helmlistcountfirst
with:
exec: |
printf "::set-output name=count::%s" $(helm list | grep ducker-hub-exporter | wc -l)
kubeconfig: ${{ steps.kubeconfig.outputs.kubeconfig }}
- run: echo "${COUNT}"
env:
COUNT: ${{ steps.helmlistcountfirst.outputs.count }}
- name: Install ducker-hub-exporter
uses: ./
id: helm3
with:
exec: |
helm repo add WyriHaximusNet https://helm.wyrihaximus.net/
helm install ducker-hub-exporter WyriHaximusNet/docker-hub-exporter --atomic
kubeconfig: ${{ steps.kubeconfig.outputs.kubeconfig }}
- name: List installed packages
uses: ./
with:
exec: |
helm list
kubeconfig: ${{ steps.kubeconfig.outputs.kubeconfig }}
- name: List installed packages
uses: ./
id: helmlistcountseccond
with:
exec: |
printf "::set-output name=count::%s" $(helm list | grep ducker-hub-exporter | wc -l)
kubeconfig: ${{ steps.kubeconfig.outputs.kubeconfig }}
- run: echo "${COUNT}"
env:
COUNT: ${{ steps.helmlistcountseccond.outputs.count }}
- name: UnInstall ducker-hub-exporter
uses: ./
with:
exec: |
helm uninstall ducker-hub-exporter
kubeconfig: ${{ steps.kubeconfig.outputs.kubeconfig }}
- name: List installed packages
uses: ./
id: helmlistcountthird
with:
exec: |
printf "::set-output name=count::%s" $(helm list | grep ducker-hub-exporter | wc -l)
kubeconfig: ${{ steps.kubeconfig.outputs.kubeconfig }}
- run: echo "${COUNT}"
env:
COUNT: ${{ steps.helmlistcountthird.outputs.count }}

0 comments on commit 59dc727

Please sign in to comment.