我正在尝试使用Easy Deploy Bundle部署我的Symfony App。
但是在运行命令 private void runCMD(String CMD) throws IOException, InterruptedException {
System.out.println("Standard output: " + CMD);
Process process = Runtime.getRuntime().exec(CMD);
// Get input streams
BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream()));
String line = "";
String newLineCharacter = System.getProperty("line.separator");
boolean isOutReady = false;
boolean isErrorReady = false;
boolean isProcessAlive = false;
boolean isErrorOut = true;
boolean isErrorError = true;
System.out.println("Read command ");
while (process.isAlive()) {
//Read the stdOut
do {
isOutReady = stdInput.ready();
//System.out.println("OUT READY " + isOutReady);
isErrorOut = true;
isErrorError = true;
if (isOutReady) {
line = stdInput.readLine();
isErrorOut = false;
System.out.println("=====================================================================================" + line + newLineCharacter);
}
isErrorReady = stdError.ready();
//System.out.println("ERROR READY " + isErrorReady);
if (isErrorReady) {
line = stdError.readLine();
isErrorError = false;
System.out.println("ERROR::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" + line + newLineCharacter);
}
isProcessAlive = process.isAlive();
//System.out.println("Process Alive " + isProcessAlive);
if (!isProcessAlive) {
System.out.println(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Process DIE " + line + newLineCharacter);
line = null;
isErrorError = false;
process.waitFor(1000, TimeUnit.MILLISECONDS);
}
} while (line != null);
//Nothing else to read, lets pause for a bit before trying again
System.out.println("PROCESS WAIT FOR");
process.waitFor(100, TimeUnit.MILLISECONDS);
}
System.out.println("Command finished");
}
之后发生了错误:
php bin/console deploy stable
我认为ssh配置还可以。 (The command "cd D:\MySymfonyApp && where ssh" failed.
Exit Code: 1(General error)
Working directory: D:\MySymfonyApp
Output:
================
Error Output:
================
INFO: Could not find files for the given pattern(s).
返回cd D:\MySymfonyApp && where ssh
我尝试在Windows 10上运行它。(symfony 4.1)
答案 0 :(得分:0)
似乎未设置会话变量,也未找到ssh二进制文件。
You can fix them或...
我的建议是to install ubuntu's terminal inside your Windows 10.
您将在/ mount找到文件
cd /mnt/d
我目前using deployer.org,对此我感到非常满意,它对于Laravel / Symfony有很多要求,您可以在完成新部署后触发Telegram或Slack通知。 (还有很多其他东西)