Merge branch 'master' of github.com:VHlushchen/slack-notif #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Helm Deploy | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'base/**' | |
jobs: | |
helm-lint-deploy-packages: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Add helm repo | |
run: helm repo add datagrok-test https://vhlushchen.github.io/slack-notif/charts/ | |
- uses: dorny/paths-filter@v3 | |
id: chart_changes | |
with: | |
filters: | | |
grok_connect: | |
- 'base/datagrok_grok_connect/**' | |
grok_spawner: | |
- 'base/datagrok_grok_spawner/**' | |
jkg: | |
- 'base/datagrok_jkg/**' | |
jn: | |
- 'base/datagrok_jupyter_notebook/**' | |
grok_connect_publish: | |
- 'base/datagrok_grok_connect/Chart.yaml' | |
grok_spawner_publish: | |
- 'base/datagrok_grok_spawner/Chart.yaml' | |
jkg_publish: | |
- 'base/datagrok_jkg/Chart.yaml' | |
jn_publish: | |
- 'base/datagrok_jupyter_notebook/Chart.yaml' | |
- name: grok_connect lint | |
if: steps.chart_changes.outputs.grok_connect == 'true' | |
run: helm lint ./base/datagrok_grok_connect | |
- name: grok_spawner lint | |
if: steps.chart_changes.outputs.grok_spawner == 'true' | |
run: helm lint ./base/datagrok_grok_spawner | |
- name: helm lint jkg | |
if: steps.chart_changes.outputs.jkg == 'true' | |
run: helm lint ./base/datagrok_jkg | |
- name: helm lint jupyter_notebook | |
if: steps.chart_changes.outputs.jn == 'true' | |
run: helm lint ./base/datagrok_jupyter_notebook | |
- name: start minikube | |
if: steps.chart_changes.outputs.jkg == 'true' || steps.chart_changes.outputs.jn == 'true' || steps.chart_changes.outputs.h2o == 'true' || steps.chart_changes.outputs.grok_connect == 'true' || steps.chart_changes.outputs.grok_spawner == 'true' | |
id: minikube | |
uses: medyagh/setup-minikube@latest | |
with: | |
addons: registry,ingress | |
cache: false | |
driver: docker | |
# - name: Create namespace | |
# if: steps.chart_changes.outputs.jkg == 'true' || steps.chart_changes.outputs.jn == 'true' || steps.chart_changes.outputs.h2o == 'true' || steps.chart_changes.outputs.grok_connect == 'true' | |
# run: kubectl create namespace datagrok | |
- name: deploy grok connect | |
if: steps.chart_changes.outputs.grok_connect == 'true' | |
working-directory: ./base/datagrok_grok_connect | |
run: | | |
helm install grok-connect-test . -f values.yaml -n datagrok --dry-run | |
# helm install grok-connect-test . -f values.yaml -n datagrok | |
- name: deploy grok spawner | |
if: steps.chart_changes.outputs.grok_spawner == 'true' | |
working-directory: ./base/datagrok_grok_spawner | |
run: | | |
helm install grok-connect-test . -f values.yaml -n datagrok --dry-run | |
# helm install grok-connect-test . -f values.yaml -n datagrok | |
- name: deploy jupyter notebook | |
if: steps.chart_changes.outputs.jn == 'true' | |
working-directory: ./base/datagrok_jupyter_notebook | |
run: | | |
helm install jupyter-notebook-test . -f values.yaml -n datagrok --dry-run | |
# helm install jupyter-notebook-test . -f values.yaml -n datagrok | |
- name: deploy jkg | |
if: steps.chart_changes.outputs.jkg == 'true' | |
working-directory: ./base/datagrok_jkg | |
run: | | |
helm install jkg-test . -f values.yaml -n datagrok --dry-run | |
# helm install jkg-test . -f values.yaml -n datagrok | |
# | |
# helm install datagrok-test . -f values.yaml -n datagrok --dry-run | |
# helm install datagrok-test . -f values.yaml -n datagrok | |
# - name: check running state | |
# if: steps.chart_changes.outputs.jkg == 'true' || steps.chart_changes.outputs.jn == 'true' || steps.chart_changes.outputs.h2o == 'true' || steps.chart_changes.outputs.grok_connect == 'true' | |
# run: | | |
# check_any_pod_not_running() { | |
# local namespace=$1 | |
# while read -r pod status; do | |
# if [[ "$status" != "Running" ]]; then | |
# return 0 | |
# fi | |
# done < <(kubectl get pods -n datagrok --output=jsonpath='{range .items[*]}{.metadata.name}{" "}{.status.phase}{"\n"}{end}') | |
# return 1 | |
# } | |
# start_time_running_state=$(date +%s) | |
# timeout_running_state=600 | |
# while check_any_pod_not_running datagrok; do | |
# current_time=$(date +%s) | |
# elapsed_time=$((current_time - start_time_running_state)) | |
# if (( elapsed_time >= timeout_running_state )); then | |
# echo "Timeout reached. Not all pods are running." | |
# exit 1 | |
# fi | |
# echo "Not all pods are running. Waiting..." | |
# echo "____________________________________" | |
# kubectl get pods -n datagrok | |
# sleep 10 # Adjust the delay as needed | |
# done | |
# echo " _ _ _ _ _ _ _ _ _ _ _ _ " | |
# echo " | |" | |
# echo " | All pods are running |" | |
# echo " |_ _ _ _ _ _ _ _ _ _ _ _|" | |
# kubectl get pods -n datagrok | |
# - name: Check ready state | |
# if: steps.chart_changes.outputs.jkg == 'true' || steps.chart_changes.outputs.jn == 'true' || steps.chart_changes.outputs.h2o == 'true' || steps.chart_changes.outputs.grok_connect == 'true' | |
# run: | | |
# check_any_pod_not_ready() { | |
# local namespace=$1 | |
# while read -r pod ready; do | |
# if [[ "$ready" != "True" ]]; then | |
# return 0 | |
# fi | |
# done < <(kubectl get pods -n datagrok --output=jsonpath='{range .items[*]}{.metadata.name}{" "}{range .status.conditions[?(@.type=="Ready")]}{.status}{"\n"}{end}') | |
# return 1 | |
# } | |
# start_time_ready_state=$(date +%s) | |
# timeout_ready_state=120 | |
# | |
# while check_any_pod_not_ready datagrok; do | |
# current_time=$(date +%s) | |
# elapsed_time=$((current_time - start_time_ready_state)) | |
# if (( elapsed_time >= timeout_ready_state )); then | |
# echo "Timeout reached. Not all pods are ready." | |
# exit 1 | |
# fi | |
# echo "Not all pods are ready. Waiting..." | |
# echo "__________________________________" | |
# kubectl get pods -n datagrok | |
# sleep 30 # Adjust the delay as needed | |
# done | |
# echo " _ _ _ _ _ _ _ _ _ _ _ " | |
# echo " | |" | |
# echo " | All pods are ready |" | |
# echo " |_ _ _ _ _ _ _ _ _ _ _|" | |
# kubectl get pods -n datagrok | |
- name: Configure Git | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
- name: Publish grok_connect status | |
if: steps.chart_changes.outputs.grok_connect_publish == 'true' | |
run: | | |
helm package ./base/datagrok_grok_connect -d charts/ | |
- name: Publish grok_spawner status | |
if: steps.chart_changes.outputs.grok_spawner_publish == 'true' | |
run: | | |
helm package ./base/datagrok_grok_spawner -d charts/ | |
ls charts | |
- name: Publish jkg status | |
if: steps.chart_changes.outputs.jkg_publish == 'true' | |
run: | | |
helm package ./base/datagrok_jkg -d charts/ | |
- name: Publish jupyter_notebook status | |
if: steps.chart_changes.outputs.jn_publish == 'true' | |
run: | | |
helm package ./base/datagrok_jupyter_notebook -d charts/ | |
#helm push | |
ls charts | |
- name: Publish | |
if: steps.chart_changes.outputs.jkg_publish == 'true' || steps.chart_changes.outputs.jn_publish == 'true' || steps.chart_changes.outputs.grok_connect_publish == 'true' || steps.chart_changes.outputs.grok_spawner_publish == 'true' | |
run: | | |
helm repo index charts | |
git add . | |
git commit -m "Bump version helm charts" | |
git push | |
helm-lint-deploy-datagrok: | |
runs-on: ubuntu-latest | |
needs: [helm-lint-deploy-packages] | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Git pull changes | |
run: git pull | |
- name: Add helm repo | |
run: helm repo add datagrok-test https://vhlushchen.github.io/slack-notif/charts/ | |
- uses: dorny/paths-filter@v3 | |
id: chart_changes | |
with: | |
filters: | | |
datagrok: | |
- 'base/datagrok-helm-chart/**' | |
datagrok_publish: | |
- 'base/datagrok-helm-chart/Chart.yaml' | |
- name: datagrok lint | |
if: steps.chart_changes.outputs.datagrok == 'true' | |
run: helm lint ./base/datagrok-helm-chart | |
- name: datagrok dependency update | |
if: steps.chart_changes.outputs.datagrok_publish == 'true' | |
working-directory: ./base/datagrok-helm-chart | |
run: | | |
sleep 60 | |
helm dependency list | |
helm repo update | |
helm dependency update --debug | |
- name: helm package | |
run: helm package ./base/datagrok-helm-chart -d charts/ | |
- name: Configure Git | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
- name: Publish | |
run: | | |
helm repo index charts | |
git add . | |
git commit -m "Bump version datagrok helm charts" | |
git push |