]> git.mxchange.org Git - jprojects-scripts.git/commitdiff
Some fixes:
authorRoland Häder <roland@mxchange.org>
Mon, 26 Jun 2017 19:02:35 +0000 (21:02 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 26 Jun 2017 19:14:52 +0000 (21:14 +0200)
- Such senstive informations should be kept in configuration files ... ;-)
- also only libs (typical commit for me) can be committed without modifying
  script
- other fixes

Signed-off-by: Roland Häder <roland@mxchange.org>
commit-jprojects.sh
dist.sh
fix-project-remotes.sh

index 99f58bdb05bc5d005d0046bf208d5220ef749660..deff10f8ae75d514bac79c52a56b76e867e778fe 100755 (executable)
@@ -19,10 +19,20 @@ for project in ${LIST}; do
        if [ -n "${CHECK_CHANGES}" ]
        then
                echo "$0: Committing '${project}' ..."
-               if [ -n "$1" ]
+               if [ "$1" = "updated jar(s)" ]
                then
+                       # Special commit ... (known-binaries)
+                       git commit --signoff -S lib/*.jar -m "$1"
+               elif [ -n "$1" -a -n "$2" ]
+               then
+                       # Regular commit with given message
+                       git commit $2 --signoff -S -m "$1" || exit 255
+               elif [ -n "$1" ]
+               then
+                       # Regular commit with given message
                        git commit -a --signoff -S -m "$1" || exit 255
                else
+                       # Regular commit, will open $EDITOR for commit message
                        git commit -a --signoff -S || exit 255
                fi
        else
diff --git a/dist.sh b/dist.sh
index 0038723640d825d72d04d6a40506ee68cba14dd0..5097f6f56c613de3a1c900fc5d4d881c8854f02f 100755 (executable)
--- a/dist.sh
+++ b/dist.sh
@@ -6,6 +6,9 @@ NAME="${PWD##*/}"
 # Generated JAR file
 DIST="dist/${NAME}.jar"
 
+# Configuration file
+DIST_CONFIG_FILE="${HOME}/.jprojects-dist.sh"
+
 # WildFly module base path
 WILDFLY_MODULE_BASE_PATH="${HOME}/wildfly_domain/modules/org/mxchange"
 
@@ -16,17 +19,43 @@ WILDFLY_MODULE_PATH="${WILDFLY_MODULE_BASE_PATH}/${NAME}/main"
 WILDFLY_MODULE_XML_FILE="wildfly/module.xml"
 
 # Glassfish base path (domain)
-GLASSFISH_BASE_PATH="${HOME}/gf_domain/domain/lib"
-
-# Remote Glassfish path
-GLASSFISH_SSH_PATH="/var/payara/domains/domain1/lib"
-
-# Remote SSH server (password-less access)
-GLASSFISH_SSH_SERVER="www.mxchange.org"
+GLASSFISH_BASE_PATH="${HOME}/gf_domain/lib"
 
 # Windows personal domain
 PERSONAL_DOMAIN_PATH="${HOME}/personal_domain/lib"
 
+# Is the configuration file there?
+if [ ! -f "${DIST_CONFIG_FILE}" ]
+then
+       echo "$0: Configuration file '${DIST_CONFIG_FILE}' not found"
+       echo
+       echo "Following variables are needed:"
+       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
+fi
+
 # Generate list
 LIST=$(find ../*/lib/${NAME}.jar)
 LIST="${LIST} ${WILDFLY_MODULE_PATH}"
@@ -69,10 +98,10 @@ do
 
 done
 
-if [ "$1" != "r" -a -n "${GLASSFISH_SSH_PATH}" -a -n "${GLASSFISH_SSH_SERVER}" -a "${NAME}" != "jcore" -a "${NAME}" != "jcore-swing" ]
+if [ "$1" != "r" -a "${NAME}" != "jcore" -a "${NAME}" != "jcore-swing" ]
 then
        echo "$0: Copying to remote '${GLASSFISH_SSH_SERVER}' ..."
-       scp "${DIST}" "${GLASSFISH_SSH_SERVER}:${GLASSFISH_SSH_PATH}"
+       scp "${DIST}" "${GLASSFISH_SSH_USER}@${GLASSFISH_SSH_SERVER}:${GLASSFISH_SSH_PATH}"
 fi
 
 # Copy module.xml ...
index 1760685408aa5090c075bf4a191794107c7f4af5..acecde20ccb4ce41a21dbabb0012ef4ab8695af8 100755 (executable)
@@ -14,7 +14,7 @@ GIT_BRANCH="master"
 GIT_ORIGIN="origin"
 
 MEDIA_BASE="/media"
-MEDIA_NAME1="INTENSO"
+MEDIA_NAME1="Backup"
 MEDIA_NAME2="Transport"
 MEDIA_PATH="Java Project"