Skip to content
Snippets Groups Projects
Commit 4f9d66f8 authored by juanf's avatar juanf
Browse files

SSDM-535: Keep custom html pages through an openBIS upgrade. (Pages restored by installer)

SVN: 31903
parent c4137626
No related branches found
No related tags found
No related merge requests found
......@@ -182,10 +182,28 @@ public class ExecuteSetupScriptsAction extends AbstractScriptExecutor implements
private void executRestoreConfigScript(AutomatedInstallData data)
{
String script = getAdminScript(data, RESTORE_CONFIG_FROM_BACKUP_SCRIPT);
String backupConfigFolder =
data.getVariable(GlobalInstallationContext.BACKUP_FOLDER_VARNAME)
+ "/config-backup";
String backupConfigFolder = data.getVariable(GlobalInstallationContext.BACKUP_FOLDER_VARNAME) + "/config-backup";
executeAdminScript(null, script, backupConfigFolder);
restoreCustomPagesFolder(data);
}
private void restoreCustomPagesFolder(AutomatedInstallData data)
{
File backupCustomPagesFolder = new File(data.getVariable(GlobalInstallationContext.BACKUP_FOLDER_VARNAME) + "/openBIS-server/jetty/webapps/openbis/custom");
if(!backupCustomPagesFolder.exists()) {
return;
}
System.out.println("Starting restoration of backup Pages Folder: " + backupCustomPagesFolder.getAbsolutePath());
File justInstalledPagesFolder = new File(data.getVariable(GlobalInstallationContext.BACKUP_FOLDER_VARNAME) + "/../../servers/openBIS-server/jetty/webapps/openbis/custom");
try
{
FileUtils.deleteDirectory(justInstalledPagesFolder);
FileUtils.copyDirectory(backupCustomPagesFolder, justInstalledPagesFolder);
System.out.println("Finished restoration of backup pages folder.");
} catch (IOException e)
{
System.out.println("Error restoring custom pages folder. ");
}
}
private void executePostInstallationScript(AutomatedInstallData data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment