Repository: hbase Updated Branches: refs/heads/branch-1.1 1b3bb876e -> e16da789c refs/heads/branch-1.2 d8318f10e -> f3fa14cdf refs/heads/branch-1.3 259b4cd5a -> 41a8e2152 refs/heads/branch-1.4 53eeb250c -> 20ed78e6a refs/heads/branch-2 1e4267f84 -> 4970b0ad0
HBASE-19229 Nightly script to check source artifact should not do a destructive git operation without opt-in Signed-off-by: Apekshit Sharma <a...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4970b0ad Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4970b0ad Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4970b0ad Branch: refs/heads/branch-2 Commit: 4970b0ad0606730deb4fae54f068fc6748e70118 Parents: 1e4267f Author: Sean Busbey <bus...@apache.org> Authored: Thu Nov 9 13:22:09 2017 -0600 Committer: Sean Busbey <bus...@apache.org> Committed: Thu Nov 9 16:17:26 2017 -0600 ---------------------------------------------------------------------- dev-support/Jenkinsfile | 1 + dev-support/hbase_nightly_source-artifact.sh | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/4970b0ad/dev-support/Jenkinsfile ---------------------------------------------------------------------- diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile index 35a08c7..b2e3923 100644 --- a/dev-support/Jenkinsfile +++ b/dev-support/Jenkinsfile @@ -290,6 +290,7 @@ curl -L -o personality.sh "${env.PROJET_PERSONALITY}" --unpack-temp-dir unpacked_src_tarball \ --maven-m2-initial .m2-for-repo \ --maven-m2-src-build .m2-for-src \ + --clean-source-checkout \ ${env.BASEDIR} """ } http://git-wip-us.apache.org/repos/asf/hbase/blob/4970b0ad/dev-support/hbase_nightly_source-artifact.sh ---------------------------------------------------------------------- diff --git a/dev-support/hbase_nightly_source-artifact.sh b/dev-support/hbase_nightly_source-artifact.sh index c66c41b..375d121 100755 --- a/dev-support/hbase_nightly_source-artifact.sh +++ b/dev-support/hbase_nightly_source-artifact.sh @@ -28,6 +28,10 @@ function usage { echo " component-dir." echo " --maven-m2-src-build /path/to/use Path for maven artifacts while building from the" echo " unpacked source tarball." + echo " --clean-source-checkout Destructively clean component checkout before" + echo " comparing to source tarball. N.B. will delete" + echo " anything in the checkout dir that isn't from" + echo " a git checkout, including ignored files." exit 1 } # if no args specified, show usage @@ -41,6 +45,7 @@ declare unpack_dir declare m2_initial declare m2_tarbuild declare working_dir +declare source_clean while [ $# -gt 0 ] do case "$1" in @@ -48,6 +53,7 @@ do --maven-m2-initial) shift; m2_initial=$1; shift;; --maven-m2-src-build) shift; m2_tarbuild=$1; shift;; --intermediate-file-dir) shift; working_dir=$1; shift;; + --clean-source-checkout) shift; source_clean="true";; --) shift; break;; -*) usage ;; *) break;; # terminate while loop @@ -124,8 +130,10 @@ 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}" -echo "Clean..." -git clean -xdfff >"${working_dir}/component_git_clean.log" 2>&1 +if [ -n "${source_clean}" ]; then + echo "Clean..." + git clean -xdfff >"${working_dir}/component_git_clean.log" 2>&1 +fi echo "Follow the ref guide section on making a RC: Step 6 Build the source tarball" git archive --format=tar.gz --output="${working_dir}/hbase-src.tar.gz" \ --prefix="hbase-SOMEVERSION/" HEAD \ @@ -153,6 +161,9 @@ Only in .: .git END if ! diff known_excluded diff_output >"${working_dir}/unexpected.diff" ; then echo "Any output here are unexpected differences between the source artifact we'd make for an RC and the current branch." + echo "One potential source of differences is if you have an unclean working directory; you should expect to see" + echo "such extraneous files below." + echo "" echo "The expected differences are on the < side and the current differences are on the > side." echo "In a given set of differences, '.' refers to the branch in the repo and 'unpacked_src_tarball' refers to what we pulled out of the tarball." diff known_excluded diff_output