You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@yetus.apache.org by aw...@apache.org on 2020/10/23 13:58:23 UTC

[yetus] branch main updated: YETUS-1041. new release script fixes (#170)

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

aw pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/main by this push:
     new a209002  YETUS-1041. new release script fixes (#170)
a209002 is described below

commit a2090026904bd84ef5d46790ebb87abeedd49e0a
Author: Allen Wittenauer <aw...@apache.org>
AuthorDate: Fri Oct 23 06:58:13 2020 -0700

    YETUS-1041. new release script fixes (#170)
    
    Signed-off-by: Sean Busbey <bu...@apache.org>
---
 release/build-and-sign.sh  |  9 ++++++---
 release/initial-patches.sh | 16 +++++++++++++---
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/release/build-and-sign.sh b/release/build-and-sign.sh
index 9b0326b..d309398 100755
--- a/release/build-and-sign.sh
+++ b/release/build-and-sign.sh
@@ -179,6 +179,9 @@ option_parse()
       exit 1
     fi
   fi
+
+  mkdir -p "${LOGDIR}"
+
 }
 
 makearelease()
@@ -196,8 +199,6 @@ makearelease()
   # let's start at the root
   pushd "${BASEDIR}" >/dev/null || exit 1
 
-  mkdir -p "${LOGDIR}"
-
   big_console_header "Cleaning the Source Tree"
 
   # git clean to clear any remnants from previous build
@@ -223,7 +224,7 @@ makearelease()
     mvn --batch-mode site site:stage </dev/null
 }
 
-function signartifacts
+signartifacts()
 {
   declare i
   declare ret
@@ -272,6 +273,8 @@ startgpgagent
 makearelease
 releaseret=$?
 
+signartifacts
+
 stopgpgagent
 
 if [[ ${releaseret} == 0 ]]; then
diff --git a/release/initial-patches.sh b/release/initial-patches.sh
index 861e2ba..04d9777 100755
--- a/release/initial-patches.sh
+++ b/release/initial-patches.sh
@@ -27,6 +27,13 @@ if [[ ! -d precommit ]]; then
   exit 1
 fi
 
+SYSTEM=$(uname -s)
+if [[ "${SYSTEM}" == Darwin ]]; then
+  SEDI=("-i" '')
+else
+  SEDI=("-i")
+fi
+
 #shellcheck source=precommit/src/main/shell/core.d/00-yetuslib.sh
 . precommit/src/main/shell/core.d/00-yetuslib.sh
 
@@ -76,7 +83,7 @@ option_parse()
 }
 
 docker_run() {
-  docker run -i \
+  docker run -i --rm \
     -v "${PWD}:/src" \
     -v "${HOME}/.m2:${HOME}/.m2" \
     -u "${USER_ID}" \
@@ -89,6 +96,7 @@ docker_run() {
 cleanup() {
   git checkout --force "${STARTING_BRANCH}"
   git branch -D "${JIRAISSUE}-release"
+  git branch -D "${JIRAISSUE}-release"
   exit 1
 }
 
@@ -125,7 +133,7 @@ update_version() {
 
   # *MOST* systems have sed -i these days
   while read -r file; do
-    sed -i "s,${oldversion},${newversion},g" "${file}"
+    sed "${SEDI[@]}" "s,${oldversion},${newversion},g" "${file}"
   done < <( find . -name 'pom.xml')
 }
 
@@ -155,9 +163,11 @@ update_version "${OLD_BRANCH_VERSION}" "${NEW_BRANCH_VERSION}"
 git commit -a -m "${JIRAISSUE}. Stage version ${NEW_BRANCH_VERSION}"
 
 if [[ -n "${NEW_MAIN_VERSION}" ]]; then
-
+  git checkout --force main
   git checkout -b "${JIRAISSUE}-${STARTING_BRANCH}"
   update_version "${OLD_BRANCH_VERSION}" "${NEW_MAIN_VERSION}"
+  git commit -a -m "${JIRAISSUE}. Bump main version to ${NEW_MAIN_VERSION}"
+
 fi
 
 git checkout "${JIRAISSUE}-release"