machinery-tool 1.13.0 → 1.14.0
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/.git_revision +1 -0
- data/NEWS +10 -0
- data/bin/machinery +7 -1
- data/{helpers → filters}/default_filters.json +0 -0
- data/{helpers → filters}/filter-packages-for-build.yaml +0 -0
- data/{helpers → inspect_helpers}/changed_files.sh +0 -0
- data/{helpers → inspect_helpers}/yum_repositories.py +0 -0
- data/lib/cli.rb +136 -52
- data/lib/compare_task.rb +1 -1
- data/lib/constants.rb +1 -1
- data/lib/docker_system.rb +135 -0
- data/lib/exceptions.rb +3 -2
- data/lib/filter.rb +1 -1
- data/lib/hint.rb +8 -2
- data/lib/inspect_task.rb +3 -3
- data/lib/kiwi_config.rb +2 -2
- data/lib/list_task.rb +14 -7
- data/lib/local_system.rb +20 -2
- data/lib/machinery.rb +2 -0
- data/lib/machinery_helper.rb +17 -14
- data/lib/move_task.rb +22 -0
- data/lib/remote_system.rb +4 -0
- data/lib/scope_file_access_archive.rb +10 -0
- data/lib/scope_file_access_flat.rb +4 -0
- data/lib/show_task.rb +1 -1
- data/lib/system.rb +16 -2
- data/lib/system_description.rb +19 -9
- data/lib/system_description_store.rb +10 -0
- data/lib/version.rb +1 -1
- data/lib/workload_mapper.rb +2 -1
- data/machinery-helper/README.md +13 -0
- data/machinery-helper/Rakefile +124 -0
- data/machinery-helper/machinery_helper.go +228 -0
- data/machinery-helper/machinery_helper_test.go +192 -0
- data/machinery-helper/mountpoints.go +81 -0
- data/machinery-helper/mountpoints_test.go +74 -0
- data/machinery-helper/tar.go +142 -0
- data/machinery-helper/version.go +5 -0
- data/man/generated/machinery.1.gz +0 -0
- data/man/generated/machinery.1.html +43 -6
- data/plugins/changed_managed_files/changed_managed_files_inspector.rb +1 -1
- data/plugins/config_files/config_files_inspector.rb +1 -1
- data/plugins/config_files/config_files_renderer.rb +1 -1
- data/plugins/environment/environment_inspector.rb +2 -2
- data/plugins/environment/schema/system-description-environment.schema-v5.json +4 -0
- data/plugins/os/os_inspector.rb +23 -11
- data/plugins/repositories/repositories_inspector.rb +1 -1
- data/plugins/services/services_inspector.rb +6 -1
- data/plugins/unmanaged_files/unmanaged_files_inspector.rb +35 -30
- data/plugins/unmanaged_files/unmanaged_files_model.rb +12 -6
- data/workload_mapper/docker-registry/clue.rb +0 -2
- data/workload_mapper/docker-registry/compose-template.yml +2 -1
- data/workload_mapper/docker-registry/container/Dockerfile +1 -1
- data/workload_mapper/mariadb/clue.rb +1 -0
- data/workload_mapper/mariadb/compose-template.yml +2 -2
- data/workload_mapper/rails/compose-template.yml +0 -1
- data/workload_mapper/rails/container/Dockerfile +3 -4
- data/workload_mapper/wordpress/clue.rb +13 -0
- data/workload_mapper/wordpress/compose-template.yml +5 -0
- data/workload_mapper/wordpress/config/wp-config.php +38 -0
- data/workload_mapper/wordpress/container/Dockerfile +25 -0
- data/workload_mapper/wordpress/container/apache2/listen.conf +1 -0
- data/workload_mapper/wordpress/container/apache2/wordpress_vhost.conf +21 -0
- data/workload_mapper/wordpress/setup/setup.rb.erb +67 -0
- metadata +26 -8
- data/helpers/inspector_files.rb +0 -52
data/plugins/os/os_inspector.rb
CHANGED
@@ -91,7 +91,7 @@ class OsInspector < Inspector
|
|
91
91
|
result["pretty_name"] = strip_arch_from_name(result["pretty_name"])
|
92
92
|
|
93
93
|
# remove always changing Tumbleweed version from pretty name
|
94
|
-
if result["pretty_name"] =~ /^openSUSE
|
94
|
+
if result["pretty_name"] =~ /^openSUSE.*Tumbleweed/
|
95
95
|
result["pretty_name"] = "openSUSE Tumbleweed"
|
96
96
|
end
|
97
97
|
end
|
@@ -99,6 +99,13 @@ class OsInspector < Inspector
|
|
99
99
|
# name instead of an abbreviation
|
100
100
|
os = Os.for(result["pretty_name"] || result["name"])
|
101
101
|
os.version = result["version"]
|
102
|
+
|
103
|
+
# since Tumbleweed does no longer store the version number in the
|
104
|
+
# "version" property, we've to read from the "version_id" property
|
105
|
+
if os.version == "Tumbleweed"
|
106
|
+
os.version = result["version_id"]
|
107
|
+
end
|
108
|
+
|
102
109
|
os
|
103
110
|
end
|
104
111
|
|
@@ -111,19 +118,24 @@ class OsInspector < Inspector
|
|
111
118
|
# name is always the first line in /etc/SuSE-release
|
112
119
|
result["name"] = strip_arch_from_name(suse_release.split("\n").first)
|
113
120
|
|
114
|
-
|
115
|
-
suse_release.
|
116
|
-
if
|
117
|
-
|
118
|
-
|
119
|
-
if l.start_with?("PATCHLEVEL")
|
120
|
-
patch = l.split("=").last.strip
|
121
|
+
result["patchlevel"] = nil
|
122
|
+
suse_release.split("\n").slice(1, suse_release.length).each do |line|
|
123
|
+
if !line.start_with?("#")
|
124
|
+
key, value = line.split("=")
|
125
|
+
result[key.strip.downcase] = value.strip
|
121
126
|
end
|
122
127
|
end
|
123
|
-
|
124
|
-
|
128
|
+
|
129
|
+
if result["version"] && !result["patchlevel"].nil?
|
130
|
+
result["version"] = "#{result["version"]} SP#{result["patchlevel"]}"
|
131
|
+
end
|
132
|
+
|
133
|
+
if result["codename"] == "Tumbleweed"
|
134
|
+
os = Os.for ("openSUSE Tumbleweed")
|
135
|
+
else
|
136
|
+
os = Os.for(result["name"])
|
125
137
|
end
|
126
|
-
|
138
|
+
|
127
139
|
os.version = result["version"]
|
128
140
|
os
|
129
141
|
end
|
@@ -70,7 +70,7 @@ class RepositoriesInspector < Inspector
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def inspect_yum_repositories
|
73
|
-
script = File.read(File.join(Machinery::ROOT, "
|
73
|
+
script = File.read(File.join(Machinery::ROOT, "inspect_helpers", "yum_repositories.py"))
|
74
74
|
begin
|
75
75
|
repositories = JSON.parse(system.run_command(
|
76
76
|
"bash", "-c", "python", stdin: script, stdout: :capture
|
@@ -24,7 +24,12 @@ class ServicesInspector < Inspector
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def inspect(_filter, _options = {})
|
27
|
-
if @
|
27
|
+
if @description.environment.system_type == "docker"
|
28
|
+
result = ServicesScope.new(
|
29
|
+
init_system: "none",
|
30
|
+
services: []
|
31
|
+
)
|
32
|
+
elsif @system.has_command?("systemctl")
|
28
33
|
result = ServicesScope.new(
|
29
34
|
init_system: "systemd",
|
30
35
|
services: inspect_systemd_services
|
@@ -24,8 +24,7 @@ class UnmanagedFilesInspector < Inspector
|
|
24
24
|
@system.check_requirement("sed", "--version")
|
25
25
|
@system.check_requirement("cat", "--version")
|
26
26
|
@system.check_requirement("find", "--version")
|
27
|
-
@system.
|
28
|
-
@system.check_requirement("gzip", "--version") if check_tar
|
27
|
+
@system.check_create_archive_dependencies if check_tar
|
29
28
|
end
|
30
29
|
|
31
30
|
# extract pathes from rpm database into ruby hashes
|
@@ -237,7 +236,7 @@ class UnmanagedFilesInspector < Inspector
|
|
237
236
|
end
|
238
237
|
|
239
238
|
helper = MachineryHelper.new(@system)
|
240
|
-
if helper_usable?(helper
|
239
|
+
if helper_usable?(helper)
|
241
240
|
run_helper_inspection(helper, file_filter, do_extract, file_store_tmp, file_store_final,
|
242
241
|
scope)
|
243
242
|
else
|
@@ -245,18 +244,17 @@ class UnmanagedFilesInspector < Inspector
|
|
245
244
|
end
|
246
245
|
end
|
247
246
|
|
248
|
-
def helper_usable?(helper
|
247
|
+
def helper_usable?(helper)
|
249
248
|
if !helper.can_help?
|
250
249
|
Machinery::Ui.puts(
|
251
250
|
"Note: Using traditional inspection because there is no helper binary for" \
|
252
251
|
" architecture '#{@system.arch}' available."
|
253
252
|
)
|
254
|
-
elsif
|
253
|
+
elsif @system.respond_to?(:remote_user) && @system.remote_user != "root"
|
255
254
|
Machinery::Ui.puts(
|
256
255
|
"Note: Using traditional inspection because only 'root' is supported as remote user."
|
257
256
|
)
|
258
257
|
else
|
259
|
-
Machinery::Ui.puts "Note: Using helper binary for inspection of unmanaged files."
|
260
258
|
return true
|
261
259
|
end
|
262
260
|
|
@@ -266,37 +264,44 @@ class UnmanagedFilesInspector < Inspector
|
|
266
264
|
def run_helper_inspection(helper, filter, do_extract, file_store_tmp, file_store_final, scope)
|
267
265
|
begin
|
268
266
|
helper.inject_helper
|
267
|
+
if !helper.has_compatible_version?
|
268
|
+
raise Machinery::Errors::UnsupportedHelperVersion.new(
|
269
|
+
"Error: machinery-helper is not compatible with this Machinery version." \
|
270
|
+
"\nTry to reinstall the package or gem to fix the issue."
|
271
|
+
)
|
272
|
+
end
|
273
|
+
|
269
274
|
helper.run_helper(scope)
|
270
|
-
ensure
|
271
|
-
helper.remove_helper
|
272
|
-
end
|
273
275
|
|
274
|
-
|
276
|
+
scope.files.delete_if { |f| filter.matches?(f.name) }
|
275
277
|
|
276
|
-
|
277
|
-
|
278
|
-
|
278
|
+
if do_extract
|
279
|
+
mount_points = MountPoints.new(@system)
|
280
|
+
excluded_trees = mount_points.remote + mount_points.special
|
279
281
|
|
280
|
-
|
281
|
-
|
282
|
+
file_store_tmp.remove
|
283
|
+
file_store_tmp.create
|
282
284
|
|
283
|
-
|
284
|
-
|
285
|
-
|
285
|
+
files = scope.files.select { |f| f.file? || f.link? }.map(&:name)
|
286
|
+
scope.retrieve_files_from_system_as_archive(@system, files, [])
|
287
|
+
show_extraction_progress(files.count)
|
286
288
|
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
289
|
+
scope.retrieve_trees_from_system_as_archive(@system,
|
290
|
+
scope.files.select(&:directory?).map(&:name), excluded_trees) do |count|
|
291
|
+
show_extraction_progress(files.count + count)
|
292
|
+
end
|
291
293
|
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
294
|
+
scope.files = extract_tar_metadata(scope.files, file_store_tmp.path)
|
295
|
+
file_store_final.remove
|
296
|
+
file_store_tmp.rename(file_store_final.store_name)
|
297
|
+
scope.scope_file_store = file_store_final
|
298
|
+
scope.extracted = true
|
299
|
+
else
|
300
|
+
file_store_final.remove
|
301
|
+
scope.extracted = false
|
302
|
+
end
|
303
|
+
ensure
|
304
|
+
helper.remove_helper
|
300
305
|
end
|
301
306
|
|
302
307
|
@description["unmanaged_files"] = scope
|
@@ -22,14 +22,20 @@ class UnmanagedFileList < Machinery::Array
|
|
22
22
|
has_elements class: UnmanagedFile
|
23
23
|
|
24
24
|
def compare_with(other)
|
25
|
-
|
26
|
-
|
25
|
+
self_hash = elements.inject({}) { |hash, e| hash[e.name] = e; hash }
|
26
|
+
other_hash = other.elements.inject({}) { |hash, e| hash[e.name] = e; hash }
|
27
|
+
|
28
|
+
both = []
|
29
|
+
only_self = []
|
30
|
+
elements.each do |element|
|
31
|
+
if other_hash.has_key?(element.name) && files_match(element, other_hash[element.name])
|
32
|
+
both << element
|
33
|
+
else
|
34
|
+
only_self << element
|
35
|
+
end
|
27
36
|
end
|
28
37
|
only_other = other.elements.reject do |element|
|
29
|
-
|
30
|
-
end
|
31
|
-
both = elements.select do |element|
|
32
|
-
other.elements.find { |other_element| files_match(element, other_element) }
|
38
|
+
self_hash.has_key?(element.name) && files_match(element, self_hash[element.name])
|
33
39
|
end
|
34
40
|
|
35
41
|
[
|
@@ -1,8 +1,6 @@
|
|
1
1
|
docker_registry_config = "/etc/registry/config.yml"
|
2
2
|
if system.runs_service?("registry") && system.has_file?(docker_registry_config)
|
3
3
|
identify "docker-registry", "registry"
|
4
|
-
volume = "registry:/registry"
|
5
|
-
parameter "volumes", [volume]
|
6
4
|
used_port = /.*:(\d\d\d\d+)/.match(system.read_config(docker_registry_config, "addr")).
|
7
5
|
to_a.fetch(1, nil)
|
8
6
|
port = "#{used_port}:5000"
|
@@ -3,7 +3,7 @@ FROM opensuse:13.2
|
|
3
3
|
RUN zypper -n --gpg-auto-import-keys ar http://download.opensuse.org/repositories/Virtualization:/containers/openSUSE_13.2/ virt
|
4
4
|
RUN zypper -n --gpg-auto-import-keys refresh
|
5
5
|
RUN zypper -n --gpg-auto-import-keys update
|
6
|
-
RUN zypper -n --gpg-auto-import-keys install docker
|
6
|
+
RUN zypper -n --gpg-auto-import-keys install docker-distribution-registry
|
7
7
|
|
8
8
|
ADD ./data/etc/registry /etc/registry
|
9
9
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
FROM opensuse:13.2
|
2
2
|
|
3
|
-
# see update.sh for why all "apt-get install"s have to stay as one long line
|
4
3
|
RUN zypper -n --gpg-auto-import-keys refresh
|
5
4
|
RUN zypper -n --gpg-auto-import-keys update
|
6
5
|
RUN zypper -n --gpg-auto-import-keys install ca-certificates-mozilla \
|
@@ -28,14 +27,14 @@ RUN touch /etc/apache2/sysconfig.d/include.conf
|
|
28
27
|
RUN gem install passenger -v 5.0.7
|
29
28
|
RUN passenger-install-apache2-module.ruby2.1 -a
|
30
29
|
|
31
|
-
#variable?
|
32
30
|
RUN mkdir /srv/www/rails
|
33
31
|
WORKDIR /srv/www/rails
|
34
32
|
ADD ./data /srv/www/rails
|
33
|
+
RUN echo "gem: --no-ri --no-rdoc" > /srv/www/rails/.gemrc
|
35
34
|
RUN chown -R wwwrun:www /srv/www/rails
|
36
35
|
|
37
36
|
RUN bundle config build.nokogiri --use-system-libraries
|
38
|
-
RUN bundle install
|
37
|
+
RUN bundle install --without test development
|
39
38
|
|
40
39
|
ADD apache2/sysconfig_apache2 /etc/sysconfig/apache2
|
41
40
|
ADD apache2/httpd.conf.local /etc/apache2/httpd.conf.local
|
@@ -43,6 +42,6 @@ ADD apache2/listen.conf /etc/apache2/listen.conf
|
|
43
42
|
ADD apache2/rails_app_vhost.conf /etc/apache2/vhosts.d/
|
44
43
|
RUN cat /etc/apache2/httpd.conf.local >> /etc/apache2/httpd.conf
|
45
44
|
|
46
|
-
|
45
|
+
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
|
47
46
|
|
48
47
|
EXPOSE 3000
|
@@ -0,0 +1,13 @@
|
|
1
|
+
if system.runs_service?("apache2")
|
2
|
+
apache_vhosts = system["unmanaged_files"].files.select { |f| /vhosts\.d/ =~ f.name }.map(&:name)
|
3
|
+
apache_vhosts.each do |vhost|
|
4
|
+
root = system.read_config(vhost, "DocumentRoot")
|
5
|
+
if system.has_file?(File.join(root, "wp-config.php"))
|
6
|
+
identify "wordpress", "web"
|
7
|
+
parameter "ports", ["8000:8000"]
|
8
|
+
parameter "links", ["db"]
|
9
|
+
extract File.join(root, ""), "data"
|
10
|
+
break # for now we only handle the first wordpress that was found
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<?php
|
2
|
+
define('DB_NAME', getenv("DB_NAME"));
|
3
|
+
define('DB_USER', getenv("DB_USER"));
|
4
|
+
define('DB_PASSWORD', getenv("DB_PASS"));
|
5
|
+
define('DB_HOST', 'db');
|
6
|
+
define('DB_CHARSET', 'utf8');
|
7
|
+
define('DB_COLLATE', '');
|
8
|
+
|
9
|
+
/**#@+
|
10
|
+
* Authentication Unique Keys and Salts.
|
11
|
+
*
|
12
|
+
* Change these to different unique phrases!
|
13
|
+
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
|
14
|
+
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
|
15
|
+
*
|
16
|
+
* @since 2.6.0
|
17
|
+
*/
|
18
|
+
define('AUTH_KEY', 'put your unique phrase here');
|
19
|
+
define('SECURE_AUTH_KEY', 'put your unique phrase here');
|
20
|
+
define('LOGGED_IN_KEY', 'put your unique phrase here');
|
21
|
+
define('NONCE_KEY', 'put your unique phrase here');
|
22
|
+
define('AUTH_SALT', 'put your unique phrase here');
|
23
|
+
define('SECURE_AUTH_SALT', 'put your unique phrase here');
|
24
|
+
define('LOGGED_IN_SALT', 'put your unique phrase here');
|
25
|
+
define('NONCE_SALT', 'put your unique phrase here');
|
26
|
+
|
27
|
+
$table_prefix = 'wp_';
|
28
|
+
|
29
|
+
define('WP_DEBUG', false);
|
30
|
+
|
31
|
+
/* That's all, stop editing! Happy blogging. */
|
32
|
+
|
33
|
+
/** Absolute path to the WordPress directory. */
|
34
|
+
if ( !defined('ABSPATH') )
|
35
|
+
define('ABSPATH', dirname(__FILE__) . '/');
|
36
|
+
|
37
|
+
/** Sets up WordPress vars and included files. */
|
38
|
+
require_once(ABSPATH . 'wp-settings.php');
|
@@ -0,0 +1,25 @@
|
|
1
|
+
FROM opensuse:13.2
|
2
|
+
|
3
|
+
# see update.sh for why all "apt-get install"s have to stay as one long line
|
4
|
+
RUN zypper -n --gpg-auto-import-keys refresh
|
5
|
+
RUN zypper -n --gpg-auto-import-keys update
|
6
|
+
RUN zypper -n --gpg-auto-import-keys install apache2-devel \
|
7
|
+
mariadb-client \
|
8
|
+
libmysqlclient-devel \
|
9
|
+
php5 \
|
10
|
+
php5-mcrypt \
|
11
|
+
php5-gd \
|
12
|
+
php5-mysql \
|
13
|
+
apache2-mod_php5 \
|
14
|
+
which
|
15
|
+
|
16
|
+
RUN touch /etc/apache2/sysconfig.d/include.conf
|
17
|
+
|
18
|
+
RUN mkdir /srv/www/wordpress
|
19
|
+
WORKDIR /srv/www/wordpress
|
20
|
+
ADD ./data /srv/www/wordpress
|
21
|
+
|
22
|
+
ADD apache2/listen.conf /etc/apache2/listen.conf
|
23
|
+
ADD apache2/wordpress_vhost.conf /etc/apache2/vhosts.d/
|
24
|
+
RUN echo "LoadModule php5_module /usr/lib64/apache2/mod_php5.so" >> /etc/apache2/sysconfig.d/loadmodule.conf
|
25
|
+
RUN echo "variables_order = 'GPCSE'" >> /etc/php5/cli/php.ini
|
@@ -0,0 +1 @@
|
|
1
|
+
Listen 8000
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<VirtualHost *:8000>
|
2
|
+
DocumentRoot /srv/www/wordpress
|
3
|
+
<Directory /srv/www/wordpress/>
|
4
|
+
Options Indexes FollowSymLinks MultiViews
|
5
|
+
AllowOverride None
|
6
|
+
Order allow,deny
|
7
|
+
Allow from all
|
8
|
+
Require all granted
|
9
|
+
</Directory>
|
10
|
+
<IfModule mod_php5.c>
|
11
|
+
<FilesMatch "\.ph(p[345]?|tml)$">
|
12
|
+
SetHandler application/x-httpd-php
|
13
|
+
</FilesMatch>
|
14
|
+
<FilesMatch "\.php[345]?s$">
|
15
|
+
SetHandler application/x-httpd-php-source
|
16
|
+
</FilesMatch>
|
17
|
+
DirectoryIndex index.php4
|
18
|
+
DirectoryIndex index.php5
|
19
|
+
DirectoryIndex index.php
|
20
|
+
</IfModule>
|
21
|
+
</VirtualHost>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Copyright (c) 2015 SUSE LLC
|
3
|
+
#
|
4
|
+
# This program is free software; you can redistribute it and/or
|
5
|
+
# modify it under the terms of version 3 of the GNU General Public License as
|
6
|
+
# published by the Free Software Foundation.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License
|
14
|
+
# along with this program; if not, contact SUSE LLC.
|
15
|
+
#
|
16
|
+
# To contact SUSE about this file by physical or electronic mail,
|
17
|
+
# you may find current contact information at www.suse.com
|
18
|
+
require 'docker'
|
19
|
+
require 'json'
|
20
|
+
|
21
|
+
app_name = "<%= @name %>"
|
22
|
+
web_env_vars = <%= @services["web"]["environment"].to_a.map { |ar| ar.join("=") } %>
|
23
|
+
db_env_vars = <%= @services["db"]["environment"].to_a.map { |ar| ar.join("=") } %>
|
24
|
+
db_workload = "<%= @workloads.find { |_, config| config["service"] == "db" }.first %>"
|
25
|
+
|
26
|
+
def find_image(name)
|
27
|
+
Docker::Image.get(name)
|
28
|
+
rescue
|
29
|
+
return false
|
30
|
+
end
|
31
|
+
|
32
|
+
def build_image(path, name)
|
33
|
+
if find_image(name)
|
34
|
+
puts "Found #{name} image, not building again"
|
35
|
+
else
|
36
|
+
puts "Building image #{name}"
|
37
|
+
Docker::Image.build_from_dir(path, t: name) do |output|
|
38
|
+
print JSON.parse(output)["stream"]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
puts "Setting up #{db_workload}"
|
44
|
+
if File.exists?("#{Dir.pwd}/#{db_workload}/data/configured.txt")
|
45
|
+
puts "Exiting as database has already been configured.\n" \
|
46
|
+
"If you want to re run the configuration just remove the files in #{Dir.pwd}/#{db_workload}/data/"
|
47
|
+
exit 1
|
48
|
+
end
|
49
|
+
|
50
|
+
db_image = "#{app_name}_db"
|
51
|
+
build_image("./#{db_workload}", db_image)
|
52
|
+
|
53
|
+
volumes = ["#{Dir.pwd}/#{db_workload}/data:/var/lib/mysql"]
|
54
|
+
db = Docker::Container.create("Image" => db_image, "name" => "#{db_image}_0", "Env" => db_env_vars, "Binds" => volumes, "Tty" => true, "Stream" => true)
|
55
|
+
db.tap(&:start).attach(tty: true) { |output| print output }
|
56
|
+
|
57
|
+
web_image = "#{app_name}_web"
|
58
|
+
build_image("./wordpress", web_image)
|
59
|
+
|
60
|
+
db.start
|
61
|
+
|
62
|
+
puts "Stopping db service"
|
63
|
+
db.kill
|
64
|
+
|
65
|
+
puts "removing containers"
|
66
|
+
db.remove
|
67
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: machinery-tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SUSE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cheetah
|
@@ -227,9 +227,11 @@ email:
|
|
227
227
|
- machinery@lists.suse.com
|
228
228
|
executables:
|
229
229
|
- machinery
|
230
|
-
extensions:
|
230
|
+
extensions:
|
231
|
+
- machinery-helper/Rakefile
|
231
232
|
extra_rdoc_files: []
|
232
233
|
files:
|
234
|
+
- ".git_revision"
|
233
235
|
- COPYING
|
234
236
|
- NEWS
|
235
237
|
- bin/machinery
|
@@ -239,11 +241,8 @@ files:
|
|
239
241
|
- export_helpers/merge_users_and_groups.pl.erb
|
240
242
|
- export_helpers/unmanaged_files_autoyast_excludes
|
241
243
|
- export_helpers/unmanaged_files_kiwi_excludes
|
242
|
-
-
|
243
|
-
-
|
244
|
-
- helpers/filter-packages-for-build.yaml
|
245
|
-
- helpers/inspector_files.rb
|
246
|
-
- helpers/yum_repositories.py
|
244
|
+
- filters/default_filters.json
|
245
|
+
- filters/filter-packages-for-build.yaml
|
247
246
|
- html/assets/angular-sanitize.min.js
|
248
247
|
- html/assets/angular.min.js
|
249
248
|
- html/assets/arrow_down.png
|
@@ -286,6 +285,8 @@ files:
|
|
286
285
|
- html/assets/wheels_horizontal.png
|
287
286
|
- html/comparison.html.haml
|
288
287
|
- html/index.html.haml
|
288
|
+
- inspect_helpers/changed_files.sh
|
289
|
+
- inspect_helpers/yum_repositories.py
|
289
290
|
- lib/analyze_config_file_diffs_task.rb
|
290
291
|
- lib/array.rb
|
291
292
|
- lib/autoyast.rb
|
@@ -303,6 +304,7 @@ files:
|
|
303
304
|
- lib/copy_task.rb
|
304
305
|
- lib/current_user.rb
|
305
306
|
- lib/deploy_task.rb
|
307
|
+
- lib/docker_system.rb
|
306
308
|
- lib/element_filter.rb
|
307
309
|
- lib/exceptions.rb
|
308
310
|
- lib/export_task.rb
|
@@ -330,6 +332,7 @@ files:
|
|
330
332
|
- lib/manifest.rb
|
331
333
|
- lib/migration.rb
|
332
334
|
- lib/mountpoints.rb
|
335
|
+
- lib/move_task.rb
|
333
336
|
- lib/object.rb
|
334
337
|
- lib/remote_system.rb
|
335
338
|
- lib/remove_task.rb
|
@@ -356,6 +359,14 @@ files:
|
|
356
359
|
- lib/workload_mapper.rb
|
357
360
|
- lib/workload_mapper_dsl.rb
|
358
361
|
- lib/zypper.rb
|
362
|
+
- machinery-helper/README.md
|
363
|
+
- machinery-helper/Rakefile
|
364
|
+
- machinery-helper/machinery_helper.go
|
365
|
+
- machinery-helper/machinery_helper_test.go
|
366
|
+
- machinery-helper/mountpoints.go
|
367
|
+
- machinery-helper/mountpoints_test.go
|
368
|
+
- machinery-helper/tar.go
|
369
|
+
- machinery-helper/version.go
|
359
370
|
- man/generated/machinery.1.gz
|
360
371
|
- man/generated/machinery.1.html
|
361
372
|
- plugins/changed_managed_files/changed_managed_files.md
|
@@ -478,6 +489,13 @@ files:
|
|
478
489
|
- workload_mapper/rails/container/apache2/rails_app_vhost.conf
|
479
490
|
- workload_mapper/rails/container/apache2/sysconfig_apache2
|
480
491
|
- workload_mapper/rails/setup/setup.rb.erb
|
492
|
+
- workload_mapper/wordpress/clue.rb
|
493
|
+
- workload_mapper/wordpress/compose-template.yml
|
494
|
+
- workload_mapper/wordpress/config/wp-config.php
|
495
|
+
- workload_mapper/wordpress/container/Dockerfile
|
496
|
+
- workload_mapper/wordpress/container/apache2/listen.conf
|
497
|
+
- workload_mapper/wordpress/container/apache2/wordpress_vhost.conf
|
498
|
+
- workload_mapper/wordpress/setup/setup.rb.erb
|
481
499
|
homepage: http://machinery-project.org
|
482
500
|
licenses:
|
483
501
|
- GPL-3.0
|
data/helpers/inspector_files.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
# Copyright (c) 2013-2015 SUSE LLC
|
2
|
-
#
|
3
|
-
# This program is free software; you can redistribute it and/or
|
4
|
-
# modify it under the terms of version 3 of the GNU General Public License as
|
5
|
-
# published by the Free Software Foundation.
|
6
|
-
#
|
7
|
-
# This program is distributed in the hope that it will be useful,
|
8
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
-
# GNU General Public License for more details.
|
11
|
-
#
|
12
|
-
# You should have received a copy of the GNU General Public License
|
13
|
-
# along with this program; if not, contact SUSE LLC.
|
14
|
-
#
|
15
|
-
# To contact SUSE about this file by physical or electronic mail,
|
16
|
-
# you may find current contact information at www.suse.com
|
17
|
-
|
18
|
-
|
19
|
-
# This script creates reference data for integration tests
|
20
|
-
# by inspecting existing machines.
|
21
|
-
# Therefor it generates files with information of each scope.
|
22
|
-
|
23
|
-
# Usage: rake inspector_files[ip-adress,distribution]
|
24
|
-
|
25
|
-
require "fileutils"
|
26
|
-
require "cheetah"
|
27
|
-
|
28
|
-
class ReferenceTestData
|
29
|
-
def initialize
|
30
|
-
@machinery = File.expand_path("../bin/machinery", File.dirname(__FILE__))
|
31
|
-
@test_data_path = File.expand_path("../spec/data/", File.dirname(__FILE__))
|
32
|
-
end
|
33
|
-
|
34
|
-
def inspect(ip_adress)
|
35
|
-
Cheetah.run(@machinery, "inspect", ip_adress, "-n", "referencetestdata", stdout: :capture)
|
36
|
-
end
|
37
|
-
|
38
|
-
def write(destination)
|
39
|
-
Inspector.all_scopes.each do |inspector|
|
40
|
-
output = Cheetah.run(
|
41
|
-
@machinery, "show", destination, "-s", inspector.gsub("_", "-"),
|
42
|
-
"referencetestdata", stdout: :capture
|
43
|
-
)
|
44
|
-
File.write(file_path(inspector, destination), output)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def file_path(inspector, destination)
|
49
|
-
FileUtils.mkdir_p("#{@test_data_path}/#{inspector}")
|
50
|
-
File.join(@test_data_path, inspector, destination)
|
51
|
-
end
|
52
|
-
end
|