From 41cf8f98bf54dcf70c9af207f6e19d57812e2133 Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Sat, 26 Sep 2015 22:30:55 -0300 Subject: [PATCH] Allows deployment scripts to be interactive Previously, because we were piping the compiled script blob over ssh to decompress over there without creating an intermediated bundled file, we were allocating the stdin of the ssh session to have the read from the pipe. This blocked the allocation of the /dev/tty over the session and prevented users to interact with the script. We would like some of the interactions to work, like prompting for a confirmation or typing a password. To fix this, the deployment process was split in two steps. The first step still receives the bundled file over a pipe, decompresses it on a temprary folder, and outputs the location of the deployment folder. We grab this output to feed on the second step, which has a script to go to the deployment folder and start the execution. Now, roles can make use of read, as well as sudo with password. --- lib/kickstart-deploy | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/kickstart-deploy b/lib/kickstart-deploy index a33df8e..68d89c7 100755 --- a/lib/kickstart-deploy +++ b/lib/kickstart-deploy @@ -9,20 +9,30 @@ shift [ "$DEBUG" ] && debug="-x" -remote_command=$( +kickstart compile "$@" + +copy_command=$( cat <