-
Notifications
You must be signed in to change notification settings - Fork 28
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
Feat: LOGSTASH_PATH auto expanding #100
Conversation
for mapping ENV keys to custom (processed) values
the library handles streaming file downloads for us (we need this as we're going to fetch LS.tar.gz files)
should have noted that both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality makes sense. I have left comments about potentially making the usage more clear.
lib/jarvis/commands/publish.rb
Outdated
@@ -18,7 +20,7 @@ class Bug < ::Jarvis::Error; end | |||
banner "Publish a logstash plugin" | |||
|
|||
option "--workdir", "WORKDIR", "The place where this command will download temporary files and do stuff on disk to complete a given task." | |||
option "--env", "ENV", "ENV variables passed to publish task.", :default => 'JARVIS=true LOGSTASH_SOURCE=false' # to be able to bundle wout LS | |||
option "--env", "ENV", "ENV variables passed to publish task.", :default => 'JARVIS=true LOGSTASH_SOURCE=1 LOGSTASH_PATH=#{releases[last]}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the injection of ruby-style string interpolation into a shell command is likely to cause confusion, may require shell escaping on certain shells, and is likely more heavy-handed than we need.
Could we special-case LOGSTASH_PATH
values starting with RELEASE@
? This would make usage a bit more straight-forward and eliminate some of the complexity of shell-escaping values when using it:
[email protected]
LOGSTASH_PATH=RELEASE@latest
[email protected]
With the above, we could also support SNAPSHOT@
prefixes for situations where we rely on a fix that hasn't made it into a release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @yaauie ... struggled with the 'auto-expanding' naming convention.
very glad you looked into it - will look into changing the format as suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to use the suggested RELEASE/SNAPSHOT@ qualifier ...
this is mostly to be able to publish LS plugins, a Gemfile usually looks like:
plugins usually depend on logstash-core and/or logstash-code-plugin-api gems
plugin-api hasn't been released in a while and possible logstash-core releases will halt as well
publish
command adds--env "LOGSTASH_SOURCE=1 LOGSTASH_PATH=#{releases[last]}"
defaultswhere
LOGSTASH_PATH='#{latest}'
is tracked and #(enclosed) value gets substituted based on LS' release information (one could also override a specific version withLOGSTASH_PATH='#{7.5.1}'
)the brackets
#{...}
part (#(...)
also works - did not figure out anything more suitable) causes a LS release tar.gz download and gems extraction into a temp dir to substitute a validLOGSTASH_PATH=...