Skip to content

Commit

Permalink
PAAS-2721: fix upgrade issue when tomcat filtering is on
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-gagnon authored and kevinvandel committed Dec 4, 2023
1 parent de0438c commit 4ff5da2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/jahia/disable-tomcat-filtering.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,14 @@ onInstall:
mv /etc/datadog-agent/conf.d/squid.d/conf.yaml /etc/datadog-agent/conf.d/squid.d/conf.yaml-disabled
systemctl restart datadog-agent
- setGlobalRepoRootUrl
- install:
jps: "${globals.repoRootUrl}/packages/jahia/jahia-rolling-restart.yml"
- if(! ${settings.skipRestart}):
- install:
jps: "${globals.repoRootUrl}/packages/jahia/jahia-rolling-restart.yml"

settings:
fields:
- name: skipRestart
type: checkbox
caption: Skip the rolling restart
default: false
required: false
14 changes: 14 additions & 0 deletions packages/jahia/rolling-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ mixins:
- ../../mixins/jahia.yml

onInstall:
# Remove tomcat filtering if enabled
- api: env.control.GetContainerEnvVarsByGroup
nodeGroup: proc
- if ("${response.object.tomcat_cfg_cloud_filtering}" == "true"):
- setGlobals:
tomcatFiltering: true
- if(globals.tomcatFiltering):
- setGlobalRepoRootUrl
- install:
jps: "${globals.repoRootUrl}/packages/jahia/disable-tomcat-filtering.yaml"
# Dump modules state
- dumpModules:
operation: upgrade
Expand All @@ -37,6 +47,10 @@ onInstall:
- checkModulesAfterOperation:
operation: upgrade
checkVersion: false
# Re-enable tomcat filtering if needed
- if(globals.tomcatFiltering):
- install:
jps: "${globals.repoRootUrl}/packages/jahia/enable-tomcat-filtering.yaml"

settings:
fields:
Expand Down
18 changes: 18 additions & 0 deletions packages/jahia/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ onInstall:
- set:
targetDockerTag: ${settings.targetVersion}_${settings.dockerTagSuffix}

# Remove tomcat filtering if enabled
- api: env.control.GetContainerEnvVarsByGroup
nodeGroup: proc
- if ("${response.object.tomcat_cfg_cloud_filtering}" == "true"):
- setGlobals:
tomcatFiltering: true
- if(globals.tomcatFiltering):
- setGlobalRepoRootUrl
- install:
jps: "${globals.repoRootUrl}/packages/jahia/disable-tomcat-filtering.yaml"
settings:
skipRestart: true

# Upgrade Jahia nodes (all Jahia nodes must be stopped first)
- cmd [cp, proc]:
- service tomcat stop
Expand Down Expand Up @@ -86,6 +99,11 @@ onInstall:
operation: upgrade
checkVersion: false

# Re-enable tomcat filtering if needed
- if(globals.tomcatFiltering):
- install:
jps: "${globals.repoRootUrl}/packages/jahia/enable-tomcat-filtering.yaml"

# Unmute monitors
- unmuteEnvWideMonitors
- unmuteDatadogSynthetics
Expand Down

0 comments on commit 4ff5da2

Please sign in to comment.