Skip to content
Snippets Groups Projects
Commit 414d2542 authored by Jacob Vosmaer's avatar Jacob Vosmaer
Browse files

Add ohai-helper script

parent 1e89d776
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2,7 +2,7 @@ PROJECT=gitlab
RELEASE_BUCKET=downloads-packages
RELEASE_BUCKET_REGION=eu-west-1
SECRET_DIR:=$(shell openssl rand -hex 20)
PLATFORM_DIR:=$(shell ruby -rjson -e 'puts JSON.parse(`bin/ohai`).values_at("platform", "platform_version").join("-")')
PLATFORM_DIR:=$(shell bundle exec support/ohai-helper platform-dir)
 
build:
bin/omnibus build ${PROJECT} --override append_timestamp:false --log-level info
Loading
Loading
#!/usr/bin/env ruby
require 'ohai'
def platform_dir
puts "#{ohai['platform']}-#{ohai['platform_version']}"
end
def repo_string
os = :unknown
version = :unknown
case ohai['platform']
when 'ubuntu'
os = 'ubuntu'
case ohai['platform_version']
when /^12\.04/
version = 'precise'
when /^14\.04/
version = 'trusty'
end
when 'debian'
os = 'debian'
case ohai['platform_version']
when /^7\./
version = 'wheezy'
end
when 'centos'
os = 'el'
case ohai['platform_version']
when /^6\./
version = '6'
when /^7\./
version = '7'
end
end
if os == :unknown or version == :unknown
abort "Unsupported OS: #{ohai.values_at('platform', 'platform_version').inspect}"
end
puts "#{os}/#{version}"
end
def ohai
@ohai ||= Ohai::System.new.tap do |oh|
oh.all_plugins(['platform'])
end.data
end
case ARGV.first
when 'platform-dir'
platform_dir
when 'repo-string'
repo_string
else
abort "Usage: #{$0} platform-dir|repo-string"
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment