-
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.
SVCPLAN-4857 new script to run generic SQL on a remote PG server
remote_control replaces jiractl update mk_test_server for confluence rename scripts for confluence update fix_network for confluence server fix_app_config fixed for Confluence add rcp remote-copy clean_xml.sh start/stop services; upgrade_app fix_java_heap_size.sh set_web_access move get_installer to utils add elapsed time in upgrade systemd wants=postgresql move confluence sql to its own cleanup foldeer split cleanup into jira & wiki specific dirs update versions for workflow actions remove COPY cleanup from Dockerfile add workflow env use version main in env deactivate user working quiet grep & puppet resource disable use lvmdevices to deldev HeapDumpOnOutOfMemoryError update for production PM update .gitignore Complete sso_bypass.sh Add option to specify key and additional errors SVCPLAN-4131 migrate to JSM go_log_rotate.sh go_mk_atlassian_supportzip.sh add check for cmdline action in go_upgrade_app attachments tarpipe script migrate attachments working enable service after installing service file update api functions to work with netrc script to enable/disable mail delivery
- Loading branch information
1 parent
0ceb49b
commit 62ba8ad
Showing
102 changed files
with
11,601 additions
and
395 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: "Call Env Vars" | ||
|
||
on: [ "push", "workflow_dispatch" ] | ||
|
||
jobs: | ||
call-envs: | ||
uses: andylytical/actions/.github/workflows/envs.yml@main |
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,11 +1,25 @@ | ||
#Binary installers | ||
#Binary files | ||
*.bin | ||
*.jar | ||
|
||
# password files | ||
*.pwd | ||
*.cnf | ||
|
||
# test files | ||
*.input | ||
*.csv | ||
*.ids | ||
*.input | ||
*.sample | ||
*.tsv | ||
*.txt | ||
NOTES | ||
output | ||
|
||
# log files | ||
*.log | ||
|
||
# working files | ||
*.swp | ||
*.tar | ||
attachments/ |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
BASE=${HOME}/atlassian-tools | ||
|
||
. ${BASE}/conf/config.sh | ||
. ${BASE}/lib/utils.sh | ||
|
||
[[ $VERBOSE -eq $YES ]] && set -x | ||
|
||
FILES=( | ||
"$APP_INSTALL_DIR"/conf/server.xml | ||
"$APP_INSTALL_DIR"/bin/setenv.sh | ||
) | ||
case "$APP_NAME" in | ||
jira) | ||
DB_CONF="$APP_HOME_DIR"/dbconfig.xml | ||
WEB_XML="$APP_INSTALL_DIR"/atlassian-jira/WEB-INF/web.xml | ||
;; | ||
confluence) | ||
DB_CONF="$APP_HOME_DIR"/confluence.cfg.xml | ||
WEB_XML="$APP_INSTALL_DIR"/confluence/WEB-INF/web.xml | ||
;; | ||
esac | ||
FILES+=( "$DB_CONF" "$WEB_XML" ) | ||
|
||
mkdir -p "$BACKUP_DIR" #BACKUP_DIR defined in config.sh | ||
|
||
tar -c -f - "${FILES[@]}" | tar -x -f - -C "$BACKUP_DIR" \ | ||
&& success "Config files backed up to '$BACKUP_DIR'" |
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,67 @@ | ||
#!/usr/bin/bash | ||
|
||
set -x | ||
|
||
YES=0 | ||
NO=1 | ||
VERBOSE=$YES | ||
DEBUG=$YES | ||
|
||
VGS=( vg_pgsql vg_backups vg_confluence ) | ||
|
||
ECHO= | ||
[[ $DEBUG -eq $YES ]] && ECHO=echo | ||
|
||
get_mountpoint() { | ||
local _vg="$1" | ||
mount | grep $_vg | cut -d' ' -f1 | ||
} | ||
|
||
mp_destroy() { | ||
local _mp="$1" | ||
[[ -n "$_mp" ]] && { | ||
$ECHO umount "$_mp" | ||
$ECHO wipefs -a -f "$_mp" | ||
} | ||
} | ||
|
||
vg_delete() { | ||
local _vg="$1" | ||
local _count=$( vgs | grep -c "$_vg" ) | ||
[[ $_count -gt 0 ]] && $ECHO vgremove -y $_vg | ||
} | ||
|
||
get_pv() { | ||
local _vg="$1" | ||
vgs | grep -qF "$_vg" \ | ||
&& vgs -o pv_name --noheadings $_vg | ||
} | ||
|
||
pv_wipe() { | ||
local _pv="$1" | ||
# $ECHO dd if=/dev/zero of=$pv bs=1M count=1 | ||
$ECHO wipefs -a -f "$_pv" | ||
} | ||
|
||
get_lv() { | ||
local _vg="$1" | ||
vgs | grep -qF "$_vg" \ | ||
&& vgs -o lv_name --noheadings "$_vg" | ||
} | ||
|
||
for vg in "${VGS[@]}" ; do | ||
|
||
lv=$( get_lv "$vg" ) | ||
pv=$( get_pv "$vg" ) | ||
mountp=$( get_mountpoint "$vg" ) | ||
mp_destroy "$mountp" | ||
# vg_delete "$vg" | ||
# | ||
# for pv in "${peevees[@]}" ; do | ||
# echo "PV REMOVE $pv" | ||
# $ECHO pvremove -y "$pv" | ||
# pv_wipe "$pv" | ||
# done | ||
|
||
done | ||
|
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 was deleted.
Oops, something went wrong.
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,41 +1,81 @@ | ||
#!/bin/bash | ||
|
||
BASE=/root/atlassian-tools | ||
set -e | ||
|
||
BASE=${HOME}/atlassian-tools | ||
|
||
. ${BASE}/conf/config.sh | ||
. ${BASE}/lib/utils.sh | ||
|
||
[[ $VERBOSE -eq $YES ]] && set -x | ||
|
||
sed_opts=( '-i' ) | ||
[[ $DEBUG -eq $YES ]] && unset sed_opts | ||
|
||
# Fix server.xml | ||
XML="$APP_INSTALL_DIR"/conf/server.xml | ||
[[ -z "$XML" ]] && die "File not found: '$XML'" | ||
SERVER_XML="$APP_INSTALL_DIR"/conf/server.xml | ||
[[ -f "$SERVER_XML" ]] || die "File not found: '$SERVER_XML'" | ||
|
||
# ... HOSTNAME | ||
TMP=$(mktemp) | ||
sed -e 's/\(proxyName="\)[^"]\+"/\1xxxyyyzzz"/' "$XML" \ | ||
sed -e 's/\(proxyName="\)[^"]\+"/\1xxxyyyzzz"/' "$SERVER_XML" \ | ||
| sed -e "s/xxxyyyzzz/$HOSTNAME_NEW/" >$TMP | ||
|
||
chown --reference="$SERVER_XML" "$TMP" | ||
chmod --reference="$SERVER_XML" "$TMP" | ||
if [[ $DEBUG -eq $YES ]] ; then | ||
cat $TMP | ||
rm $TMP | ||
else | ||
mv $TMP "$XML" | ||
mv $TMP "$SERVER_XML" | ||
fi | ||
success "Fixed hostname in server.xml" | ||
|
||
|
||
# ... Upgrade recovery (confluence only) | ||
[[ $APP_NAME == 'confluence' ]] && { | ||
SETENV="${APP_INSTALL_DIR}"/bin/setenv.sh | ||
[[ -f "$SETENV" ]] || die "File not found: '$SETENV'" | ||
sed "${sed_opts[@]}" \ | ||
-e '/upgrade.recovery.file.enabled=false/ s/^[ #]*//' \ | ||
"$SETENV" | ||
success "disabled confluence upgrade recovery file creation" | ||
} | ||
|
||
|
||
# Fix DB config | ||
DB_CONF="$APP_HOME_DIR"/dbconfig.xml | ||
sed_opts=( '-i' ) | ||
[[ $DEBUG -eq $YES ]] && unset sed_opts | ||
sed "${sed_opts[@]}" -e "s/$DB_NAME_OLD/$DB_NAME_NEW/g" "$DB_CONF" | ||
if [[ "$DB_NAME_OLD" == "$DB_NAME_NEW" ]] ; then | ||
echo 'DB_NAME_OLD == DB_NAME_NEW, no changes needed ... skipping "Fix DB Config" step' | ||
else | ||
case "$APP_NAME" in | ||
jira) | ||
DB_CONF="$APP_HOME_DIR"/dbconfig.xml | ||
PTRN="<url>jdbc:" | ||
;; | ||
confluence) | ||
DB_CONF="$APP_HOME_DIR"/confluence.cfg.xml | ||
PTRN='hibernate\.connection\.url' | ||
;; | ||
esac | ||
sed "${sed_opts[@]}" -e "s/$DB_NAME_OLD/$DB_NAME_NEW/g" "$DB_CONF" | ||
success "Updated DB config" | ||
fi | ||
|
||
|
||
# Fix web.xml | ||
XML="$APP_INSTALL_DIR"/atlassian-jira/WEB-INF/web.xml | ||
[[ -z "$XML" ]] && die "File not found: '$XML'" | ||
sed_opts=( '-i' ) | ||
[[ $DEBUG -eq $YES ]] && unset sed_opts | ||
# Fix session timeout in web.xml | ||
# Historically, this was set to 12000 (8.3 days) ... why? | ||
# See also: | ||
# https://confluence.atlassian.com/confkb/how-to-adjust-the-session-timeout-for-confluence-126910597.html | ||
# https://confluence.atlassian.com/jirakb/change-the-default-session-timeout-to-avoid-user-logout-in-jira-server-604209887.html | ||
# TODO - Is this needed anymore after change to SSO via CiLogon? | ||
WEB_XML='' | ||
if [[ $APP_NAME == 'jira' ]] ; then | ||
WEB_XML="$APP_INSTALL_DIR"/atlassian-jira/WEB-INF/web.xml | ||
elif [[ $APP_NAME == 'confluence' ]] ; then | ||
WEB_XML="$APP_INSTALL_DIR"/confluence/WEB-INF/web.xml | ||
fi | ||
[[ -f "$WEB_XML" ]] || die "File not found: '$WEB_XML'" | ||
sed "${sed_opts[@]}" \ | ||
-e 's/\(<session-timeout>\)[0-9]\+\(<\/session-timeout>\)/\112000\2/' \ | ||
"$XML" | ||
-e 's/\(<session-timeout>\)[0-9]\+\(<\/session-timeout>\)/\11200\2/' \ | ||
"$WEB_XML" | ||
success "Fix session timeout in web.xml" |
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
Oops, something went wrong.