in src/main/java/com/microsoft/jenkins/appservice/WebAppDeploymentCommandContext.java [78:118]
public void configure(Run<?, ?> run, FilePath workspace, TaskListener listener, WebApp app) throws AzureCloudException {
if (StringUtils.isBlank(slotName)) {
// Deploy to default
pubProfile = app.getPublishingProfile();
} else {
// Deploy to slot
final DeploymentSlot slot = app.deploymentSlots().getByName(slotName);
if (slot == null) {
throw new AzureCloudException(String.format("Slot %s not found", slotName));
}
pubProfile = slot.getPublishingProfile();
}
HashMap<Class, TransitionInfo> commands = new HashMap<>();
Class startCommandClass;
if (StringUtils.isNotBlank(publishType) && publishType.equalsIgnoreCase(PUBLISH_TYPE_DOCKER)) {
startCommandClass = DockerBuildCommand.class;
this.webApp = app;
commands.put(DockerBuildCommand.class, new TransitionInfo(new DockerBuildCommand(), DockerPushCommand.class, null));
commands.put(DockerPushCommand.class, new TransitionInfo(new DockerPushCommand(), DockerDeployCommand.class, null));
if (deleteTempImage) {
commands.put(DockerDeployCommand.class, new TransitionInfo(new DockerDeployCommand(), DockerRemoveImageCommand.class, null));
commands.put(DockerRemoveImageCommand.class, new TransitionInfo(new DockerRemoveImageCommand(), null, null));
} else {
commands.put(DockerDeployCommand.class, new TransitionInfo(new DockerDeployCommand(), null, null));
}
} else if (app.javaVersion() != JavaVersion.OFF) {
// For Java application, use FTP-based deployment as it's the recommended way
startCommandClass = FTPDeployCommand.class;
commands.put(FTPDeployCommand.class, new TransitionInfo(new FTPDeployCommand(), null, null));
} else {
// For non-Java application, use Git-based deployment
startCommandClass = GitDeployCommand.class;
commands.put(GitDeployCommand.class, new TransitionInfo(new GitDeployCommand(), null, null));
}
super.configure(run, workspace, listener, commands, startCommandClass);
this.setDeploymentState(DeploymentState.Running);
}