3 # Name of this project, detected by it's base path
7 DIST="dist/${NAME}.jar"
9 # WildFly module base path
10 WILDFLY_MODULE_BASE_PATH="${HOME}/wildfly_domain/modules/org/mxchange"
12 # And for this "module" (as WildFly calls it)
13 WILDFLY_MODULE_PATH="${WILDFLY_MODULE_BASE_PATH}/${NAME}/main"
16 WILDFLY_MODULE_XML_FILE="wildfly/module.xml"
18 # Glassfish base path (domain)
19 GLASSFISH_BASE_PATH="${HOME}/gf_domain/domain/lib"
21 # Remote Glassfish path
22 GLASSFISH_SSH_PATH="/var/payara/domains/domain1/lib"
24 # Remote SSH server (password-less access)
25 GLASSFISH_SSH_SERVER="www.mxchange.org"
28 LIST=`find ../*/lib/${NAME}.jar`
29 LIST="${LIST} `find ../*/*-ejb/lib/${NAME}.jar`"
30 LIST="${LIST} ${WILDFLY_MODULE_PATH}"
32 if [ -d "${GLASSFISH_BASE_PATH}" ]
34 echo "$0: Glassfish personal domain found, adding to LIST ..."
35 LIST="${LIST} ${GLASSFISH_BASE_PATH}"
40 echo "$0: '${DIST}' not found."
42 elif [ ! -d "${WILDFLY_MODULE_BASE_PATH}" ]
44 echo "$0: WildFly base path '${WILDFLY_MODULE_BASE_PATH}' not created."
46 elif [ ! -d "${WILDFLY_MODULE_PATH}" ]
48 mkdir -vp "${WILDFLY_MODULE_PATH}"
51 for target in ${LIST};
55 cp -v "${DIST}" "${target}"
56 elif [ -f "${target}" ]
58 cp -v "${DIST}" "${target}"
60 echo "$0: Target '${target}' not found."
65 # Testing on project name
66 SKIP_TEST="${NAME:0:9}"
68 if [ -n "${GLASSFISH_SSH_PATH}" -a -n "${GLASSFISH_SSH_SERVER}" -a "${SKIP_TEST}" != "jratecalc" ]
70 echo "$0: Copying to remote '${GLASSFISH_SSH_SERVER}' ..."
71 scp "${DIST}" "${GLASSFISH_SSH_SERVER}:${GLASSFISH_SSH_PATH}"
75 if [ -f "${WILDFLY_MODULE_XML_FILE}" ]
77 echo "$0: Generating module.xml ..."
78 XML_CONTENT=`cat "${WILDFLY_MODULE_XML_FILE}"`
79 XML_CONTENT="${XML_CONTENT//NAME/$NAME}"
80 echo "${XML_CONTENT}" > "${WILDFLY_MODULE_PATH}/module.xml"