feat: update v1.0.2-beta4 #470
Workflow file for this run
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
# | |
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
name: Deployment Test | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- main | |
paths: | |
- charts/devlake/** | |
- .github/workflows/deploy-test.yml | |
pull_request: | |
paths: | |
- charts/devlake/** | |
- .github/workflows/deploy-test.yml | |
- "!**.md" | |
workflow_dispatch: | |
jobs: | |
deploy-with-helm: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
database_type: ["mysql-builtin", "mysql-external"] | |
steps: | |
- name: Creating kind cluster | |
uses: container-tools/kind-action@v1 | |
- name: Cluster information | |
run: | | |
kubectl cluster-info | |
kubectl get nodes | |
kubectl get pods -n kube-system | |
helm version | |
kubectl version | |
kubectl get storageclasses | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Helm install devlake | |
if: matrix.database_type == 'mysql-external' | |
run: | | |
helm repo add bitnami https://charts.bitnami.com/bitnami | |
helm repo add grafana https://grafana.github.io/helm-charts | |
helm install mysql bitnami/mysql --version 9.19.1 --set auth.rootPassword=admin --set auth.database=lake --set auth.username=merico --set auth.password=merico | |
# external mysql at service: mysql | |
helm dep build charts/devlake | |
helm install --debug --wait --timeout 2400s deploy-test charts/devlake \ | |
--set service.uiPort=30000 \ | |
--set mysql.useExternal=true \ | |
--set mysql.externalServer=mysql \ | |
--set lake.encryptionSecret.secret=$(openssl rand -base64 2000 | tr -dc 'A-Z' | fold -w 128 | head -n 1) | |
kubectl get pods -o wide | |
kubectl get services -o wide | |
- name: Helm install devlake | |
if: matrix.database_type == 'mysql-builtin' | |
run: | | |
helm repo add grafana https://grafana.github.io/helm-charts | |
helm dep build charts/devlake | |
export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}") | |
echo Node IP: ${NODE_IP} | |
helm install --debug --wait --timeout 2400s deploy-test charts/devlake \ | |
--set service.uiPort=30000 \ | |
--set mysql.image.tag=8-debian \ | |
--set lake.encryptionSecret.secret=$(openssl rand -base64 2000 | tr -dc 'A-Z' | fold -w 128 | head -n 1) | |
kubectl get pods -o wide | |
kubectl get services -o wide | |
# TODO: using some e2e test code to replace it | |
- name: Curl with endpoints | |
run: | | |
export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}") | |
failed=0 | |
for retry in {1..10} ; do | |
failed=0 | |
# home | |
curl --fail http://${NODE_IP}:30000 || failed=1 | |
# API for devlake | |
curl --fail http://${NODE_IP}:30000/api/blueprints || failed=1 | |
# API for grafana | |
curl --fail http://${NODE_IP}:30000/grafana/api/health || failed=1 | |
if [ $failed -eq 0 ] ; then | |
break | |
else | |
sleep 3 | |
fi | |
done | |
if [ $failed -ne 0 ] ; then | |
echo 'Test apis failed, please check logs from the PODS' | |
exit 1 | |
fi | |
- name: Show logs for pods | |
if: ${{ always() }} | |
run: | | |
for pod in $(kubectl get pods -o jsonpath='{.items[*].metadata.name}') ; do | |
echo describe for $pod | |
kubectl describe pod $pod | |
echo logs for $pod | |
kubectl logs $pod || echo "" | |
done |