teuton 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/learn/03-remote_hosts.md +11 -11
- data/lib/teuton/case/dsl/upload.rb +6 -6
- data/lib/teuton/case_manager/ext/report.rb +2 -2
- data/lib/teuton/version.rb +5 -5
- data/lib/teuton.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93e9ece06ffba48858ef89bfdf6e4e0cddd095d84f6a8fb3de32f1e0c2c713f7
|
|
4
|
+
data.tar.gz: a905a098f5ca254323d6eb1b72c4f9970b39082091cc17075f7c02f23cd87997
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 66f9d13f1526f42dd7d68e5e195e9bd304f152ba3447cdc723ed0f417dd299d848bc6867fcc5b03ef1d0848c541c545571e727fe65ec29782ab6944ec7f8beb1
|
|
7
|
+
data.tar.gz: 8b5e6b841e08a31f2cfbb76b40377b0dd2eaf63b021c458dfe6908ca04a077be6b61fd4a5e27a04e01d5b34fc62ff9a3fa9df1ecff3d207c2b8315a381f956e4
|
|
@@ -24,18 +24,19 @@ cases:
|
|
|
24
24
|
- tt_members: student_3
|
|
25
25
|
host1_ip: 127.0.0.1
|
|
26
26
|
host1_password: secret_3
|
|
27
|
+
tt_skip: true
|
|
27
28
|
```
|
|
28
29
|
|
|
29
|
-
Every remote host
|
|
30
|
+
Every remote host defines its owns params:
|
|
30
31
|
|
|
31
|
-
| Param
|
|
32
|
-
|
|
|
33
|
-
| ip
|
|
34
|
-
| port
|
|
32
|
+
| Param | Description | Default value |
|
|
33
|
+
| -------- | ------------------- | -------------- |
|
|
34
|
+
| ip | Remote host IP | IP or hostname |
|
|
35
|
+
| port | Remote host port | 22 |
|
|
35
36
|
| username | Remote user account | Not required with public SSH id |
|
|
36
37
|
| password | Remote user pasword | Not required with public SSH id |
|
|
37
|
-
| protocol | SSH or
|
|
38
|
-
| route
|
|
38
|
+
| protocol | SSH or Telnet | SSH |
|
|
39
|
+
| route | Defines intermediate host used as gateway to reach principal host | |
|
|
39
40
|
|
|
40
41
|
## Definition section
|
|
41
42
|
|
|
@@ -55,12 +56,12 @@ Execution:
|
|
|
55
56
|
|
|
56
57
|
```
|
|
57
58
|
$ teuton run examples/03-remote_hosts
|
|
58
|
-
|
|
59
|
+
|
|
59
60
|
CASE RESULTS
|
|
60
61
|
+------+-----------+-------+-------+
|
|
61
62
|
| CASE | MEMBERS | GRADE | STATE |
|
|
62
63
|
| 01 | student_1 | 0.0 | ? |
|
|
63
|
-
|
|
|
64
|
+
| - | - | 0.0 | S |
|
|
64
65
|
| 03 | student_3 | 100.0 | ✔ |
|
|
65
66
|
+------+-----------+-------+-------+
|
|
66
67
|
|
|
@@ -68,8 +69,8 @@ CONN ERRORS
|
|
|
68
69
|
+------+-----------+-------+------------------+
|
|
69
70
|
| CASE | MEMBERS | HOST | ERROR |
|
|
70
71
|
| 01 | student_1 | host1 | host_unreachable |
|
|
71
|
-
| 02 | student_2 | host1 | host_unreachable |
|
|
72
72
|
+------+-----------+-------+------------------+
|
|
73
|
+
|
|
73
74
|
```
|
|
74
75
|
|
|
75
76
|
Notice that case-03 is 100% and conection works. It is running on localhost because has localhost IP (127.0.0.1).
|
|
@@ -81,7 +82,6 @@ $ tree var/03-remote_hosts
|
|
|
81
82
|
|
|
82
83
|
var/03-remote_hosts
|
|
83
84
|
├── case-01.txt
|
|
84
|
-
├── case-02.txt
|
|
85
85
|
├── case-03.txt
|
|
86
86
|
├── moodle.csv
|
|
87
87
|
└── resume.txt
|
|
@@ -4,10 +4,10 @@ require_relative "../../utils/verbose"
|
|
|
4
4
|
module DSL
|
|
5
5
|
def upload(localfilter, args = {})
|
|
6
6
|
abslocalfilter = if File.absolute_path? localfilter
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
localfilter
|
|
8
|
+
else
|
|
9
|
+
File.join(Project.value[:project_path], localfilter)
|
|
10
|
+
end
|
|
11
11
|
|
|
12
12
|
Dir.glob(abslocalfilter).each do |abslocalpath|
|
|
13
13
|
upload_one(abslocalpath, args)
|
|
@@ -28,8 +28,8 @@ module DSL
|
|
|
28
28
|
Net::SFTP.start(
|
|
29
29
|
host.ip, host.username, password: host.password, port: host.port
|
|
30
30
|
) { |sftp| sftp.upload!(localpath, remotepath) }
|
|
31
|
-
verbose(Rainbow(Settings.letter
|
|
32
|
-
rescue => e
|
|
31
|
+
verbose(Rainbow(Settings.letter[:upload]).green)
|
|
32
|
+
rescue StandardError => e
|
|
33
33
|
log("Upload #{localfile} to #{host.ip}:#{remotepath}", :warn)
|
|
34
34
|
log(e.to_s, :warn)
|
|
35
35
|
verbose(Rainbow("!").green)
|
|
@@ -34,7 +34,7 @@ module ReportExtension
|
|
|
34
34
|
skip: true,
|
|
35
35
|
id: "-",
|
|
36
36
|
grade: 0.0,
|
|
37
|
-
letter: Settings.letter
|
|
37
|
+
letter: Settings.letter[:skip],
|
|
38
38
|
members: "-",
|
|
39
39
|
conn_status: {},
|
|
40
40
|
moodle_id: "",
|
|
@@ -42,7 +42,7 @@ module ReportExtension
|
|
|
42
42
|
}
|
|
43
43
|
else
|
|
44
44
|
line[:skip] = false
|
|
45
|
-
line[:id] = format("%<id>02d", {id: c.id.to_i})
|
|
45
|
+
line[:id] = format("%<id>02d", { id: c.id.to_i })
|
|
46
46
|
line[:letter] = Settings.letter[:cross] if c.grade.zero?
|
|
47
47
|
line[:letter] = Settings.letter[:error] if c.grade < 50.0
|
|
48
48
|
line[:letter] = Settings.letter[:ok] if c.grade.to_i == 100
|
data/lib/teuton/version.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Teuton
|
|
2
|
-
VERSION = "3.0.
|
|
3
|
-
APPNAME = "teuton"
|
|
4
|
-
GEMNAME = "teuton"
|
|
5
|
-
DOCKERNAME = "dvarrui/#{GEMNAME}"
|
|
6
|
-
HOMEPAGE = "https://github.com/teuton-software/teuton"
|
|
2
|
+
VERSION = "3.0.2".freeze
|
|
3
|
+
APPNAME = "teuton".freeze
|
|
4
|
+
GEMNAME = "teuton".freeze
|
|
5
|
+
DOCKERNAME = "dvarrui/#{GEMNAME}".freeze
|
|
6
|
+
HOMEPAGE = "https://github.com/teuton-software/teuton".freeze
|
|
7
7
|
end
|
data/lib/teuton.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require_relative "teuton/utils/project"
|
|
2
|
+
require_relative "teuton/version"
|
|
2
3
|
|
|
3
4
|
module Teuton
|
|
4
5
|
def self.create(path_to_new_dir)
|
|
@@ -41,10 +42,13 @@ module Teuton
|
|
|
41
42
|
# Load DSL file and then load script file
|
|
42
43
|
require_relative dslpath
|
|
43
44
|
begin
|
|
44
|
-
|
|
45
|
+
mainscriptfile = Project.value[:script_path]
|
|
46
|
+
require_relative mainscriptfile
|
|
45
47
|
rescue StandardError => e
|
|
46
|
-
warn Rainbow("[ERROR]
|
|
47
|
-
|
|
48
|
+
warn Rainbow("[ERROR] #{e}").bright.red
|
|
49
|
+
e.backtrace&.first(3)&.each do |line|
|
|
50
|
+
warn Rainbow("[ERROR] #{line}").red
|
|
51
|
+
end
|
|
48
52
|
exit 1
|
|
49
53
|
end
|
|
50
54
|
end
|