Skip to content

Commit

Permalink
Merge changes If04bc24b,Id0a98699
Browse files Browse the repository at this point in the history
* changes:
  Fix issues with windows bat start scripts
  No longer install during replace - node synchronizer does this now
  • Loading branch information
mduft authored and Gerrit committed Jun 19, 2024
2 parents 8f0c29b + ad749b3 commit 7e32f7a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import io.bdeploy.common.ActivityReporter.Activity;
import io.bdeploy.common.Version;
import io.bdeploy.common.audit.Auditor;
import io.bdeploy.common.cfg.Configuration.EnvironmentFallback;
import io.bdeploy.common.cfg.Configuration.Help;
import io.bdeploy.common.cfg.Configuration.RemainingArguments;
import io.bdeploy.common.cfg.Configuration.Validator;
Expand Down Expand Up @@ -161,9 +162,11 @@ public class LauncherTool extends ConfiguredCliTool<LauncherConfig> {
String launch();

@Help("Directory where the launcher stores the hive as well as all applications.")
@EnvironmentFallback("BDEPLOY_INTERNAL_HOMEDIR")
String homeDir();

@Help("Set by the launcher script to determine the directory where to put updates for automatic application.")
@EnvironmentFallback("BDEPLOY_INTERNAL_UPDATEDIR")
String updateDir();

@Help(value = "Additional command line arguments for the application. The arguments must be a Base64 encoded JSON list.")
Expand Down Expand Up @@ -1185,7 +1188,6 @@ private Process doDelegateLaunch(Version version, String appDescriptor) {
if (isNewScriptLauncher) {
command.add("launcher");
command.add("--launch=" + appDescriptor);
command.add("--homeDir=" + homeDir.normalize().toAbsolutePath());
} else {
command.add(appDescriptor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import io.bdeploy.common.audit.Auditor;
import io.bdeploy.common.util.OsHelper;
import io.bdeploy.common.util.OsHelper.OperatingSystem;
import io.bdeploy.interfaces.descriptor.client.ClickAndStartDescriptor;
import io.bdeploy.launcher.LocalClientApplicationSettings;
import io.bdeploy.launcher.LocalClientApplicationSettings.ScriptInfo;
import io.bdeploy.launcher.cli.ClientApplicationDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ protected String getScriptContent() {
if (os == OperatingSystem.WINDOWS) {
return "@echo off\n"//
+ '"' + ClientPathHelper.getScriptLauncher(launcherDir).toAbsolutePath() + "\" \"launcher\" \"--launch="
+ appDir.resolve(ClientPathHelper.LAUNCH_FILE_NAME).toAbsolutePath() + "\" \"--homeDir="
+ launcherDir.toAbsolutePath() + "\" --noSplash -- %*";
+ appDir.resolve(ClientPathHelper.LAUNCH_FILE_NAME).toAbsolutePath() + "\" --noSplash -- %*";
}
return "#!/usr/bin/env bash\n" //
+ ClientPathHelper.getScriptLauncher(launcherDir).toAbsolutePath() + " launcher \"--launch="
Expand Down
1 change: 1 addition & 0 deletions minion/src/main/java/io/bdeploy/minion/cli/InitTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public class InitTool extends ConfiguredCliTool<InitConfig> {
String nodeIdentFile();

@Help("Internal update directory.")
@EnvironmentFallback("BDEPLOY_INTERNAL_UPDATEDIR")
String updateDir();

@Help("Port that the master will run on.")
Expand Down
1 change: 1 addition & 0 deletions minion/src/main/java/io/bdeploy/minion/cli/StartTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public class StartTool extends ConfiguredCliTool<MasterConfig> {
String root();

@Help("Specify the directory where any incoming updates should be placed in.")
@EnvironmentFallback("BDEPLOY_INTERNAL_UPDATEDIR")
String updateDir();

@Help(value = "Publish the web application, defaults to true.", arg = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,32 +432,7 @@ public void replaceNode(String name, RemoteService minion) {
// 1. update the node configuration. this also forces contact with the node to be established.
editNode(name, minion);

// 3. find all instances in which the node participates.
Map<String, NodeGroupState> toReinstall = getInstancesToReinstall(name);

// 4. trigger re-install of all software.
for (var entry : toReinstall.entrySet()) {
String group = entry.getKey();
NodeGroupState ngs = entry.getValue();

BHive hive = registry.get(group);

for (var instanceEntry : ngs.instances.entrySet()) {
String instanceId = instanceEntry.getKey();
NodeInstanceState nis = instanceEntry.getValue();

MasterNamedResource mnr = getNamedMaster(group);

for (var instanceTag : nis.installed) {
InstanceManifest iim = InstanceManifest.load(hive, instanceId, instanceTag);

mnr.install(iim.getManifest());
if (instanceTag.equals(nis.active)) {
mnr.activate(iim.getManifest());
}
}
}
}
// And now we're done, as the node synchronizer will take care of the rest asynchronously.
}
}

Expand Down
4 changes: 3 additions & 1 deletion templates/scripts/windowsUpdateStartScript.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ if NOT "%ERRORLEVEL%" == "0" (

@rem Execute ${applicationName} (--updateDir BDEPLOY EXTENSION)
@rem echo "Starting minion with embedded JVM."
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath %CLASSPATH% ${mainClassName} "--updateDir=%APP_HOME%\\update" %CMD_LINE_ARGS%
set "BDEPLOY_INTERNAL_UPDATEDIR=%APP_HOME%\\update"
set "BDEPLOY_INTERNAL_HOMEDIR=%APP_HOME%"
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath %CLASSPATH% ${mainClassName} %CMD_LINE_ARGS%

@rem update requested (exit code == 42)
IF NOT "%ERRORLEVEL%"=="42" (
Expand Down

0 comments on commit 7e32f7a

Please sign in to comment.