brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [4/8] brooklyn-dist git commit: make release script takes -y and checks for existing gpg-agent
Date Mon, 01 Feb 2016 17:43:20 GMT
make release script takes -y and checks for existing gpg-agent


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/a9e57ef7
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/a9e57ef7
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/a9e57ef7

Branch: refs/heads/0.8.0-incubating
Commit: a9e57ef766c23daf8db5e5ae96d7aff8f7349dbc
Parents: 66a7821
Author: Alex Heneveld <alex@cloudsoft.io>
Authored: Thu Sep 3 02:06:47 2015 +0100
Committer: Alex Heneveld <alex@cloudsoft.io>
Committed: Thu Sep 3 02:06:47 2015 +0100

----------------------------------------------------------------------
 release/make-release-artifacts.sh | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/a9e57ef7/release/make-release-artifacts.sh
----------------------------------------------------------------------
diff --git a/release/make-release-artifacts.sh b/release/make-release-artifacts.sh
index b372560..8cefc77 100755
--- a/release/make-release-artifacts.sh
+++ b/release/make-release-artifacts.sh
@@ -43,6 +43,8 @@ release.
                              include the suffix. Therefore, turning a release
                              candidate into a release requires only renaming
                              the artifacts.
+  -y                         answers "y" to all questions automatically, to
+                             use defaults and make this suitable for batch mode
 
 Specifying the RC number is required. Specifying the version number is
 discouraged; if auto detection is not working, then this script is buggy.
@@ -53,15 +55,19 @@ END
 ###############################################################################
 confirm() {
     # call with a prompt string or use a default
-    read -r -p "${1:-Are you sure? [y/N]} " response
-    case $response in
+    if [ "${batch_confirm_y}" == "true" ] ; then
+        true
+    else
+      read -r -p "${1:-Are you sure? [y/N]} " response
+      case $response in
         [yY][eE][sS]|[yY]) 
             true
             ;;
         *)
             false
             ;;
-    esac
+      esac
+    fi
 }
 
 ###############################################################################
@@ -83,7 +89,7 @@ detect_version() {
 # Argument parsing
 rc_suffix=
 OPTIND=1
-while getopts "h?v:r:" opt; do
+while getopts "h?v:r:y?" opt; do
     case "$opt" in
         h|\?)
             show_help
@@ -95,6 +101,9 @@ while getopts "h?v:r:" opt; do
         r)
             rc_suffix=$OPTARG
             ;;
+        y)
+            batch_confirm_y=true
+            ;;
         *)
             show_help
             exit 1
@@ -169,9 +178,13 @@ echo "Proceeding to build binary release"
 set -x
 
 # Set up GPG agent
-eval $(gpg-agent --daemon --no-grab --write-env-file $HOME/.gpg-agent-info)
-GPG_TTY=$(tty)
-export GPG_TTY GPG_AGENT_INFO
+if ps x | grep [g]pg-agent ; then
+  echo "gpg-agent already running; assuming it is set up and exported correctly."
+else
+  eval $(gpg-agent --daemon --no-grab --write-env-file $HOME/.gpg-agent-info)
+  GPG_TTY=$(tty)
+  export GPG_TTY GPG_AGENT_INFO
+fi
 
 # Workaround for bug BROOKLYN-1
 ( cd ${staging_dir} && mvn clean --projects :brooklyn-archetype-quickstart )


Mime
View raw message