Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG FIX] Linux installers #203

Merged
merged 21 commits into from Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/habitat_shared.rb
Expand Up @@ -19,7 +19,7 @@ module Shared
HAB_VERSION = '1.5.0'.freeze
LINUX_LAUNCHER_VERSION = '13013'.freeze
WINDOWS_LAUNCHER_VERSION = '13013'.freeze
WINDOWS_SERVICE_VERSION = '0.6.0'.freeze
WINDOWS_SERVICE_VERSION = '0.5.0'.freeze

def hab_version
HAB_VERSION
Expand Down
4 changes: 1 addition & 3 deletions libraries/provider_hab_package.rb
Expand Up @@ -110,9 +110,7 @@ def strip_version(name)
def platform_target
if platform_family?('windows')
'target=x86_64-windows'
elsif platform_family?('rhel') && node['platform_version'].to_i < 6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This was some hot nonesense here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was causing some serious crazy to happen

'target=x86_64-linux-kernel2'
elsif platform_family?('suse') && node['platform_version'].to_i < 6
elsif node['kernel']['release'].to_i < 3
'target=x86_64-linux-kernel2'
else
''
Expand Down
1 change: 1 addition & 0 deletions libraries/resource_hab_sup_systemd.rb
Expand Up @@ -39,6 +39,7 @@ class HabSupSystemd < HabSup
LimitNOFILE: (new_resource.limit_no_files if new_resource.limit_no_files),
Environment: service_environment,
ExecStart: "/bin/hab sup run #{exec_start_options}",
ExecStop: '/bin/hab sup term',
Restart: 'on-failure',
}.compact,
Install: {
Expand Down
6 changes: 5 additions & 1 deletion resources/install.rb
Expand Up @@ -175,7 +175,11 @@ def hab_path
end

def hab_command
cmd = ["bash #{Chef::Config[:file_cache_path]}/hab-install.sh", "-v #{hab_version}"]
cmd = if node['kernel']['release'].to_i < 3
["bash #{Chef::Config[:file_cache_path]}/hab-install.sh", "-v #{hab_version} -t x86_64-linux-kernel2"]
else
["bash #{Chef::Config[:file_cache_path]}/hab-install.sh", "-v #{hab_version}"]
end
cmd.join(' ')
end
end
1 change: 1 addition & 0 deletions spec/unit/sup_spec.rb
Expand Up @@ -90,6 +90,7 @@
Service: {
Environment: [],
ExecStart: '/bin/hab sup run --listen-gossip 0.0.0.0:7998 --listen-http 0.0.0.0:7999 --peer 127.0.0.2 --peer 127.0.0.3',
ExecStop: '/bin/hab sup term',
Restart: 'on-failure',
},
Install: {
Expand Down
22 changes: 11 additions & 11 deletions test/fixtures/cookbooks/test/recipes/service.rb
Expand Up @@ -25,7 +25,7 @@
raise 'nginx not loaded' unless system 'hab svc status core/nginx'
end
retries 5
retry_delay 1
retry_delay 10
action :nothing
subscribes :run, 'hab_service[core/nginx]', :immediately
end
Expand All @@ -34,7 +34,7 @@
raise 'nginx not loaded' unless `hab svc status core/nginx`.match(/standalone\s+up\s+up/)
end
retries 5
retry_delay 1
retry_delay 10
action :nothing
subscribes :run, 'ruby_block[wait-for-nginx-load]', :immediately
end
Expand All @@ -60,7 +60,7 @@
raise 'redis not loaded' unless system 'hab svc status core/redis'
end
retries 5
retry_delay 1
retry_delay 10
action :nothing
subscribes :run, 'hab_service[core/redis]', :immediately
end
Expand All @@ -69,7 +69,7 @@
raise 'redis not started' unless `hab svc status core/redis`.match(/standalone\s+up\s+up/)
end
retries 5
retry_delay 1
retry_delay 10
action :nothing
subscribes :run, 'ruby_block[wait-for-redis-load]', :immediately
end
Expand All @@ -93,7 +93,7 @@
raise 'grafana not loaded' unless system 'hab svc status core/grafana'
end
retries 5
retry_delay 1
retry_delay 10
action :nothing
subscribes :run, 'hab_service[core/grafana full identifier]', :immediately
end
Expand All @@ -111,7 +111,7 @@
raise 'vault not loaded' unless system 'hab svc status core/vault'
end
retries 5
retry_delay 1
retry_delay 10
action :nothing
subscribes :run, 'hab_service[core/vault]', :immediately
end
Expand Down Expand Up @@ -153,7 +153,7 @@
raise 'prometheus not loaded' unless system 'hab svc status core/prometheus'
end
retries 5
retry_delay 1
retry_delay 10
action :nothing
subscribes :run, 'hab_service[core/prometheus]', :immediately
end
Expand Down Expand Up @@ -196,7 +196,7 @@
raise 'consul not loaded' unless system 'hab svc status core/consul'
end
retries 5
retry_delay 1
retry_delay 10
action :nothing
subscribes :run, 'hab_service[core/consul]', :immediately
end
Expand All @@ -205,7 +205,7 @@
raise 'consul not started' unless `hab svc status core/consul`.match(/standalone\s+up\s+up/)
end
retries 5
retry_delay 1
retry_delay 10
action :nothing
subscribes :run, 'ruby_block[wait-for-consul-load]', :immediately
end
Expand All @@ -216,7 +216,7 @@
raise 'consul not started for 30s' unless uptime.size == 2 && Integer(uptime[1]) > 30
end
retries 30
retry_delay 1
retry_delay 2
action :nothing
subscribes :run, 'ruby_block[wait-for-consul-startup]', :immediately
end
Expand Down Expand Up @@ -260,7 +260,7 @@
raise 'consul not restarted' unless !uptime.nil? && uptime.size == 2 && Integer(uptime[1]) < 30
end
retries 5
retry_delay 1
retry_delay 10
action :nothing
subscribes :run, 'hab_service[core/consul restart]', :immediately
end