This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit d3059389aea1e1d65ad4c3a7af88ddf7e21e80c3
Author: Chesnay Schepler <ches...@apache.org>
AuthorDate: Fri Aug 11 11:13:54 2023 +0200

    [FLINK-32834] Decouple compile.sh from maven-utils.sh
    
    - run directly against maven by default
    - avoid CI-exclusive maven-utils
---
 tools/azure-pipelines/e2e-template.yml  |  2 +-
 tools/azure-pipelines/jobs-template.yml |  2 +-
 tools/ci/compile.sh                     | 12 ++++++------
 tools/ci/compile_ci.sh                  | 29 +++++++++++++++++++++++++++++
 4 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/tools/azure-pipelines/e2e-template.yml 
b/tools/azure-pipelines/e2e-template.yml
index 9fe0b7b8a05..6ec29f20897 100644
--- a/tools/azure-pipelines/e2e-template.yml
+++ b/tools/azure-pipelines/e2e-template.yml
@@ -115,7 +115,7 @@ jobs:
         sudo apt install ./libssl1.0.0_*.deb
       displayName: Prepare E2E run
       condition: not(eq(variables['SKIP'], '1'))
-    - script: ${{parameters.environment}} PROFILE="$PROFILE -Dfast 
-Pskip-webui-build" ./tools/ci/compile.sh
+    - script: ${{parameters.environment}} PROFILE="$PROFILE -Dfast 
-Pskip-webui-build" ./tools/ci/compile_ci.sh
       displayName: Build Flink
       condition: not(eq(variables['SKIP'], '1'))
     - script: ${{parameters.environment}} FLINK_DIR=`pwd`/build-target 
./tools/azure-pipelines/uploading_watchdog.sh 
flink-end-to-end-tests/run-nightly-tests.sh ${{parameters.group}}
diff --git a/tools/azure-pipelines/jobs-template.yml 
b/tools/azure-pipelines/jobs-template.yml
index b8bbbf87b28..908f91f7e91 100644
--- a/tools/azure-pipelines/jobs-template.yml
+++ b/tools/azure-pipelines/jobs-template.yml
@@ -68,7 +68,7 @@ jobs:
     displayName: "Set JDK"
   # Compile
   - script: |
-      ${{parameters.environment}} ./tools/ci/compile.sh || exit $?
+      ${{parameters.environment}} ./tools/ci/compile_ci.sh || exit $?
       ./tools/azure-pipelines/create_build_artifact.sh
     displayName: Compile
 
diff --git a/tools/ci/compile.sh b/tools/ci/compile.sh
index 8d1e6fbfce0..5fc899dd00b 100755
--- a/tools/ci/compile.sh
+++ b/tools/ci/compile.sh
@@ -23,6 +23,7 @@
 
 CI_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
 MVN_CLEAN_COMPILE_OUT="/tmp/clean_compile.out"
+MVN=${MVN:-./mvnw}
 
 # Deploy into this directory, to run license checks on all jars staged for 
deployment.
 # This helps us ensure that ALL artifacts we deploy to maven central adhere to 
our license conditions.
@@ -32,10 +33,9 @@ rm -rf ${MVN_VALIDATION_DIR}
 # source required ci scripts
 source "${CI_DIR}/stage.sh"
 source "${CI_DIR}/shade.sh"
-source "${CI_DIR}/maven-utils.sh"
 
 echo "Maven version:"
-run_mvn -version
+$MVN -version
 
 echo 
"=============================================================================="
 echo "Compiling Flink"
@@ -43,7 +43,7 @@ echo 
"==========================================================================
 
 EXIT_CODE=0
 
-run_mvn clean deploy 
-DaltDeploymentRepository=validation_repository::default::file:$MVN_VALIDATION_DIR
 -Dflink.convergence.phase=install -Pcheck-convergence \
+$MVN clean deploy 
-DaltDeploymentRepository=validation_repository::default::file:$MVN_VALIDATION_DIR
 -Dflink.convergence.phase=install -Pcheck-convergence \
     -Dmaven.javadoc.skip=true -U -DskipTests | tee $MVN_CLEAN_COMPILE_OUT
 
 EXIT_CODE=${PIPESTATUS[0]}
@@ -92,11 +92,11 @@ fi
 
 echo "============ Checking bundled dependencies marked as optional 
============"
 
-MVN=run_mvn ${CI_DIR}/verify_bundled_optional.sh $MVN_CLEAN_COMPILE_OUT || 
exit $?
+MVN=$MVN ${CI_DIR}/verify_bundled_optional.sh $MVN_CLEAN_COMPILE_OUT || exit $?
 
 echo "============ Checking scala suffixes ============"
 
-MVN=run_mvn ${CI_DIR}/verify_scala_suffixes.sh || exit $?
+MVN=$MVN ${CI_DIR}/verify_scala_suffixes.sh || exit $?
 
 echo "============ Checking shaded dependencies ============"
 
@@ -112,7 +112,7 @@ echo "============ Run license check ============"
 find $MVN_VALIDATION_DIR
 # We use a different Scala version with Java 17
 if [[ ${PROFILE} != *"jdk17"* ]]; then
-  MVN=run_mvn ${CI_DIR}/license_check.sh $MVN_CLEAN_COMPILE_OUT 
$MVN_VALIDATION_DIR || exit $?
+  MVN=$MVN ${CI_DIR}/license_check.sh $MVN_CLEAN_COMPILE_OUT 
$MVN_VALIDATION_DIR || exit $?
 fi
 
 exit $EXIT_CODE
diff --git a/tools/ci/compile_ci.sh b/tools/ci/compile_ci.sh
new file mode 100755
index 00000000000..d9b3f68a49a
--- /dev/null
+++ b/tools/ci/compile_ci.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+################################################################################
+#  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.
+################################################################################
+
+#
+# This file contains tooling for compiling Flink
+#
+
+CI_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
+source "${CI_DIR}/maven-utils.sh"
+
+MVN=run_mvn "${CI_DIR}/compile.sh"
+
+exit $?

Reply via email to