Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#2820] improvement(CI): Add check_command.sh in the pipeline to check required commands and preconditions (#2841)

Qi Yuee33f2cad41c
diff --git a/.github/workflows/backend-integration-test.yml b/.github/workflows/backend-integration-test.yml
index 053502d354..a639ec28fd 100644
--- a/.github/workflows/backend-integration-test.yml
+++ b/.github/workflows/backend-integration-test.yml
@@ -75,6 +75,10 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
+ - name: Check required command
+ run: |
+ dev/ci/check_commands.sh
+
- name: Package Gravitino
run: |
./gradlew build -x test -PjdkVersion=${{ matrix.java-version }}
diff --git a/.github/workflows/frontend-integration-test.yml b/.github/workflows/frontend-integration-test.yml
index 7123f2b0d1..dfd192b36c 100644
--- a/.github/workflows/frontend-integration-test.yml
+++ b/.github/workflows/frontend-integration-test.yml
@@ -73,6 +73,10 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
+ - name: Check required command
+ run: |
+ dev/ci/check_commands.sh
+
- name: Package Gravitino
run: |
./gradlew build -x test -PjdkVersion=${{ matrix.java-version }}
diff --git a/dev/ci/check_commands.sh b/dev/ci/check_commands.sh
new file mode 100755
index 0000000000..c84423be0b
--- /dev/null
+++ b/dev/ci/check_commands.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+# Copyright 2024 Datastrato Pvt Ltd.
+# This software is licensed under the Apache License version 2.
+#
+
+set -ex
+
+if ! command -v docker; then
+ echo "docker could not be found, exiting."
+ exit 1
+fi
+
+if ! file $(which docker) | grep -q 'executable'; then
+ echo "docker is not a executable file, exiting."
+ exit 1
+fi
+
+if ! command -v docker-proxy; then
+ echo "docker-proxy could not be found, exiting."
+ exit 1
+fi
+
+if ! file $(which docker-proxy) | grep -q 'executable'; then
+ echo "docker-proxy is not a executable file, exiting."
+ exit 1
+fi
+
+# More commands can be added here
+echo "All required commands are installed."
\ No newline at end of file