Please ignore my views: wrong for this patch.
Thanks, RenWen
On Mon, Jan 18, 2021 at 10:16:24AM +0800, Ren Wen wrote:
On Sat, Jan 16, 2021 at 03:03:02PM +0800, Wei Jihui wrote:
[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.
Using ssh|ssh-on-fail|ssh-always may be suitable.
[usage] submit -i ssh.yaml job.yaml
-i ssh?
Thanks, RenWen
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
-- 2.23.0