engine: Abort job if dependency job did not succeed

Change-Id: I6c677f4a0f4fb4ccc3384c16e955991793bb564d
diff --git a/jjb/engine/scripts/generate-ssh-keypair.sh b/jjb/engine/scripts/generate-ssh-keypair.sh
index 04633fd..00f8336 100755
--- a/jjb/engine/scripts/generate-ssh-keypair.sh
+++ b/jjb/engine/scripts/generate-ssh-keypair.sh
@@ -22,6 +22,8 @@
 set -o errexit
 set -o pipefail
 
-echo "Info  : Generating SSH keypair for the job"
-ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N '' <<< y > /dev/null 2>&1
-chmod -R go-rwx ~/.ssh
+if [[ ! -f "$HOME/.ssh/id_rsa" ]]; then
+  echo "Info  : Generating SSH keypair for the job"
+  ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N '' <<< y > /dev/null 2>&1
+  chmod -R go-rwx ~/.ssh
+fi