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

zhangduo pushed a commit to branch HBASE-28694
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/HBASE-28694 by this push:
     new 245c9a931bf docker
245c9a931bf is described below

commit 245c9a931bf136a6fd80b9fdb33e1bd9179f6735
Author: Duo Zhang <[email protected]>
AuthorDate: Thu Jun 27 23:56:07 2024 +0800

    docker
---
 dev-support/Jenkinsfile                      | 12 ++++++------
 dev-support/hbase_nightly_source-artifact.sh | 13 +++++++++----
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile
index 2a94a21c353..cdda198d9fe 100644
--- a/dev-support/Jenkinsfile
+++ b/dev-support/Jenkinsfile
@@ -760,10 +760,8 @@ pipeline {
         // TODO (HBASE-23870): replace this with invocation of the release tool
         stage ('packaging and integration') {
           agent {
-            dockerfile {
-              dir 'dev-support/docker'
+            node {
               label 'hbase-large'
-              args '-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro'
             }
           }
           environment {
@@ -802,14 +800,16 @@ pipeline {
             '''
             sh """#!/bin/bash -e
               echo "Checking the steps for an RM to make a source artifact, 
then a binary artifact."
-              if JAVA_HOME="/usr/lib/jvm/java-17" 
PATH=$PATH:$MAVEN_HOME/bin/mvn" \
-                  ${env.BASEDIR}/dev-support/hbase_nightly_source-artifact.sh" 
\
+              docker build -t hbase-dev-support -f 
"${BASEDIR}/dev-support/docker/Dockerfile" .
+              docker run -v "${WORKSPACE}":/hbase -u `id -u`:`id -g` -e 
JAVA_HOME="/usr/lib/jvm/java-17" --workdir=/hbase hbase-dev-support \
+                  "/hbase/dev-support/hbase_nightly_source-artifact.sh" \
                   --intermediate-file-dir output-srctarball \
                   --unpack-temp-dir unpacked_src_tarball \
                   --maven-m2-initial .m2-for-repo \
                   --maven-m2-src-build .m2-for-src \
                   --clean-source-checkout \
-                  "${env.BASEDIR}" ; then
+                  /hbase
+              if [ $? -eq 0 ]; then
                 echo '(/) {color:green}+1 source release artifact{color}\n-- 
See build output for details.' >output-srctarball/commentfile
               else
                 echo '(x) {color:red}-1 source release artifact{color}\n-- See 
build output for details.' >output-srctarball/commentfile
diff --git a/dev-support/hbase_nightly_source-artifact.sh 
b/dev-support/hbase_nightly_source-artifact.sh
index 79c62ca7743..a47b719e7fd 100755
--- a/dev-support/hbase_nightly_source-artifact.sh
+++ b/dev-support/hbase_nightly_source-artifact.sh
@@ -33,6 +33,11 @@ function usage {
   echo "                                          a git checkout, including 
ignored files."
   exit 1
 }
+
+MVN="mvn"
+if ! command -v mvn &>dev/null; then
+  MVN=$MAVEN_HOME/bin/mvn
+fi
 # if no args specified, show usage
 if [ $# -lt 1 ]; then
   usage
@@ -124,7 +129,7 @@ fi
 # See http://hbase.apache.org/book.html#maven.release
 
 echo "Maven details, in case our JDK doesn't match expectations:"
-mvn --version --offline | tee "${working_dir}/maven_version"
+${MVN} --version --offline | tee "${working_dir}/maven_version"
 
 echo "Do a clean building of the source artifact using code in 
${component_dir}"
 cd "${component_dir}"
@@ -183,7 +188,7 @@ function build_tarball {
   local build_log="srctarball_install.log"
   local tarball_glob="hbase-*-bin.tar.gz"
   if [ $build_hadoop3 -ne 0 ]; then
-    local version=$(mvn help:evaluate -Dexpression=project.version -q 
-DforceStdout)
+    local version=$(${MVN} help:evaluate -Dexpression=project.version -q 
-DforceStdout)
     local hadoop3_version=$(get_hadoop3_version $version)
     mvn_extra_args="-Drevision=${hadoop3_version} -Dhadoop.profile=3.0"
     build_log="hadoop3_srctarball_install.log"
@@ -192,7 +197,7 @@ function build_tarball {
   else
     echo "Follow the ref guide section on making a RC: Step 8 Build the binary 
tarball."
   fi
-  if mvn --threads=2 -DskipTests -Prelease --batch-mode 
-Dmaven.repo.local="${m2_tarbuild}" ${mvn_extra_args} clean install \
+  if ${MVN} --threads=2 -DskipTests -Prelease --batch-mode 
-Dmaven.repo.local="${m2_tarbuild}" ${mvn_extra_args} clean install \
     assembly:single >"${working_dir}/${build_log}" 2>&1; then
     for artifact in "${unpack_dir}"/hbase-assembly/target/${tarball_glob}; do
       if [ -f "${artifact}" ]; then
@@ -217,7 +222,7 @@ if [ $? -ne 0 ]; then
   exit 1
 fi
 
-mvn help:active-profiles | grep -q hadoop-3.0
+${MVN} help:active-profiles | grep -q hadoop-3.0
 if [ $? -ne 0 ]; then
   echo "The hadoop-3.0 profile is not activated by default, build a hadoop3 
tarball."
   # move the previous tarballs out, so it will not be cleaned while building 
against hadoop3

Reply via email to