-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d16e23
commit ec94a61
Showing
22 changed files
with
428 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
#!/bin/bash | ||
|
||
BASE=/root/atlassian-tools | ||
BASE=${HOME}/atlassian-tools | ||
|
||
. ${BASE}/conf/config.sh | ||
. ${BASE}/lib/utils.sh | ||
|
||
[[ $VERBOSE -eq $YES ]] && set -x | ||
|
||
SETENV="${APP_INSTALL_DIR}"/bin/setenv.sh | ||
[[ -f "$SETENV" ]] || die "File not found, SETENV: '$SETENV'" | ||
|
||
|
||
sed_opts=( '-i' ) | ||
[[ $DEBUG -eq $YES ]] && unset sed_opts | ||
|
||
# # JIRA | ||
# grep -q DISABLE_NOTIFICATIONS "$SETENV" \ | ||
# && sed "${sed_opts[@]}" -e 's/^[ #]*\(DISABLE_NOTIFICATIONS=\)/\1/' "$SETENV" | ||
|
||
# CONFLUENCE & JIRA | ||
sed "${sed_opts[@]}" -e '/atlassian.mail.senddisabled=true/ s/^[ #]*//' "$SETENV" | ||
"${BASE}"/bin/set_notifications.sh disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
BASE=${HOME}/atlassian-tools | ||
|
||
. ${BASE}/conf/config.sh | ||
. ${BASE}/lib/utils.sh | ||
|
||
"${BASE}"/bin/set_notifications.sh enable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
BASE=/root/atlassian-tools | ||
BASE=${HOME}/atlassian-tools | ||
BIN="$BASE"/bin | ||
|
||
. "$BASE"/conf/config.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#!/usr/bin/bash | ||
|
||
BASE=${HOME}/atlassian-tools | ||
|
||
. ${BASE}/conf/config.sh | ||
. ${BASE}/lib/utils.sh | ||
|
||
BIN="${BASE}"/bin | ||
FULLPATH=$(/usr/bin/readlink -e "$0") | ||
SOURCES="${BASE}"/install-upgrade/"${APP_NAME}" | ||
|
||
[[ $VERBOSE -eq $YES ]] && set -x | ||
|
||
set -x | ||
|
||
|
||
install_core() { | ||
[[ -d "${APP_INSTALL_DIR}" ]] && { | ||
/usr/bin/echo "APP_INSTALL_DIR '${APP_INSTALL_DIR}' exists ... skipping app install" 1>&2 | ||
return -1 | ||
} | ||
|
||
local _installer=$( /usr/bin/find "${SOURCES}" | ||
-type f \ | ||
-name "${FILE_NAME_PATTERN}" \ | ||
-print \ | ||
| /usr/bin/sort -V \ | ||
| /usr/bin/tail -1) | ||
/usr/bin/chmod +x "${_installer}" | ||
"${_installer}" -q -varfile "${SOURCES}"/response.varfile | ||
} | ||
|
||
|
||
install_config() { | ||
set -x | ||
local _hn=$(/usr/bin/hostname -f) | ||
local _template="${SOURCES}"/server.xml.tmpl | ||
/usr/bin/sed -e "s/___PROXYNAME___/${_hn}/" "${_template}" \ | ||
> "${APP_INSTALL_DIR}"/conf/server.xml | ||
} | ||
|
||
|
||
install_admin_pwd() { | ||
set -x | ||
local _pwd_file=$(/usr/bin/find "${SOURCES}" -type f -name '*.pwd' -print) | ||
[[ -f "${_pwd_file}" ]] && { | ||
/usr/bin/mv "${_pwd_file}" /root/. | ||
} | ||
} | ||
|
||
|
||
print_usage() { | ||
local _prg=$(/usr/bin/basename "${FULLPATH}") | ||
cat <<ENDHERE | ||
${_prg} | ||
Install all or part of the Atlassian app | ||
SYNOPSYS | ||
${_prg} [OPTIONS] [installer_file.bin] | ||
OPTIONS | ||
-h --help Print this help | ||
-c --configonly Install just the config file (server.xml) | ||
ENDHERE | ||
} | ||
|
||
|
||
### | ||
# MAIN | ||
### | ||
|
||
# Getopts | ||
action="install" | ||
ENDWHILE=0 | ||
while [[ $# -gt 0 ]] && [[ $ENDWHILE -eq 0 ]] ; do | ||
case $1 in | ||
-h|--help) print_usage; exit 0;; | ||
-c|--configonly) action="configonly";; | ||
--) ENDWHILE=1;; | ||
-*) echo "Invalid option '$1'"; exit 1;; | ||
*) ENDWHILE=1; break;; | ||
esac | ||
shift | ||
done | ||
|
||
FILE_NAME_PATTERN="$1" | ||
[[ -z "${FILE_NAME_PATTERN}" ]] && FILE_NAME_PATTERN='atlassian*.bin' | ||
|
||
if [[ "${action}" == 'install' ]] ; then | ||
# Install | ||
install_core && { | ||
|
||
/usr/bin/echo | ||
/usr/bin/echo "INSTALL SUCCESS" | ||
/usr/bin/echo | ||
|
||
install_config | ||
|
||
"${BIN}"/disable_notifications.sh | ||
|
||
"${BIN}"/set_java_heap_size.sh | ||
|
||
install_admin_pwd | ||
} | ||
elif [[ "${action}" == 'configonly' ]] ; then | ||
install_config | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
BASE=/root/atlassian-tools | ||
BASE=${HOME}/atlassian-tools | ||
BIN="$BASE"/bin | ||
|
||
. "$BASE"/conf/config.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
BASE=/root/atlassian-tools | ||
BASE=${HOME}/atlassian-tools | ||
BIN="$BASE"/bin | ||
|
||
. ${BASE}/conf/config.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
BASE=/root/atlassian-tools | ||
BASE=${HOME}/atlassian-tools | ||
BIN="$BASE"/bin | ||
|
||
. ${BASE}/conf/config.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
BASE=${HOME}/atlassian-tools | ||
|
||
. ${BASE}/conf/config.sh | ||
. ${BASE}/lib/utils.sh | ||
|
||
[[ $VERBOSE -eq $YES ]] && set -x | ||
|
||
SETENV="${APP_INSTALL_DIR}"/bin/setenv.sh | ||
[[ -f "$SETENV" ]] || die "File not found, SETENV: '$SETENV'" | ||
|
||
sed_opts=( '-i' ) | ||
[[ $DEBUG -eq $YES ]] && unset sed_opts | ||
|
||
|
||
if [[ ${APP_NAME} == "jira" ]] ; then | ||
sed "${sed_opts[@]}" \ | ||
-e '/^JVM_MINIMUM_MEMORY=/ c JVM_MINIMUM_MEMORY="2048m"' \ | ||
-e '/^JVM_MAXIMUM_MEMORY=/ c JVM_MAXIMUM_MEMORY="4096m"' \ | ||
"${SETENV}" | ||
|
||
elif [[ ${APP_NAME} == "confluence" ]] ; then | ||
sed "${sed_opts[@]}" \ | ||
's/\(-Xm[sx]\)[0-9]\+m/\18192m/g' \ | ||
"${SETENV}" | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
BASE=${HOME}/atlassian-tools | ||
|
||
. ${BASE}/conf/config.sh | ||
. ${BASE}/lib/utils.sh | ||
|
||
[[ $VERBOSE -eq $YES ]] && set -x | ||
|
||
SETENV="${APP_INSTALL_DIR}"/bin/setenv.sh | ||
[[ -f "$SETENV" ]] || die "File not found, SETENV: '$SETENV'" | ||
|
||
|
||
sed_opts=( '-i' ) | ||
[[ $DEBUG -eq $YES ]] && unset sed_opts | ||
|
||
action=$1 | ||
case ${action} in | ||
(enable|disable) | ||
: pass | ||
;; | ||
(*) | ||
die "missing or unknown action '$action'" | ||
;; | ||
esac | ||
|
||
if [[ ${APPNAME} == "jira" ]] ; then | ||
|
||
if [[ ${action} == "disable" ]] ; then | ||
# disable - jira | ||
sed "${sed_opts[@]}" -e 's/^[ #]*\(DISABLE_NOTIFICATIONS=\)/\1/' "$SETENV" | ||
|
||
elif [[ ${action} == "enable" ]] ; then | ||
# enable - jira | ||
sed "${sed_opts[@]}" -e 's/^[ #]*\(DISABLE_NOTIFICATIONS=\)/#\1/' "$SETENV" | ||
fi | ||
|
||
elif [[ ${APPNAME} == "confluence" ]] ; then | ||
|
||
if [[ ${action} == "disable" ]] ; then | ||
# disable - confluence | ||
sed "${sed_opts[@]}" -e '/atlassian.mail.senddisabled=true/ s/^[ #]*//' "$SETENV" | ||
|
||
elif [[ ${action} == "enable" ]] ; then | ||
# enable - confluence | ||
sed "${sed_opts[@]}" -e '/atlassian.mail.senddisabled=true/ s/^[ #]*/#/' "$SETENV" | ||
fi | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.