From ef5d1053b62a6cc050e9231ea8c6903760086114 Mon Sep 17 00:00:00 2001 From: vegetableysm Date: Mon, 25 Dec 2023 16:43:07 +0800 Subject: [PATCH] Clean code. Signed-off-by: vegetableysm --- .github/workflows/java-ci.yaml | 6 +++--- java/hive/docker/build.sh | 28 ++++++++++++---------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/java-ci.yaml b/.github/workflows/java-ci.yaml index 2290a6ad4..e98c46ef8 100644 --- a/.github/workflows/java-ci.yaml +++ b/.github/workflows/java-ci.yaml @@ -20,13 +20,13 @@ on: - main paths: - 'java/hive/**' - - '.github/workflows/hive-base-test.yml' + - '.github/workflows/java-ci.yaml' pull_request: branches: - main paths: - 'java/hive/**' - - '.github/workflows/hive-base-test.yml' + - '.github/workflows/java-ci.yaml' concurrency: group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} @@ -39,7 +39,7 @@ env: jobs: ci: runs-on: ${{ matrix.os }} - if: true #${{ github.repository == 'v6d-io/v6d' }} + if: ${{ github.repository == 'v6d-io/v6d' }} strategy: matrix: os: [ubuntu-20.04] diff --git a/java/hive/docker/build.sh b/java/hive/docker/build.sh index 9dd1c1076..309e475b7 100755 --- a/java/hive/docker/build.sh +++ b/java/hive/docker/build.sh @@ -66,13 +66,9 @@ done SOURCE_DIR=${SOURCE_DIR:-"../../.."} repo=${REPO:-apache} -# WORK_DIR="$(mktemp -d)" WORK_DIR=../../../hive-base-workdir -#WORK_DIR="/opt/tao/hive-docker-build" mkdir -p "$WORK_DIR" find "$WORK_DIR" -maxdepth 1 -mindepth 1 ! -name '*.tar.gz' -exec rm -rf {} \; -# HADOOP_VERSION=${HADOOP_VERSION:-$(mvn -f "$SOURCE_DIR/pom.xml" -q help:evaluate -Dexpression=hadoop.version -DforceStdout)} -# TEZ_VERSION=${TEZ_VERSION:-$(mvn -f "$SOURCE_DIR/pom.xml" -q help:evaluate -Dexpression=tez.version -DforceStdout)} HADOOP_VERSION=${HADOOP_VERSION:-"3.3.4"} TEZ_VERSION=${TEZ_VERSION:-"0.9.1"} HIVE_VERSION=${HIVE_VERSION:-"2.3.9"} @@ -96,8 +92,8 @@ else TEZ_URL=${TEZ_URL:-"https://archive.apache.org/dist/tez/$TEZ_VERSION/apache-tez-$TEZ_VERSION-bin.tar.gz"} echo "Downloading Tez from $TEZ_URL..." if ! curl --fail -L "$TEZ_URL" -o "$WORK_DIR/apache-tez-$TEZ_VERSION-bin.tar.gz"; then - echo "Failed to download Tez, exiting..." - exit 1 + echo "Failed to download Tez, exiting..." + exit 1 fi fi @@ -106,22 +102,22 @@ if [ -f "$WORK_DIR/apache-hive-$HIVE_VERSION-bin.tar.gz" ]; then else echo "Download Hive..." if [ -n "$HIVE_VERSION" ]; then - HIVE_URL=${HIVE_URL:-"https://archive.apache.org/dist/hive/hive-$HIVE_VERSION/apache-hive-$HIVE_VERSION-bin.tar.gz"} - echo "Downloading Hive from $HIVE_URL..." - if ! curl --fail -L "$HIVE_URL" -o "$WORK_DIR/apache-hive-$HIVE_VERSION-bin.tar.gz"; then + HIVE_URL=${HIVE_URL:-"https://archive.apache.org/dist/hive/hive-$HIVE_VERSION/apache-hive-$HIVE_VERSION-bin.tar.gz"} + echo "Downloading Hive from $HIVE_URL..." + if ! curl --fail -L "$HIVE_URL" -o "$WORK_DIR/apache-hive-$HIVE_VERSION-bin.tar.gz"; then echo "Failed to download Hive, exiting..." exit 1 - fi - hive_package="$WORK_DIR/apache-hive-$HIVE_VERSION-bin.tar.gz" + fi + hive_package="$WORK_DIR/apache-hive-$HIVE_VERSION-bin.tar.gz" else - HIVE_VERSION=$(mvn -f "$SOURCE_DIR/pom.xml" -q help:evaluate -Dexpression=project.version -DforceStdout) - HIVE_TAR="$SOURCE_DIR/packaging/target/apache-hive-$HIVE_VERSION-bin.tar.gz" - if ls $HIVE_TAR || mvn -f $SOURCE_DIR/pom.xml clean package -DskipTests -Pdist; then + HIVE_VERSION=$(mvn -f "$SOURCE_DIR/pom.xml" -q help:evaluate -Dexpression=project.version -DforceStdout) + HIVE_TAR="$SOURCE_DIR/packaging/target/apache-hive-$HIVE_VERSION-bin.tar.gz" + if ls $HIVE_TAR || mvn -f $SOURCE_DIR/pom.xml clean package -DskipTests -Pdist; then cp "$HIVE_TAR" "$WORK_DIR/" - else + else echo "Failed to compile Hive Project, exiting..." exit 1 - fi + fi fi fi