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

Add "checksum" option for slave-jar remote_file resource #12

Merged
merged 1 commit into from
Aug 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libraries/slave_jnlp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ def slave_jar_url
@slave_jar_url ||= uri_join(endpoint, 'jnlpJars', 'slave.jar')
end

#
# The checksum of the +slave.jar+.
#
# @return [String]
#
def slave_jar_checksum
@slave_jar_checksum ||= new_resource.checksum

Choose a reason for hiding this comment

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

What if new_resource.checksum is nil?
FYI cdacfb2

end

#
# The path to the +slave.jar+ on disk (which may or may not exist).
#
Expand Down Expand Up @@ -211,6 +220,7 @@ def slave_jar_resource
build_resource(:remote_file, slave_jar).tap do |r|
# We need to use .tap() to access methods in the provider's scope.
r.source slave_jar_url
r.checksum slave_jar_checksum

Choose a reason for hiding this comment

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

same here

r.backup(false)
r.mode('0755')
r.atomic_update(false)
Expand Down