ood_packaging 0.0.1.rc.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,139 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ood_packaging/utils'
4
+ require 'rake'
5
+ require 'rake/file_utils'
6
+
7
+ # Build the packaging build boxes
8
+ class OodPackaging::BuildBox
9
+ include OodPackaging::Utils
10
+ include FileUtils
11
+
12
+ BASE_IMAGES = {
13
+ 'el7' => 'centos:7',
14
+ 'el8' => 'rockylinux/rockylinux:8',
15
+ 'ubuntu-20.04' => 'ubuntu:20.04'
16
+ }.freeze
17
+
18
+ CODENAMES = {
19
+ 'ubuntu-20.04' => 'focal'
20
+ }.freeze
21
+
22
+ def initialize(config = {})
23
+ @config = config
24
+ raise ArgumentError, 'Must provide dist' if @config[:dist].nil?
25
+
26
+ # rubocop:disable Style/GuardClause
27
+ unless valid_dist?(@config[:dist])
28
+ raise ArgumentError, "Invalid dist selected: #{@config[:dist]}. Valid choices are #{valid_dists.join(' ')}"
29
+ end
30
+ # rubocop:enable Style/GuardClause
31
+ end
32
+
33
+ def dist
34
+ @dist ||= @config[:dist]
35
+ end
36
+
37
+ def rpm?
38
+ dist.start_with?('el')
39
+ end
40
+
41
+ def deb?
42
+ !rpm?
43
+ end
44
+
45
+ def dnf?
46
+ return false unless rpm?
47
+ return false if dist == 'el7'
48
+
49
+ true
50
+ end
51
+
52
+ def scl?
53
+ return true if dist == 'el7'
54
+
55
+ false
56
+ end
57
+
58
+ def package_manager
59
+ return 'apt' if deb?
60
+ return 'dnf' if dnf?
61
+
62
+ 'yum'
63
+ end
64
+
65
+ def valid_dist?(value)
66
+ BASE_IMAGES.key?(value)
67
+ end
68
+
69
+ def valid_dists
70
+ BASE_IMAGES.keys
71
+ end
72
+
73
+ def base_image
74
+ @base_image ||= BASE_IMAGES[dist]
75
+ end
76
+
77
+ def codename
78
+ @codename ||= CODENAMES[dist]
79
+ end
80
+
81
+ def build_dir
82
+ File.join(File.dirname(__FILE__), 'build_box/docker-image')
83
+ end
84
+
85
+ def image_registry
86
+ @config[:builx_box_registry] || ENV['OOD_PACKAGING_BUILD_BOX_REGISTRY'] || nil
87
+ end
88
+
89
+ def image_org
90
+ @config[:build_box_org] || ENV['OOD_PACKAGING_BUILX_BOX_ORG'] || 'ohiosupercomputer'
91
+ end
92
+
93
+ def image_name
94
+ @config[:builx_box_name] || ENV['OOD_PACKAGING_BUILD_BOX_NAME'] || 'ood-buildbox'
95
+ end
96
+
97
+ def image_version
98
+ ENV['OOD_PACKAGING_BUILD_BOX_VERSION'] || OodPackaging::VERSION
99
+ end
100
+
101
+ def image_tag
102
+ [image_registry, image_org, "#{image_name}-#{dist}:#{image_version}"].compact.join('/')
103
+ end
104
+
105
+ def build_gem
106
+ gem = File.join(proj_root, 'pkg', "ood_packaging-#{OodPackaging::VERSION}.gem")
107
+ Rake::Task['build'].invoke
108
+ sh "rm -f #{build_dir}/*.gem"
109
+ sh "cp #{gem} #{build_dir}/"
110
+ end
111
+
112
+ def dockerfile
113
+ template_file('build_box/docker-image/Dockerfile.erb')
114
+ end
115
+
116
+ def scripts
117
+ template_file('build_box/docker-image/inituidgid.sh.erb')
118
+ template_file('build_box/docker-image/install.sh.erb')
119
+ end
120
+
121
+ def build!
122
+ scripts
123
+ cmd = [container_runtime, 'build']
124
+ cmd.concat ['--tag', image_tag]
125
+ cmd.concat [ENV['OOD_PACKAGING_BUILD_BOX_ARGS']] if ENV['OOD_PACKAGING_BUILD_BOX_ARGS']
126
+ cmd.concat ['-f', dockerfile]
127
+ cmd.concat [build_dir]
128
+ build_gem
129
+ sh cmd.join(' ')
130
+ end
131
+
132
+ def push!
133
+ sh [container_runtime, 'push', image_tag].join(' ')
134
+ end
135
+
136
+ def save!(path)
137
+ sh [container_runtime, 'save', image_tag, '| gzip >', path].join(' ')
138
+ end
139
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Handle options for OodPackaging
4
+ module OodPackaging
5
+ OPTIONS = [:package, :version, :dist, :work_dir, :clean_work_dir, :output_dir, :clean_output_dir, :tar,
6
+ :tar_only, :skip_download, :gpg_sign, :gpg_name, :gpg_pubkey, :gpg_private_key, :gpg_passphrase,
7
+ :debug, :attach].freeze
8
+ end
@@ -0,0 +1,290 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ood_packaging/build_box'
4
+ require 'ood_packaging/utils'
5
+ require 'ood_packaging/string_ext'
6
+ require 'English'
7
+ require 'pathname'
8
+ require 'ostruct'
9
+ require 'securerandom'
10
+ require 'rake'
11
+ require 'rake/file_utils'
12
+
13
+ # The interface to build packages using containers
14
+ class OodPackaging::Package
15
+ include OodPackaging::Utils
16
+ include FileUtils
17
+
18
+ attr_accessor :build_box
19
+
20
+ def initialize(config = {})
21
+ @config = config
22
+ @config[:dist] = 'el8' if tar_only?
23
+ @build_box = OodPackaging::BuildBox.new(config)
24
+ @clean_work_dir = config[:clean_work_dir].nil? ? true : config[:clean_work_dir]
25
+ @clean_output_dir = config[:clean_output_dir].nil? ? true : config[:clean_output_dir]
26
+ raise ArgumentError, 'Package is required' if package.nil?
27
+ raise ArgumentError, 'Version is required' if version.nil?
28
+ raise ArgumentError, "Package #{package} is not a directory" unless Dir.exist?(package)
29
+ raise ArgumentError, "Package #{package} is not an absolute path" unless (Pathname.new package).absolute?
30
+ end
31
+
32
+ def container_name
33
+ @container_name ||= SecureRandom.uuid
34
+ end
35
+
36
+ def debug
37
+ return true if ENV['OOD_PACKAGING_DEBUG'] == 'true'
38
+
39
+ @config[:debug].nil? ? false : @config[:debug]
40
+ end
41
+
42
+ def attach?
43
+ return true if ENV['OOD_PACKAGING_ATTACH'] == 'true'
44
+
45
+ @config[:attach].nil? ? false : @config[:attach]
46
+ end
47
+
48
+ def work_dir
49
+ @work_dir ||= File.expand_path(@config[:work_dir])
50
+ end
51
+
52
+ def output_dir
53
+ @output_dir ||= File.expand_path(@config[:output_dir])
54
+ end
55
+
56
+ def package
57
+ @config[:package]
58
+ end
59
+
60
+ def version
61
+ @config[:version]
62
+ end
63
+
64
+ def tar_version
65
+ version.gsub(/^v/, '')
66
+ end
67
+
68
+ def tar?
69
+ @config[:tar].nil? ? build_box.deb? : @config[:tar]
70
+ end
71
+
72
+ def tar_only?
73
+ @config[:tar_only].nil? ? false : @config[:tar_only]
74
+ end
75
+
76
+ def package_name
77
+ name = File.basename(package)
78
+ if name =~ /deb|rpm/
79
+ name = if File.basename(File.dirname(package)) == 'packages'
80
+ File.basename(File.dirname(File.dirname(package)))
81
+ else
82
+ File.basename(File.dirname(package))
83
+ end
84
+ end
85
+ name
86
+ end
87
+
88
+ def gpg_files
89
+ [
90
+ OpenStruct.new(private_key: File.join(proj_root, 'ondemand.sec'), passphrase: File.join(proj_root, '.gpgpass')),
91
+ OpenStruct.new(private_key: File.join(package, 'ondemand.sec'), passphrase: File.join(package, '.gpgpass')),
92
+ OpenStruct.new(private_key: @config[:gpg_private_key], passphrase: @config[:gpg_passphrase]),
93
+ OpenStruct.new(private_key: ENV['OOD_PACKAGING_GPG_PRIVATE_KEY'],
94
+ passphrase: ENV['OOD_PACKAGING_GPG_PASSPHRASE'])
95
+ ].each do |gpg|
96
+ next if gpg.private_key.nil? || gpg.passphrase.nil?
97
+ return gpg if File.exist?(gpg.private_key) && File.exist?(gpg.passphrase)
98
+ end
99
+ nil
100
+ end
101
+
102
+ def gpg_sign
103
+ return false if ENV['OOD_PACKAGING_GPG_SIGN'].to_s == 'false'
104
+ return false if @config[:gpg_sign] == false
105
+
106
+ !gpg_files.nil?
107
+ end
108
+
109
+ def gpg_name
110
+ @config[:gpg_name].nil? ? 'OnDemand Release Signing Key' : @config[:gpg_name]
111
+ end
112
+
113
+ def container_init
114
+ '/sbin/init'
115
+ end
116
+
117
+ def tar_path
118
+ if build_box.deb?
119
+ path = File.join(package, 'deb')
120
+ return path if Dir.exist?(path)
121
+ end
122
+
123
+ package
124
+ end
125
+
126
+ def rpm_tar_dest_dir
127
+ dir = File.join(package, 'rpm')
128
+ return dir if Dir.exist?(dir)
129
+
130
+ File.join(package, 'packaging/rpm')
131
+ end
132
+
133
+ def rpm_version
134
+ tar_version
135
+ end
136
+
137
+ def deb_tar_dest_dir
138
+ dir = File.join(package, 'deb')
139
+ return File.join(dir, 'build') if Dir.exist?(dir)
140
+
141
+ File.join(package, 'build')
142
+ end
143
+
144
+ def deb_version
145
+ tar_version.gsub('-', '.')
146
+ end
147
+
148
+ def exec_launchers
149
+ [
150
+ File.join(ctr_scripts_dir, 'inituidgid.sh'),
151
+ File.join(ctr_scripts_dir, 'setuser.rb'),
152
+ ctr_user
153
+ ]
154
+ end
155
+
156
+ def exec_rake
157
+ cmd = []
158
+ cmd.concat exec_launchers if docker_runtime?
159
+ cmd.concat ['scl', 'enable', scl_ruby, '--'] if podman_runtime? && build_box.scl?
160
+ cmd.concat ['rake']
161
+ cmd.concat ['-q'] unless debug
162
+ cmd.concat ['-f', File.join(ctr_scripts_dir, 'Rakefile'), 'ood_packaging:package:build']
163
+ cmd
164
+ end
165
+
166
+ def exec_attach
167
+ cmd = []
168
+ cmd.concat exec_launchers if docker_runtime?
169
+ cmd.concat ['/bin/bash']
170
+ cmd
171
+ end
172
+
173
+ def container_mounts
174
+ args = []
175
+ args.concat ['-v', "#{package}:/package:ro"]
176
+ args.concat ['-v', "#{@config[:gpg_pubkey]}:/gpg.pub:ro"] if @config[:gpg_pubkey]
177
+ args.concat ['-v', "#{work_dir}:/work"]
178
+ args.concat ['-v', "#{output_dir}:/output"]
179
+ if gpg_sign
180
+ args.concat ['-v', "#{gpg_files.private_key}:#{gpg_private_key}:ro"]
181
+ args.concat ['-v', "#{gpg_files.passphrase}:#{gpg_passphrase}:ro"]
182
+ end
183
+ args
184
+ end
185
+
186
+ def clean!
187
+ sh "rm -rf #{work_dir}", verbose: debug if @clean_work_dir
188
+ sh "rm -rf #{output_dir}", verbose: debug if @clean_output_dir
189
+ end
190
+
191
+ def bootstrap!
192
+ sh "mkdir -p #{work_dir}", verbose: debug
193
+ sh "mkdir -p #{output_dir}", verbose: debug
194
+ end
195
+
196
+ def tar!
197
+ cmd = ['git', 'ls-files', '.', '|', tar, '-c']
198
+ if build_box.rpm?
199
+ dir = rpm_tar_dest_dir
200
+ version = rpm_version
201
+ else
202
+ dir = deb_tar_dest_dir.tap { |p| sh "mkdir -p #{p}" }
203
+ version = deb_version
204
+ cmd.concat ["--transform 'flags=r;s,packaging/deb,debian,'"]
205
+ end
206
+ tar_file = "#{dir}/#{package_name}-#{version}.tar.gz"
207
+ cmd.concat ["--transform 's,^,#{package_name}-#{version}/,'"]
208
+ cmd.concat ['-T', '-', '|', "gzip > #{tar_file}"]
209
+
210
+ sh "rm #{tar_file}" if File.exist?(tar_file)
211
+ puts "Create tar archive #{tar_file}".blue
212
+ Dir.chdir(tar_path) do
213
+ sh cmd.join(' '), verbose: debug
214
+ end
215
+ end
216
+
217
+ def run!
218
+ if tar_only?
219
+ tar!
220
+ return
221
+ end
222
+ clean!
223
+ bootstrap!
224
+ tar! if tar?
225
+ container_start!
226
+ container_exec!(exec_rake)
227
+ rescue RuntimeError
228
+ # ret = 1
229
+ puts "Build FAILED package=#{package} dist=#{build_box.dist}".red
230
+ raise
231
+ else
232
+ puts "Build SUCCESS: package=#{package} dist=#{build_box.dist}".green
233
+ ensure
234
+ container_exec!(exec_attach, ['-i', '-t']) if attach?
235
+ container_kill! if container_running?
236
+ end
237
+
238
+ def container_running?
239
+ `#{container_runtime} inspect #{container_name} 2>/dev/null 1>/dev/null`
240
+ $CHILD_STATUS.success?
241
+ end
242
+
243
+ def container_start!
244
+ cmd = [container_runtime, 'run', '--detach', '--rm']
245
+ cmd.concat ['--name', container_name]
246
+ cmd.concat rt_specific_flags
247
+ cmd.concat container_mounts
248
+ cmd.concat [build_box.image_tag]
249
+ cmd.concat [container_init]
250
+ cmd.concat ['1>/dev/null'] unless debug
251
+ puts "Starting container #{container_name} using image #{build_box.image_tag}".blue
252
+ sh cmd.join(' '), verbose: debug
253
+ end
254
+
255
+ def container_exec!(exec_cmd, extra_args = [])
256
+ cmd = [container_runtime, 'exec']
257
+ cmd.concat extra_args
258
+ container_env.each_pair do |k, v|
259
+ cmd.concat ['-e', "'#{k}=#{v}'"] unless v.nil?
260
+ end
261
+ cmd.concat [container_name]
262
+ cmd.concat exec_cmd
263
+ puts "Build STARTED: package=#{package} dist=#{build_box.dist} exec=#{exec_cmd[-1]}".blue
264
+ sh cmd.join(' '), verbose: debug
265
+ end
266
+
267
+ def container_kill!
268
+ puts "Killing container #{container_name}".blue
269
+ cmd = [container_runtime, 'kill', container_name]
270
+ cmd.concat ['1>/dev/null', '2>/dev/null'] unless debug
271
+ sh cmd.join(' '), verbose: debug
272
+ end
273
+
274
+ def container_env
275
+ env = {
276
+ 'DIST' => build_box.dist,
277
+ 'PACKAGE' => package_name,
278
+ 'GPG_SIGN' => gpg_sign,
279
+ 'GPG_NAME' => gpg_name,
280
+ 'SKIP_DOWNLOAD' => @config[:skip_download],
281
+ 'OOD_UID' => Process.uid,
282
+ 'OOD_GID' => Process.gid,
283
+ 'DEBUG' => debug
284
+ }
285
+ env['VERSION'] = rpm_version if build_box.rpm?
286
+ env['VERSION'] = deb_version if build_box.deb?
287
+ env['GPG_PUBKEY'] = '/gpg.pub' if @config[:gpg_pubkey]
288
+ env
289
+ end
290
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ood_packaging/options'
4
+ require 'ood_packaging/package'
5
+ require 'ood_packaging/utils'
6
+ require 'rake'
7
+ require 'rake/tasklib'
8
+
9
+ # Define OodPackaging rake task library
10
+ class OodPackaging::RakeTask < ::Rake::TaskLib
11
+ include ::Rake::DSL if defined?(::Rake::DSL)
12
+ include OodPackaging::Utils
13
+
14
+ OodPackaging::OPTIONS.each do |o|
15
+ attr_accessor o.to_sym
16
+ end
17
+
18
+ def initialize(*args, &task_block)
19
+ super()
20
+ @name = args.shift || :package
21
+
22
+ define(args, &task_block)
23
+ end
24
+
25
+ def define(args, &task_block)
26
+ desc 'Build package' unless ::Rake.application.last_description
27
+
28
+ task @name, *args do |_, task_args|
29
+ task_block&.call(*[self, task_args].slice(0, task_block.arity))
30
+ config = {}
31
+ OodPackaging::OPTIONS.each do |o|
32
+ v = instance_variable_get("@#{o}")
33
+ config[o.to_sym] = v unless v.nil?
34
+ end
35
+ OodPackaging::Package.new(config).run!
36
+ end
37
+ end
38
+
39
+ def name
40
+ @name.to_s
41
+ end
42
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ # https://stackoverflow.com/a/11482430
4
+ class String
5
+ def colorize(code)
6
+ "\e[#{code}m#{self}\e[0m"
7
+ end
8
+
9
+ def red
10
+ colorize(31)
11
+ end
12
+
13
+ def green
14
+ colorize(32)
15
+ end
16
+
17
+ def blue
18
+ colorize(34)
19
+ end
20
+ end
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ood_packaging'
4
+ require 'ood_packaging/rake_task'
5
+ require 'ood_packaging/utils'
6
+
7
+ namespace :ood_packaging do
8
+ include OodPackaging::Utils
9
+
10
+ namespace :buildbox do
11
+ desc 'Build buildbox image'
12
+ task :build, [:dist] do |_task, args|
13
+ @build_box = OodPackaging::BuildBox.new(args)
14
+ @build_box.build!
15
+ end
16
+
17
+ desc 'Push buildbox image'
18
+ task :push, [:dist] do |_task, args|
19
+ @build_box = OodPackaging::BuildBox.new(args)
20
+ @build_box.push!
21
+ end
22
+
23
+ desc 'Save buildbox image'
24
+ task :save, [:dist, :path] do |_task, args|
25
+ @build_box = OodPackaging::BuildBox.new(args)
26
+ @build_box.save!(args[:path])
27
+ end
28
+ end
29
+
30
+ namespace :package do
31
+ desc 'Build a package (INSIDE CONTAINER ONLY)'
32
+ task :build do
33
+ OodPackaging::Build.new.run!
34
+ end
35
+
36
+ OodPackaging::RakeTask.new(:internal, [:package, :dist]) do |t, args|
37
+ name = args[:package].split(':').last
38
+ t.package = File.join(proj_root, 'packages', name)
39
+ t.dist = args[:dist]
40
+ t.version = OodPackaging.package_version(name, args[:dist])
41
+ t.work_dir = File.join(proj_root, 'tmp/work')
42
+ t.output_dir = File.join(proj_root, 'tmp/output')
43
+ end
44
+
45
+ desc 'Package ondemand-release'
46
+ task :'ondemand-release', [:dist] do |t, args|
47
+ ENV['OOD_PACKAGING_GPG_SIGN'] = 'false'
48
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
49
+ end
50
+
51
+ desc 'Package ondemand-release-latest'
52
+ task :'ondemand-release-latest', [:dist] do |t, args|
53
+ ENV['OOD_PACKAGING_GPG_SIGN'] = 'false'
54
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
55
+ end
56
+
57
+ desc 'Package ondemand-release'
58
+ task :'ondemand-runtime', [:dist] do |t, args|
59
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
60
+ end
61
+
62
+ desc 'Package passenger'
63
+ task :passenger, [:dist] do |t, args|
64
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
65
+ end
66
+
67
+ desc 'Package cjose'
68
+ task :cjose, [:dist] do |t, args|
69
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
70
+ end
71
+
72
+ desc 'Package mod_auth_openidc'
73
+ task :mod_auth_openidc, [:dist] do |t, args|
74
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
75
+ end
76
+
77
+ desc 'Package sqlite'
78
+ task :sqlite, [:dist] do |t, args|
79
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
80
+ end
81
+
82
+ desc 'Package ondemand_exporter'
83
+ task :ondemand_exporter, [:dist] do |t, args|
84
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
85
+ end
86
+
87
+ desc 'Package ondemand-compute'
88
+ task :'ondemand-compute', [:dist] do |t, args|
89
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
90
+ end
91
+
92
+ desc 'Package python-websockify'
93
+ task :'python-websockify', [:dist] do |t, args|
94
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
95
+ end
96
+
97
+ desc 'Package turbovnc'
98
+ task :turbovnc, [:dist] do |t, args|
99
+ Rake::Task['ood_packaging:package:internal'].invoke(t.name, args[:dist])
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'erb'
4
+
5
+ # Shared utility functions
6
+ module OodPackaging::Utils
7
+ def proj_root
8
+ File.expand_path(File.join(File.dirname(__FILE__), '../..'))
9
+ end
10
+
11
+ def tar
12
+ @tar ||= begin
13
+ `which gtar 1>/dev/null 2>&1`
14
+ $CHILD_STATUS.success? ? 'gtar' : 'tar'
15
+ end
16
+ end
17
+
18
+ def podman_runtime?
19
+ @podman_runtime ||= ENV['CONTAINER_RT'] == 'podman' || ENV['container'] == 'podman'
20
+ end
21
+
22
+ def docker_runtime?
23
+ !podman_runtime?
24
+ end
25
+
26
+ def container_runtime
27
+ podman_runtime? ? 'podman' : 'docker'
28
+ end
29
+
30
+ def rt_specific_flags
31
+ if podman_runtime?
32
+ # SELinux doesn't like it if you're mounting from $HOME
33
+ [
34
+ '--security-opt', 'label=disable'
35
+ ]
36
+ else
37
+ ['--privileged', '--tty']
38
+ end
39
+ end
40
+
41
+ def template_file(filename)
42
+ cwd = File.expand_path(__dir__).to_s
43
+ src = File.join(cwd, filename)
44
+ dest = File.join(cwd, filename.gsub('.erb', ''))
45
+ content = ERB.new(File.read(src), trim_mode: '-').result(binding)
46
+ File.open(dest, 'w') { |f| f.write(content) }
47
+ dest
48
+ end
49
+
50
+ def ondemand_repo_version
51
+ '2.1'
52
+ end
53
+
54
+ def ruby_version
55
+ '2.7'
56
+ end
57
+
58
+ def scl_ruby
59
+ "rh-ruby#{ruby_version.tr('.', '')}"
60
+ end
61
+
62
+ def nodejs_version
63
+ '14'
64
+ end
65
+
66
+ def ctr_scripts_dir
67
+ '/ondemand-packaging'
68
+ end
69
+
70
+ def gpg_private_key
71
+ File.join(ctr_scripts_dir, 'ondemand.sec')
72
+ end
73
+
74
+ def gpg_passphrase
75
+ File.join(ctr_scripts_dir, '.gpgpass')
76
+ end
77
+
78
+ def ctr_user
79
+ 'ood'
80
+ end
81
+
82
+ def ctr_home
83
+ File.join('/home', ctr_user)
84
+ end
85
+
86
+ def ctr_rpmmacros
87
+ File.join(ctr_home, '.rpmmacros')
88
+ end
89
+
90
+ def ctr_gpg_dir
91
+ File.join(ctr_home, '.gnupg')
92
+ end
93
+ end