Improved some scripts and added new mailer projects
authorRoland Haeder <roland@mxchange.org>
Mon, 4 Apr 2016 21:43:19 +0000 (23:43 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 4 Apr 2016 21:43:19 +0000 (23:43 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
.jprojects.sh
cp-dist.sh
dist.sh
fix-project-remotes.sh
push-stick.sh

index 9b125ee..cf33056 100644 (file)
@@ -7,6 +7,7 @@ LIST="jcore jcore-logger-lib jcore-logger-ejb jcoreee \
        jcontacts-core jcontacts-business-core jcontacts-lib jcontacts-ejb \
        juser-core juser-lib \
        jletter-core jletter-lib jletter-ejb \
+       jmailer-ee \
        jcore-swing \
        jshop-core jshop-ee-lib jshop-ejb \
        jshop-receipt-lib jshop-receipt-ejb"
@@ -14,8 +15,8 @@ LIST="jcore jcore-logger-lib jcore-logger-ejb jcoreee \
 # Applications and their special libs/EJBs
 LIST="${LIST}
        pizzaservice-lib pizzaservice pizzaservice-swing pizzaservice-war \
-       jjobs-lib jjobs-ejb jjobs jjobs-war \
-       addressbook-lib addressbook-ejb addressbook addressbook-war addressbook-uml"
+       jjobs-lib jjobs-mailer jjobs-ejb jjobs jjobs-war \
+       addressbook-lib addressbook-mailer addressbook-ejb addressbook addressbook-war addressbook-uml"
 
 # Tools repository
 LIST="${LIST} jprojects-scripts"
index ace7597..41cb9d6 100755 (executable)
@@ -3,7 +3,11 @@
 . ./.jprojects.sh || exit 255
 
 for project in ${LIST}; do
-       if [ -f "${project}/dist.sh" ]
+       if [ "${project}" = "jprojects-scripts" ]
+       then
+               echo "$0: Skipping jprojects-scripts ..."
+               continue
+       elif [ -f "${project}/dist.sh" ]
        then
                echo "$0: Copying dist.sh to '${project}' ..."
                cp -v dist.sh "${project}/" || exit 255
@@ -12,7 +16,8 @@ for project in ${LIST}; do
        if [ ! -d "${project}/docs" -o "$1" = "f" ]
        then
                echo "$0: GNU-ifying project '${project}' ..."
-               cp -rv docs "${project}/" || exit 255
+               mkdir --parent "${project}/docs" || exit 255
+               cp -rpv docs/* "${project}/docs/" || exit 255
                cd "${JPROJECTS_HOME}/${project}"
                echo "$0: git add ..."
                git add docs || exit 255
diff --git a/dist.sh b/dist.sh
index 0bdc4a4..101a0f4 100755 (executable)
--- a/dist.sh
+++ b/dist.sh
@@ -19,7 +19,7 @@ WILDFLY_MODULE_XML_FILE="wildfly/module.xml"
 GLASSFISH_BASE_PATH="${HOME}/gf_domain/domain/lib"
 
 # Remote Glassfish path
-GLASSFISH_SSH_PATH="/var/glassfish/domains/domain1/lib"
+GLASSFISH_SSH_PATH="/var/payara/domains/domain1/lib"
 
 # Remote SSH server (password-less access)
 GLASSFISH_SSH_SERVER="www.mxchange.org"
index 6fff377..22b4dd0 100755 (executable)
@@ -5,6 +5,7 @@
 UNWANTED_NAME="stick"
 WANTED_NAME1="upstream"
 WANTED_NAME2="daedalus"
+WANTED_NAME3="transport"
 
 GIT_USER="quix0r"
 GIT_SERVER="git.mxchange.org"
@@ -12,14 +13,16 @@ GIT_PATH="/var/cache/git/repos"
 GIT_BRANCH="master"
 GIT_ORIGIN="origin"
 
-MEDIA_NAME="INTENSO"
-MEDIA_PATH="Java Project"
 MEDIA_BASE="/media"
+MEDIA_NAME1="INTENSO"
+MEDIA_NAME2="Transport"
+MEDIA_PATH="Java Project"
 
 for project in ${LIST}; do
        GIT_URL1="${GIT_USER}@${GIT_SERVER}:${GIT_PATH}/${project}.git"
        GIT_URL2="${GIT_PATH}/${project}.git"
-       echo "$0: GIT_URL1='${GIT_URL1}',GIT_URL2='${GIT_URL2}'"
+       GIT_URL3="${MEDIA_BASE}/${USER}/${MEDIA_NAME2}/${MEDIA_PATH}/${project}.git"
+       echo "$0: GIT_URL1='${GIT_URL1}',GIT_URL2='${GIT_URL2}',GIT_URL3='${GIT_URL3}'"
 
        cd "${project}"
 
@@ -42,12 +45,12 @@ for project in ${LIST}; do
                REMOTE_PUSH=`git remote -v | grep "push"`
                echo "$0: REMOTE='${REMOTE}',REMOTE_PUSH='${REMOTE_PUSH}'"
 
-               MEDIA=`echo "${REMOTE_PUSH}" | grep "${MEDIA_BASE}/"`
-               echo "$0: MEDIA='${MEDIA}'"
+               MEDIA1=`echo "${REMOTE_PUSH}" | grep "${MEDIA_BASE}/${USER}/${MEDIA_NAME1}/"`
+               echo "$0: MEDIA1='${MEDIA1}'"
 
-               if [ -n "${MEDIA}" ]
+               if [ -n "${MEDIA1}" ]
                then
-                       echo "$0: Found ${MEDIA_BASE}/ remote for '${project}'."
+                       echo "$0: Found '${MEDIA_BASE}/${USER}/${MEDIA_NAME1}' remote for '${project}'."
                        if [ "${REMOTE}" = "${GIT_ORIGIN}" ]
                        then
                                echo "$0: Project '${project}' has already fixed '${GIT_ORIGIN}'."
@@ -73,7 +76,7 @@ for project in ${LIST}; do
                                fi
 
                                echo "$0: Adding '${GIT_ORIGIN}' to '${project}' ..."
-                               git remote add "${GIT_ORIGIN}" "${MEDIA_BASE}/${USER}/${MEDIA_NAME}/${MEDIA_PATH}/${project}.git" --track "${GIT_BRANCH}" || exit 255
+                               git remote add "${GIT_ORIGIN}" "${MEDIA_BASE}/${USER}/${MEDIA_NAME1}/${MEDIA_PATH}/${project}.git" --track "${GIT_BRANCH}" || exit 255
                        else
                                echo "$0: Unknown remote '${REMOTE_PUSH}' found. Exiting ..."
                                exit 1
@@ -86,24 +89,25 @@ for project in ${LIST}; do
 
        if [ -n "${UNWANTED_REMOTE}" ]
        then
-               echo "$0: Found remote '${UNWANTED_NAME1}' in '${project}'. Renaming '${GIT_ORIGIN}'->'${WANTED_NAME1}' and '${UNWANTED_NAME1}'->'${GIT_ORIGIN}' ..."
+               echo "$0: Found remote '${UNWANTED_NAME}' in '${project}'. Renaming '${GIT_ORIGIN}'->'${WANTED_NAME1}' and '${UNWANTED_NAME}'->'${GIT_ORIGIN}' ..."
 
                UPSTREAM_REMOTE=`git remote | grep "${WANTED_NAME1}"`
                echo "$0: UPSTREAM_REMOTE='${UPSTREAM_REMOTE}'"
 
                if [ -n "${UPSTREAM_REMOTE}" ]
                then
-                       echo "$0: Remotes '${UNWANTED_NAME1}' and '${WANTED_NAME1}' exist! Removing '${WANTED_NAME1}' ..."
+                       echo "$0: Remotes '${UNWANTED_NAME}' and '${WANTED_NAME1}' exist! Removing '${WANTED_NAME1}' ..."
                        git remote rm "${WANTED_NAME1}" || exit 255
                fi
 
                git remote rename "${GIT_ORIGIN}" "${WANTED_NAME1}" || exit 255
-               git remote rename "${UNWANTED_NAME1}" "${GIT_ORIGIN}" || exit 255
+               git remote rename "${UNWANTED_NAME}" "${GIT_ORIGIN}" || exit 255
        else
-               echo "$0: No unwanted '${UNWANTED_NAME1}' remote in '${project}' ..."
+               echo "$0: No unwanted '${UNWANTED_NAME}' remote in '${project}' ..."
                UPSTREAM_REMOTE1=`git remote | grep "${WANTED_NAME1}"`
                UPSTREAM_REMOTE2=`git remote | grep "${WANTED_NAME2}"`
-               echo "$0: UPSTREAM_REMOTE1='${UPSTREAM_REMOTE1}',UPSTREAM_REMOTE2='${UPSTREAM_REMOTE2}'"
+               UPSTREAM_REMOTE3=`git remote | grep "${WANTED_NAME3}"`
+               echo "$0: UPSTREAM_REMOTE1='${UPSTREAM_REMOTE1}',UPSTREAM_REMOTE2='${UPSTREAM_REMOTE2}',UPSTREAM_REMOTE3='${UPSTREAM_REMOTE3}'"
 
                if [ -n "${UPSTREAM_REMOTE1}" ]
                then
@@ -116,10 +120,26 @@ for project in ${LIST}; do
                if [ -n "${UPSTREAM_REMOTE2}" ]
                then
                        echo "$0: Remote '${WANTED_NAME2}' found in '${project}'."
+               elif [ ! -d "${GIT_URL2}" ]
+               then
+                       echo "$0: Remote '${WANTED_NAME2}' cannot be created, path '${GIT_URL2}' missing."
+                       exit 1
                else
                        echo "$0: No wanted '${WANTED_NAME2}' in '${project}'. Adding ..."
                        git remote add "${WANTED_NAME2}" "${GIT_URL2}" --track "${GIT_BRANCH}" || exit 255
                fi
+
+               if [ -n "${UPSTREAM_REMOTE3}" ]
+               then
+                       echo "$0: Remote '${WANTED_NAME3}' found in '${project}'."
+               elif [ ! -d "${GIT_URL3}" ]
+               then
+                       echo "$0: Remote '${WANTED_NAME3}' cannot be created, path '${GIT_URL3}' missing."
+                       exit 1
+               else
+                       echo "$0: No wanted '${WANTED_NAME3}' in '${project}'. Adding ..."
+                       git remote add "${WANTED_NAME3}" "${GIT_URL3}" --track "${GIT_BRANCH}" || exit 255
+               fi
        fi
 
        cd -
index a797e34..4a8ca09 100755 (executable)
@@ -2,16 +2,38 @@
 
 . ./.jprojects.sh || exit 255
 
+TARGETS="d t u"
+
+if [ "$1" = "a" ]
+then
+       cd "${JPROJECTS_HOME}"
+       for TARGET in ${TARGETS}; do
+               echo "$0: Pushing for target '${TARGET}' ..."
+               $0 "${TARGET}" "1"
+       done
+
+       echo "$0: Pushed to all targets."
+       exit 0
+fi
+
 for ENTRY in ${LIST}; do
        echo "$0: Pushing '${ENTRY}' ..."
-       cd "${ENTRY}" || exit 255
-       git push --all
-       if [ "$1" = "u" ]
+       cd "${JPROJECTS_HOME}/${ENTRY}" || exit 255
+
+       if [ -z "$2" ]
        then
-               git push --all upstream
-       elif [ "$1" = "d" ]
+               git push --all
+       fi
+
+       if [ "$1" = "d" ]
        then
                git push --all daedalus
+       elif [ "$1" = "t" ]
+       then
+               git push --all transport
+       elif [ "$1" = "u" ]
+       then
+               git push --all upstream
        fi
-       cd -
+       cd "${JPROJECTS_HOME}"
 done