im creating a groovy script for executing sql scripts from the docker container. This is my command that i want to execute
docker exec -i wienerberger_generalshale_com mysql -u root -proot -r < 001_CategorySamples.sql generalshale_website
And it works when i execute it from terminal, but when i call my groovy script which execute that line too, i get a mysql help as result, like if the command is not right.
This is how i execute the command from groovy:
def command = "docker exec -i wienerberger_generalshale_com mysql -u root -proot -r < 001_CategorySamples.sql generalshale_website"
def proc = command.execute();
def outputStream = new StringBuffer();
proc.waitForProcessOutput(outputStream, System.err);
println(outputStream .toString());
Does anybody know why the result is not the same or why the command is not recognized?