From e071c50b9ddacfe1710407aa356a2e8c4dcb21bf Mon Sep 17 00:00:00 2001 From: sayedppqq Date: Wed, 22 May 2024 14:35:23 +0600 Subject: [PATCH] Add CI Signed-off-by: sayedppqq --- .github/workflows/ci.yml | 41 +++++++++----------------------------- hack/scripts/test.sh | 43 ---------------------------------------- 2 files changed, 9 insertions(+), 75 deletions(-) delete mode 100644 hack/scripts/test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d264f53..1aed0ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,15 @@ name: dashboard-check on: - push: - branches: - - "*.*" - pull_request: - branches: - - "master" schedule: - cron: '0 0 * * *' workflow_dispatch: inputs: - databases: - description: 'Databases' + folders: + description: 'Folders' required: true default: 'all' type: string - kubedb-version: + kubedb_version: description: 'KubeDB Version' required: true default: 'v2024.4.27' #needs to be dynamic @@ -28,17 +22,17 @@ jobs: name: Configure Inputs runs-on: ubuntu-latest outputs: - dbs: ${{ steps.defaulter.outputs.databases }} - kubedb : ${{ steps.defaulter.outputs.kubedb }} + folders: ${{ steps.defaulter.outputs.folders }} + kubedb_version : ${{ steps.defaulter.outputs.kubedb_version }} steps: - name: Defaulter id: defaulter env: - DATABASES: "policy" - KUBEDB_VERSION: "v2024.4.27" + FOLDERS: ${{ inputs.folders }} + KUBEDB_VERSION: ${{ inputs.kubedb_version }} run: | - echo "databases=${DATABASES:-all}" >> $GITHUB_OUTPUT - echo "kubedb=${KUBEDB_VERSION:-v2024.4.27}" >> $GITHUB_OUTPUT + echo "folders=${FOLDERS:-all}" >> $GITHUB_OUTPUT + echo "kubedb_version=${KUBEDB_VERSION:-v2024.4.27}" >> $GITHUB_OUTPUT test: name: Test runs-on: ubuntu-latest @@ -48,15 +42,6 @@ jobs: matrix: k8s: [v1.27.3] steps: - - uses: actions/checkout@v4 - with: - ref: ci - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - with: - detached: true - - name: Set up Go 1.22 uses: actions/setup-go@v4 with: @@ -141,7 +126,6 @@ jobs: cd .. git clone https://github.com/kubedb/cli.git cd cli - git checkout check go install ./... - name: Install Prometheus @@ -163,12 +147,6 @@ jobs: sleep 5s kubectl wait --for=condition=ready pod -l "app.kubernetes.io/name=panopticon,app.kubernetes.io/instance=panopticon" -n kubeops --timeout=10m -# - name: Install Falco UI Server -# run: | -# helm repo add appscode https://charts.appscode.com/stable/ -# helm repo update -# helm upgrade -i falco-ui-server appscode/falco-ui-server -n kubeops --create-namespace --version=v2024.2.5 - - name: Apply MetricsConfigurations run: | helm repo add appscode https://charts.appscode.com/stable/ @@ -180,7 +158,6 @@ jobs: cd .. git clone https://github.com/kubedb/samples.git cd samples - git checkout old-dbs - name: Check Dashboard Metrics env: diff --git a/hack/scripts/test.sh b/hack/scripts/test.sh deleted file mode 100644 index 20638bf..0000000 --- a/hack/scripts/test.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -set -e - -declare -A kind=(["connectcluster"]="ConnectCluster" ["druid"]="Druid" ["elasticsearch"]="Elasticsearch" ["kafka"]="Kafka" ["mariadb"]="MariaDB" - ["mongodb"]="MongoDB" ["mysql"]="MySQL" ["perconaxtradb"]="PerconaXtraDB" ["pgpool"]="Pgpool" ["postgres"]="Postgres" ["proxysql"]="ProxySQL" - ["rabbitmq"]="RabbitMQ" ["redis"]="Redis" ["singlestore"]="Singlestore" ["solr"]="Solr" ["zookeeper"]="ZooKeeper") - -#kubectl apply -f safklkasg.yaml -# Capture the output of ls into an array -readarray -t files < <(ls) - -# Displaying elements of the array -for file in "${files[@]}"; do - echo "$file" -done -#cd ../../ -#kubectl create ns demo -# -#folders=$(ls) -##path=/home/sayed/go/src/kubedb.dev/samples/kafka/ -##kubectl apply -f $path -# -## Convert the string variable into an array -#IFS=$'\n' read -r -d '' -a folder_array <<< "$folders" -# -#for folder in "${folder_array[@]}"; do -# if [[ -v kind["$folder"] ]] && [[ "$folder" == "mongodb" ]]; then -# kubectl apply -f -# echo "db name: $folder" -# inside_files=$(ls "$folder") -# path=../samples/"$folder"/monitoring/ -# kubectl apply -f $path -# kubectl wait --for=jsonpath='{.status.phase}'=Ready ${kind[$folder]} $folder -n demo --timeout=10m -# IFS=$'\n' read -r -d '' -a inside_files_array <<< "$inside_files" -# for file in "${inside_files_array[@]}"; do -# if [[ $file == *.json ]]; then -# dashboard_name="${file::-5}" -# kubectl-dba monitor dashboard $folder $folder -n demo dashboard_name --prom-svc-name=prometheus-kube-prometheus-prometheus --prom-svc-namespace=monitoring --prom-svc-port=9090 -# fi -# done -# fi -#done \ No newline at end of file