machinery-tool 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +7 -0
  2. data/COPYING +674 -0
  3. data/NEWS +143 -0
  4. data/bin/machinery +29 -0
  5. data/helpers/changed_managed_files.sh +32 -0
  6. data/helpers/filter-packages-for-build.yaml +6 -0
  7. data/html/assets/arrow_down.png +0 -0
  8. data/html/assets/arrow_up.png +0 -0
  9. data/html/assets/bootstrap-popover.js +113 -0
  10. data/html/assets/bootstrap-tooltip.js +457 -0
  11. data/html/assets/bootstrap.min.css +5 -0
  12. data/html/assets/collapse.js +174 -0
  13. data/html/assets/hogan-3.0.2.min.mustache.js +5 -0
  14. data/html/assets/jquery-2.1.1.min.js +4 -0
  15. data/html/assets/logo-changed-managed-files-small.png +0 -0
  16. data/html/assets/logo-changed-managed-files.png +0 -0
  17. data/html/assets/logo-config-files-small.png +0 -0
  18. data/html/assets/logo-config-files.png +0 -0
  19. data/html/assets/logo-groups-small.png +0 -0
  20. data/html/assets/logo-groups.png +0 -0
  21. data/html/assets/logo-os-small.png +0 -0
  22. data/html/assets/logo-os.png +0 -0
  23. data/html/assets/logo-packages-small.png +0 -0
  24. data/html/assets/logo-packages.png +0 -0
  25. data/html/assets/logo-patterns-small.png +0 -0
  26. data/html/assets/logo-patterns.png +0 -0
  27. data/html/assets/logo-repositories-small.png +0 -0
  28. data/html/assets/logo-repositories.png +0 -0
  29. data/html/assets/logo-services-small.png +0 -0
  30. data/html/assets/logo-services.png +0 -0
  31. data/html/assets/logo-unmanaged-files-small.png +0 -0
  32. data/html/assets/logo-unmanaged-files.png +0 -0
  33. data/html/assets/logo-users-small.png +0 -0
  34. data/html/assets/logo-users.png +0 -0
  35. data/html/assets/machinery-base.css +5767 -0
  36. data/html/assets/machinery.css +131 -0
  37. data/html/assets/machinery.js +148 -0
  38. data/html/assets/transition.js +59 -0
  39. data/html/assets/wheels_horizontal.png +0 -0
  40. data/html/index.html.haml +468 -0
  41. data/kiwi_helpers/kiwi_export_readme.md +22 -0
  42. data/kiwi_helpers/merge_users_and_groups.pl.erb +231 -0
  43. data/kiwi_helpers/unmanaged_files_build_excludes +5 -0
  44. data/lib/analyze_config_file_diffs_task.rb +130 -0
  45. data/lib/array.rb +98 -0
  46. data/lib/build_task.rb +124 -0
  47. data/lib/changed_rpm_files_helper.rb +96 -0
  48. data/lib/cli.rb +600 -0
  49. data/lib/compare_task.rb +68 -0
  50. data/lib/config.rb +33 -0
  51. data/lib/config_base.rb +117 -0
  52. data/lib/config_task.rb +56 -0
  53. data/lib/constants.rb +24 -0
  54. data/lib/copy_task.rb +22 -0
  55. data/lib/current_user.rb +23 -0
  56. data/lib/deploy_task.rb +89 -0
  57. data/lib/exceptions.rb +113 -0
  58. data/lib/generate_html_task.rb +22 -0
  59. data/lib/helper.rb +22 -0
  60. data/lib/hint.rb +39 -0
  61. data/lib/html.rb +103 -0
  62. data/lib/inspect_task.rb +93 -0
  63. data/lib/inspector.rb +65 -0
  64. data/lib/kiwi_config.rb +356 -0
  65. data/lib/kiwi_export_task.rb +36 -0
  66. data/lib/list_task.rb +64 -0
  67. data/lib/local_system.rb +127 -0
  68. data/lib/logged_cheetah.rb +25 -0
  69. data/lib/machinery.rb +85 -0
  70. data/lib/machinery_logger.rb +47 -0
  71. data/lib/migration.rb +128 -0
  72. data/lib/mountpoints.rb +72 -0
  73. data/lib/object.rb +138 -0
  74. data/lib/os.rb +78 -0
  75. data/lib/remote_system.rb +114 -0
  76. data/lib/remove_task.rb +43 -0
  77. data/lib/renderer.rb +243 -0
  78. data/lib/renderer_helper.rb +26 -0
  79. data/lib/rpm.rb +52 -0
  80. data/lib/scope_mixin.rb +38 -0
  81. data/lib/show_task.rb +65 -0
  82. data/lib/system.rb +81 -0
  83. data/lib/system_description.rb +228 -0
  84. data/lib/system_description_store.rb +167 -0
  85. data/lib/system_description_validator.rb +216 -0
  86. data/lib/tarball.rb +82 -0
  87. data/lib/ui.rb +74 -0
  88. data/lib/upgrade_format_task.rb +55 -0
  89. data/lib/validate_task.rb +23 -0
  90. data/lib/version.rb +22 -0
  91. data/lib/zypper.rb +70 -0
  92. data/man/generated/machinery.1.gz +0 -0
  93. data/man/generated/machinery.1.html +1056 -0
  94. data/plugins/docs/changed_managed_files.md +2 -0
  95. data/plugins/docs/config_files.md +5 -0
  96. data/plugins/docs/groups.md +2 -0
  97. data/plugins/docs/os.md +2 -0
  98. data/plugins/docs/packages.md +2 -0
  99. data/plugins/docs/patterns.md +5 -0
  100. data/plugins/docs/repositories.md +24 -0
  101. data/plugins/docs/services.md +6 -0
  102. data/plugins/docs/unmanaged_files.md +13 -0
  103. data/plugins/docs/users.md +3 -0
  104. data/plugins/inspect/changed_managed_files_inspector.rb +109 -0
  105. data/plugins/inspect/config_files_inspector.rb +117 -0
  106. data/plugins/inspect/groups_inspector.rb +46 -0
  107. data/plugins/inspect/os_inspector.rb +116 -0
  108. data/plugins/inspect/packages_inspector.rb +46 -0
  109. data/plugins/inspect/patterns_inspector.rb +67 -0
  110. data/plugins/inspect/repositories_inspector.rb +107 -0
  111. data/plugins/inspect/services_inspector.rb +88 -0
  112. data/plugins/inspect/unmanaged_files_inspector.rb +393 -0
  113. data/plugins/inspect/users_inspector.rb +87 -0
  114. data/plugins/model/changed_managed_files_model.rb +29 -0
  115. data/plugins/model/config_files_model.rb +29 -0
  116. data/plugins/model/groups_model.rb +26 -0
  117. data/plugins/model/os_model.rb +20 -0
  118. data/plugins/model/packages_model.rb +26 -0
  119. data/plugins/model/patterns_model.rb +26 -0
  120. data/plugins/model/repositories_model.rb +26 -0
  121. data/plugins/model/services_model.rb +48 -0
  122. data/plugins/model/unmanaged_files_model.rb +29 -0
  123. data/plugins/model/users_model.rb +26 -0
  124. data/plugins/schema/v1/system-description-changed-managed-files.schema.json +83 -0
  125. data/plugins/schema/v1/system-description-config-files.schema.json +83 -0
  126. data/plugins/schema/v1/system-description-groups.schema.json +30 -0
  127. data/plugins/schema/v1/system-description-os.schema.json +21 -0
  128. data/plugins/schema/v1/system-description-packages.schema.json +34 -0
  129. data/plugins/schema/v1/system-description-patterns.schema.json +24 -0
  130. data/plugins/schema/v1/system-description-repositories.schema.json +41 -0
  131. data/plugins/schema/v1/system-description-services.schema.json +30 -0
  132. data/plugins/schema/v1/system-description-unmanaged-files.schema.json +105 -0
  133. data/plugins/schema/v1/system-description-users.schema.json +61 -0
  134. data/plugins/schema/v2/system-description-changed-managed-files.schema.json +92 -0
  135. data/plugins/schema/v2/system-description-config-files.schema.json +92 -0
  136. data/plugins/schema/v2/system-description-groups.schema.json +30 -0
  137. data/plugins/schema/v2/system-description-os.schema.json +21 -0
  138. data/plugins/schema/v2/system-description-packages.schema.json +34 -0
  139. data/plugins/schema/v2/system-description-patterns.schema.json +24 -0
  140. data/plugins/schema/v2/system-description-repositories.schema.json +41 -0
  141. data/plugins/schema/v2/system-description-services.schema.json +30 -0
  142. data/plugins/schema/v2/system-description-unmanaged-files.schema.json +138 -0
  143. data/plugins/schema/v2/system-description-users.schema.json +61 -0
  144. data/plugins/show/changed_managed_files_renderer.rb +46 -0
  145. data/plugins/show/config_files_renderer.rb +62 -0
  146. data/plugins/show/groups_renderer.rb +36 -0
  147. data/plugins/show/os_renderer.rb +31 -0
  148. data/plugins/show/packages_renderer.rb +32 -0
  149. data/plugins/show/patterns_renderer.rb +32 -0
  150. data/plugins/show/repositories_renderer.rb +38 -0
  151. data/plugins/show/services_renderer.rb +32 -0
  152. data/plugins/show/unmanaged_files_renderer.rb +42 -0
  153. data/plugins/show/users_renderer.rb +35 -0
  154. data/schema/migrations/migrate1to2.rb +56 -0
  155. data/schema/v1/system-description-global.schema.json +31 -0
  156. data/schema/v2/system-description-global.schema.json +31 -0
  157. metadata +370 -0
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "items" : {
6
+ "type": "object",
7
+ "required": ["name", "package_name", "package_version"],
8
+ "properties": {
9
+ "name": {
10
+ "type": "string"
11
+ },
12
+ "package_name": {
13
+ "type": "string",
14
+ "minLength": 1
15
+ },
16
+ "package_version": {
17
+ "type": "string",
18
+ "minLength": 1
19
+ }
20
+ },
21
+ "oneOf": [
22
+ { "$ref": "#/definitions/file_changed" },
23
+ { "$ref": "#/definitions/file_error" }
24
+ ]
25
+ },
26
+ "definitions": {
27
+ "file_changed": {
28
+ "required": ["status"],
29
+ "properties": {
30
+ "status": {
31
+ "enum": ["changed"]
32
+ }
33
+ },
34
+ "oneOf": [
35
+ { "$ref": "#/definitions/file_changed_modified" },
36
+ { "$ref": "#/definitions/file_changed_deleted" }
37
+ ]
38
+ },
39
+ "file_changed_modified": {
40
+ "required": ["changes", "mode", "user", "group"],
41
+ "properties": {
42
+ "changes": {
43
+ "type": "array",
44
+ "items": {
45
+ "enum": ["mode", "md5", "group", "user", "replaced"]
46
+ },
47
+ "minItems": 1
48
+ },
49
+ "mode": {
50
+ "type": "string",
51
+ "pattern": "^[0-4]?[0-7]{3}$"
52
+ },
53
+ "user": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ },
57
+ "group": {
58
+ "type": "string",
59
+ "minLength": 1
60
+ }
61
+ }
62
+ },
63
+ "file_changed_deleted": {
64
+ "required": ["changes"],
65
+ "properties": {
66
+ "changes": {
67
+ "enum": [["deleted"]]
68
+ }
69
+ }
70
+ },
71
+ "file_error": {
72
+ "required": ["status", "error_message"],
73
+ "properties": {
74
+ "status": {
75
+ "enum": ["error"]
76
+ },
77
+ "error_message": {
78
+ "type": "string"
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "items": {
6
+ "type": "object",
7
+ "required": ["name", "password", "gid", "users"],
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "password": {
14
+ "type": "string"
15
+ },
16
+ "gid": {
17
+ "type": ["integer", "null"],
18
+ "minimum": 0
19
+ },
20
+ "users": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "string",
24
+ "minLength": 1
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "object",
5
+ "required": ["name", "version", "architecture"],
6
+ "properties": {
7
+ "name": {
8
+ "type": ["string", "null"],
9
+ "minLength": 1
10
+ },
11
+ "version": {
12
+ "type": ["string", "null"],
13
+ "minLength": 1
14
+ },
15
+ "architecture": {
16
+ "type": ["string", "null"],
17
+ "minLength": 1
18
+ }
19
+ }
20
+ }
21
+
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "items": {
6
+ "type": "object",
7
+ "required": ["name", "version", "release", "arch", "vendor", "checksum"],
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "version": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "release": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "arch": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ },
25
+ "vendor": {
26
+ "type": "string"
27
+ },
28
+ "checksum": {
29
+ "type": "string",
30
+ "pattern": "^[a-f0-9]+$"
31
+ }
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "items" : {
6
+ "type" : "object",
7
+ "required": ["name", "version", "release"],
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "version": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "release": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ }
21
+ }
22
+ }
23
+ }
24
+
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "items" : {
6
+ "type" : "object",
7
+ "required": ["alias", "name", "url", "type", "enabled", "autorefresh", "gpgcheck", "priority"],
8
+ "properties": {
9
+ "alias": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "name": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "type": {
18
+ "enum": ["yast2", "rpm-md", "plaindir", null]
19
+ },
20
+ "url": {
21
+ "type": "string",
22
+ "format": "uri",
23
+ "minLength": 1
24
+ },
25
+ "enabled": {
26
+ "type": "boolean"
27
+ },
28
+ "autorefresh": {
29
+ "type": "boolean"
30
+ },
31
+ "gpgcheck": {
32
+ "type": "boolean"
33
+ },
34
+ "priority": {
35
+ "type": "integer",
36
+ "minimum": 1
37
+ }
38
+ }
39
+ }
40
+ }
41
+
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "object",
5
+ "required": ["init_system", "services"],
6
+ "properties": {
7
+ "init_system": {
8
+ "type": "string",
9
+ "minLength": 1
10
+ },
11
+ "services": {
12
+ "type": "array",
13
+ "items": {
14
+ "type": "object",
15
+ "required": ["name", "state"],
16
+ "properties": {
17
+ "name": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "state": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ }
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+
@@ -0,0 +1,105 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "oneOf": [
6
+ {
7
+ "items": {
8
+ "allOf": [
9
+ { "$ref": "#/definitions/file_common" },
10
+ { "$ref": "#/definitions/file_not_extracted" }
11
+ ]
12
+ }
13
+ },
14
+ {
15
+ "items": {
16
+ "allOf": [
17
+ { "$ref": "#/definitions/file_common" },
18
+ { "$ref": "#/definitions/file_extracted" }
19
+ ]
20
+ }
21
+ }
22
+ ],
23
+ "definitions": {
24
+ "file_common": {
25
+ "type": "object",
26
+ "required": ["name"],
27
+ "properties": {
28
+ "name": {
29
+ "type": "string"
30
+ }
31
+ }
32
+ },
33
+ "file_not_extracted": {
34
+ "required": ["type"],
35
+ "properties": {
36
+ "type": {
37
+ "enum": ["file", "dir", "link"]
38
+ }
39
+ },
40
+ "not": { "$ref": "#/definitions/file_extracted" }
41
+ },
42
+ "file_extracted": {
43
+ "required": ["user", "group"],
44
+ "properties": {
45
+ "user": {
46
+ "type": "string",
47
+ "minLength": 1
48
+ },
49
+ "group": {
50
+ "type": "string",
51
+ "minLength": 1
52
+ }
53
+ },
54
+ "oneOf": [
55
+ { "$ref": "#/definitions/file_extracted_file" },
56
+ { "$ref": "#/definitions/file_extracted_dir" },
57
+ { "$ref": "#/definitions/file_extracted_link" }
58
+ ]
59
+ },
60
+ "file_extracted_file": {
61
+ "required": ["type", "size", "mode"],
62
+ "properties": {
63
+ "type": {
64
+ "enum": ["file"]
65
+ },
66
+ "size": {
67
+ "type": "integer",
68
+ "minimum": 0
69
+ },
70
+ "mode": {
71
+ "type": "string",
72
+ "pattern": "^[0-4]?[0-7]{3}$"
73
+ }
74
+ }
75
+ },
76
+ "file_extracted_dir": {
77
+ "required": ["type", "size", "mode", "files"],
78
+ "properties": {
79
+ "type": {
80
+ "enum": ["dir"]
81
+ },
82
+ "size": {
83
+ "type": "integer",
84
+ "minimum": 0
85
+ },
86
+ "mode": {
87
+ "type": "string",
88
+ "pattern": "^[0-4]?[0-7]{3}$"
89
+ },
90
+ "files": {
91
+ "type": "integer",
92
+ "minimum": 1
93
+ }
94
+ }
95
+ },
96
+ "file_extracted_link": {
97
+ "required": ["type"],
98
+ "properties": {
99
+ "type": {
100
+ "enum": ["link"]
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "array",
5
+ "items": {
6
+ "type": "object",
7
+ "required": ["name", "password", "uid", "gid", "comment", "home", "shell"],
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "password": {
14
+ "type": "string"
15
+ },
16
+ "uid": {
17
+ "type": ["integer", "null"],
18
+ "minimum": 0
19
+ },
20
+ "gid": {
21
+ "type": ["integer", "null"],
22
+ "minimum": 0
23
+ },
24
+ "comment": {
25
+ "type": "string"
26
+ },
27
+ "home": {
28
+ "type": "string"
29
+ },
30
+ "shell": {
31
+ "type": "string"
32
+ },
33
+ "encrypted_password": {
34
+ "type": "string"
35
+ },
36
+ "last_changed_date": {
37
+ "type": "integer"
38
+ },
39
+ "min_days": {
40
+ "type": "integer",
41
+ "minimum": 0
42
+ },
43
+ "max_days": {
44
+ "type": "integer",
45
+ "minimum": 0
46
+ },
47
+ "warn_days": {
48
+ "type": "integer",
49
+ "minimum": 0
50
+ },
51
+ "disable_days": {
52
+ "type": "integer",
53
+ "minimum": 0
54
+ },
55
+ "disabled_date": {
56
+ "type": "integer"
57
+ }
58
+ }
59
+ }
60
+ }
61
+
@@ -0,0 +1,92 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "object",
5
+ "required": ["extracted", "files"],
6
+ "properties": {
7
+ "extracted": {
8
+ "type": "boolean"
9
+ },
10
+ "files": {
11
+ "type": "array",
12
+ "items" : {
13
+ "type": "object",
14
+ "required": ["name", "package_name", "package_version"],
15
+ "properties": {
16
+ "name": {
17
+ "type": "string"
18
+ },
19
+ "package_name": {
20
+ "type": "string",
21
+ "minLength": 1
22
+ },
23
+ "package_version": {
24
+ "type": "string",
25
+ "minLength": 1
26
+ }
27
+ },
28
+ "oneOf": [
29
+ { "$ref": "#/definitions/file_changed" },
30
+ { "$ref": "#/definitions/file_error" }
31
+ ]
32
+ }
33
+ }
34
+ },
35
+ "definitions": {
36
+ "file_changed": {
37
+ "required": ["status"],
38
+ "properties": {
39
+ "status": {
40
+ "enum": ["changed"]
41
+ }
42
+ },
43
+ "oneOf": [
44
+ { "$ref": "#/definitions/file_changed_modified" },
45
+ { "$ref": "#/definitions/file_changed_deleted" }
46
+ ]
47
+ },
48
+ "file_changed_modified": {
49
+ "required": ["changes", "mode", "user", "group"],
50
+ "properties": {
51
+ "changes": {
52
+ "type": "array",
53
+ "items": {
54
+ "enum": ["mode", "md5", "group", "user", "replaced"]
55
+ },
56
+ "minItems": 1
57
+ },
58
+ "mode": {
59
+ "type": "string",
60
+ "pattern": "^[0-7]{3,4}$"
61
+ },
62
+ "user": {
63
+ "type": "string",
64
+ "minLength": 1
65
+ },
66
+ "group": {
67
+ "type": "string",
68
+ "minLength": 1
69
+ }
70
+ }
71
+ },
72
+ "file_changed_deleted": {
73
+ "required": ["changes"],
74
+ "properties": {
75
+ "changes": {
76
+ "enum": [["deleted"]]
77
+ }
78
+ }
79
+ },
80
+ "file_error": {
81
+ "required": ["status", "error_message"],
82
+ "properties": {
83
+ "status": {
84
+ "enum": ["error"]
85
+ },
86
+ "error_message": {
87
+ "type": "string"
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }