[why] user can choose when to ssh, use ssh.yaml is ssh when task normal finish use ssh-on-fail.yaml is ssh when task is failed use ssh-always is ssh always whether task is failed or not.
[usage] submit -i ssh.yaml job.yaml
Signed-off-by: Wei Jihui weijihuiall@163.com --- jobs/ssh-always.yaml | 4 ++++ jobs/ssh-on-fail.yaml | 12 ++++++++++++ jobs/{fault_reproduction.yaml => ssh.yaml} | 4 ---- 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 jobs/ssh-always.yaml create mode 100644 jobs/ssh-on-fail.yaml rename jobs/{fault_reproduction.yaml => ssh.yaml} (80%)
diff --git a/jobs/ssh-always.yaml b/jobs/ssh-always.yaml new file mode 100644 index 00000000..0166fe12 --- /dev/null +++ b/jobs/ssh-always.yaml @@ -0,0 +1,4 @@ +# ssh to testbox and sleep always + +<< : jobs/ssh.yaml +<< : jobs/ssh-on-fail.yaml diff --git a/jobs/ssh-on-fail.yaml b/jobs/ssh-on-fail.yaml new file mode 100644 index 00000000..5f28d001 --- /dev/null +++ b/jobs/ssh-on-fail.yaml @@ -0,0 +1,12 @@ +ssh_pub_key: + <%= + begin + File.read("#{ENV['HOME']}/.ssh/id_rsa.pub").chomp + rescue + nil + end + %> + +on_fail: + sshd: + sleep: 6h diff --git a/jobs/fault_reproduction.yaml b/jobs/ssh.yaml similarity index 80% rename from jobs/fault_reproduction.yaml rename to jobs/ssh.yaml index 46a1e042..11e5b175 100644 --- a/jobs/fault_reproduction.yaml +++ b/jobs/ssh.yaml @@ -8,7 +8,3 @@ ssh_pub_key: %> sshd: sleep: 6h - -on_fail: - sshd: - sleep: 6h