mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
DCD-352: Remove some legacy function usage.
This commit is contained in:
@@ -20,7 +20,7 @@ SYNCHRONY_CLASSPATH="${ATL_SYNCHRONY_JAR_PATH}:${ATL_POSTGRES_DRIVER_PATH}"
|
||||
function extractJWTKeyFromConfluenceConfig {
|
||||
local keyType=$1
|
||||
if [[ "${keyType}" != "jwt.private.key" && "${keyType}" != "jwt.public.key" ]]; then
|
||||
atl_log "Unexpected value for keyType - ${keyType} to extract JWT key from confluence.cfg.xml"
|
||||
echo "Unexpected value for keyType - ${keyType} to extract JWT key from confluence.cfg.xml"
|
||||
exit 1
|
||||
fi
|
||||
echo "cat //properties/property[@name='${keyType}']/text()" | xmllint --nocdata --shell ${ATL_CONFLUENCE_SHARED_CONFIG_FILE} | sed '1d;$d'
|
||||
@@ -30,23 +30,23 @@ function extractJWTKeyFromConfluenceConfig {
|
||||
# after admin will go through the setup and provide license. This function waits for the keys being available in the
|
||||
# config file.
|
||||
function waitForConfluenceConfigInSharedHome() {
|
||||
atl_log "=== BEGIN: Waiting for confluence.cfg.xml available in shared home folder ==="
|
||||
echo "=== BEGIN: Waiting for confluence.cfg.xml available in shared home folder ==="
|
||||
while [[ ! -f ${ATL_CONFLUENCE_SHARED_CONFIG_FILE} ]]; do
|
||||
sleep ${ATL_SYNCHRONY_WAITING_CONFIG_TIME}
|
||||
atl_log "====== : Keep waiting for ${ATL_SYNCHRONY_WAITING_CONFIG_TIME} seconds ======"
|
||||
echo "====== : Keep waiting for ${ATL_SYNCHRONY_WAITING_CONFIG_TIME} seconds ======"
|
||||
done
|
||||
|
||||
atl_log "====== : Fetching JWT keys from Confluence config... ======"
|
||||
echo "====== : Fetching JWT keys from Confluence config... ======"
|
||||
while [[ -z ${SYNCHRONY_JWT_PRIVATE_KEY} || -z ${SYNCHRONY_JWT_PUBLIC_KEY} ]]; do
|
||||
SYNCHRONY_JWT_PRIVATE_KEY=$(extractJWTKeyFromConfluenceConfig 'jwt.private.key') >> ${ATL_LOG} 2>&1
|
||||
SYNCHRONY_JWT_PUBLIC_KEY=$(extractJWTKeyFromConfluenceConfig 'jwt.public.key') >> ${ATL_LOG} 2>&1
|
||||
SYNCHRONY_JWT_PRIVATE_KEY=$(extractJWTKeyFromConfluenceConfig 'jwt.private.key') 2>&1
|
||||
SYNCHRONY_JWT_PUBLIC_KEY=$(extractJWTKeyFromConfluenceConfig 'jwt.public.key') 2>&1
|
||||
if [[ -z ${SYNCHRONY_JWT_PRIVATE_KEY} || -z ${SYNCHRONY_JWT_PUBLIC_KEY} ]]; then
|
||||
atl_log "====== : Could not load value for JWT key; will wait for next ${ATL_SYNCHRONY_WAITING_CONFIG_TIME} seconds before reload ======"
|
||||
echo "====== : Could not load value for JWT key; will wait for next ${ATL_SYNCHRONY_WAITING_CONFIG_TIME} seconds before reload ======"
|
||||
sleep ${ATL_SYNCHRONY_WAITING_CONFIG_TIME}
|
||||
fi
|
||||
done
|
||||
|
||||
atl_log "=== END: Waiting for confluence.cfg.xml available in shared home folder ==="
|
||||
echo "=== END: Waiting for confluence.cfg.xml available in shared home folder ==="
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user