Skip to content

Commit

Permalink
Merge pull request #207 from cloudogu/feature/fix-endless-loop-remote
Browse files Browse the repository at this point in the history
Fix startup error with --remote
Tested with current MN CES Setup.
  • Loading branch information
pwrdeli committed Jul 17, 2024
2 parents 5355320 + 6e477eb commit f078e66
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion scripts/scm-manager/init-scmm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ function initSCMM() {
SCMM_HOST=$(getHost "${SCMM_URL}")
SCMM_PROTOCOL=$(getProtocol "${SCMM_URL}")

setExternalHostnameIfNecessary 'SCMM' 'scmm-scm-manager' 'default'
if [[ ${INTERNAL_SCMM} == true ]]; then
setExternalHostnameIfNecessary 'SCMM' 'scmm-scm-manager' 'default'
fi

[[ "${SCMM_URL}" != *scm ]] && SCMM_URL=${SCMM_URL}/scm

configureScmmManager "${SCMM_USERNAME}" "${SCMM_PASSWORD}" "${SCMM_URL}" "${JENKINS_URL_FOR_SCMM}" \
Expand Down
7 changes: 2 additions & 5 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,10 @@ function setExternalHostnameIfNecessary() {
local serviceName="$2"
local namespace="$3"

# :-} expands to empty string, e.g. for INTERNAL_ARGO which does not exist.
# This only works when checking for != false 😬
if [[ $REMOTE_CLUSTER == true && "$(eval echo "\${INTERNAL_${variablePrefix}:-}")" != 'false' ]]; then
# Update SCMM_URL or JENKINS_URL or ARGOCD_URL
if [[ $REMOTE_CLUSTER == true ]]; then
# Update SCMM_URL or JENKINS_URL
# Only if apps are not external
# Our apps are configured to use port 80 on remote clusters
# Argo forwards to HTTPS so simply use HTTP here
declare -g "${variablePrefix}_URL"="http://$(getExternalIP "${serviceName}" "${namespace}")"
fi
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class ScmManager extends Feature {
SCMM_USERNAME : config.scmm['username'],
SCMM_PASSWORD : config.scmm['password'],
JENKINS_URL : config.jenkins['url'],
INTERNAL_SCMM : config.scmm['internal'],
JENKINS_URL_FOR_SCMM : config.jenkins['urlForScmm'],
SCMM_URL_FOR_JENKINS : config.scmm['urlForJenkins'],
// Used indirectly in utils.sh 😬
Expand Down

0 comments on commit f078e66

Please sign in to comment.