Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK-345 - Spa Installer does not remove previously deployed frontend … #304

Merged
merged 5 commits into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.io.MoreFiles;
import com.google.common.io.RecursiveDeleteOption;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.plugin.MojoExecutionException;
import org.openmrs.maven.plugins.model.Artifact;
Expand Down Expand Up @@ -44,7 +45,7 @@ public class SpaInstaller {
private final ModuleInstaller moduleInstaller;

private final Wizard wizard;

private static final Logger logger = LoggerFactory.getLogger(SpaInstaller.class);

public SpaInstaller(DistroHelper distroHelper, NodeHelper nodeHelper) {
Expand All @@ -65,16 +66,22 @@ public SpaInstaller(DistroHelper distroHelper, NodeHelper nodeHelper, ModuleInst
* @param distroProperties Non-null
* @throws MojoExecutionException
*/
public void installFromDistroProperties(File appDataDir, DistroProperties distroProperties)
throws MojoExecutionException {

public void installFromDistroProperties(File appDataDir, DistroProperties distroProperties) throws MojoExecutionException {
installFromDistroProperties(appDataDir, distroProperties, false, null);
}

public void installFromDistroProperties(File appDataDir, DistroProperties distroProperties, boolean ignorePeerDependencies, Boolean overrideReuseNodeCache)
throws MojoExecutionException {

File buildTargetDir = new File(appDataDir, BUILD_TARGET_DIR);
if (buildTargetDir.exists()) {
try {
FileUtils.deleteDirectory(buildTargetDir);
}
catch (IOException e) {
throw new MojoExecutionException("Unable to delete existing " + BUILD_TARGET_DIR + " directory", e);
}
}

// Retrieve the properties with a spa. prefix out of the distro properties
Map<String, String> spaProperties = distroProperties.getSpaProperties(distroHelper, appDataDir);
Expand Down
Loading