From 8051716acfdf1807cf740b254eb6237776d8862e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 14 Jul 2017 15:45:31 +0200 Subject: [PATCH] updated dist.sh: SSH upload is now fully optional MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .gitignore | 10 ++++++---- dist.sh | 37 +++++++++++++------------------------ 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index cf4a7c5..1653e82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ -nbproject/private/ -nbproject/faces-config.NavData -nbproject/genfiles.properties -nbproject/*~ +/nbproject/private/ +/nbproject/faces-config.NavData +/nbproject/genfiles.properties +/nbproject/*~ /manifest.mf /build/ /dist/ /data/* /*.properties .~lock* +*.tmp .gitcommits + diff --git a/dist.sh b/dist.sh index 5097f6f..0206322 100755 --- a/dist.sh +++ b/dist.sh @@ -29,31 +29,16 @@ if [ ! -f "${DIST_CONFIG_FILE}" ] then echo "$0: Configuration file '${DIST_CONFIG_FILE}' not found" echo - echo "Following variables are needed:" + echo "Following variables are needed for SSH upload:" echo "- GLASSFISH_SSH_PATH" echo "- GLASSFISH_SSH_USER" echo "- GLASSFISH_SSH_SERVER" echo echo "And create a password-less SSH key." - exit 1 -fi - -# Load it -source "${DIST_CONFIG_FILE}" - -# All set? -if [ -z "${GLASSFISH_SSH_PATH}" ] -then - echo "$0: Variable GLASSFISH_SSH_PATH not set." - exit 1 -elif [ -z "${GLASSFISH_SSH_USER}" ] -then - echo "$0: Variable GLASSFISH_SSH_USER not set." - exit 1 -elif [ -z "${GLASSFISH_SSH_SERVER}" ] -then - echo "$0: Variable GLASSFISH_SSH_SERVER not set." - exit 1 + sleep 3 +else + # Load it + source "${DIST_CONFIG_FILE}" fi # Generate list @@ -95,13 +80,17 @@ do else echo "$0: Project '${project}' not found." fi - done -if [ "$1" != "r" -a "${NAME}" != "jcore" -a "${NAME}" != "jcore-swing" ] +if [ -n "${GLASSFISH_SSH_USER}" -a -n "${GLASSFISH_SSH_SERVER}" -a -n "${GLASSFISH_SSH_PATH}" ] then - echo "$0: Copying to remote '${GLASSFISH_SSH_SERVER}' ..." - scp "${DIST}" "${GLASSFISH_SSH_USER}@${GLASSFISH_SSH_SERVER}:${GLASSFISH_SSH_PATH}" + if [ "$1" != "r" -a "${NAME}" != "jcore" -a "${NAME}" != "jcore-swing" ] + then + echo "$0: Copying to remote '${GLASSFISH_SSH_SERVER}' ..." + scp "${DIST}" "${GLASSFISH_SSH_USER}@${GLASSFISH_SSH_SERVER}:${GLASSFISH_SSH_PATH}" || exit 255 + fi +else + echo "$0: SSH upload disabled." fi # Copy module.xml ... -- 2.39.5