-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Support run/plan jobfile via URL location #1511
Conversation
Suppot jobfile via URL like below:
|
This is cool! I have three requests:
|
Thank you. I added 2) support But please let me discuss about using go-getter. While, if we use go-getter with supported protocol (e.g git/hg), it will not download only one jobfile, but git/hg clone entire repository. So, I feel it is not efficient. (For example...) If I try to use this git project file with go-getter, it will clone entire git project and specify the one file. |
Hey @nak3, In the specific case that you give it a git repo, you are correct that it will download the whole thing. However, if you give it the raw url to the file in github like (https://raw.githubusercontent.com/nak3/nomad-playground/master/jobs/nginx.nomad) it will download it using HTTP. By using go-getter you can download the file from more locations which is nice. We should also refactor the code into a helper so that we don't duplicate everywhere |
@dadgar OK, I understand. I update them to use |
@@ -216,3 +222,63 @@ READ: | |||
// Just stream from the underlying reader now | |||
return l.ReadCloser.Read(p) | |||
} | |||
|
|||
type Helper struct { |
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.
Lets change the name to JobGetter
and add a comment on the struct
Small comments but LGTM |
Thank you. I updated them. |
@nak3 Looks like the tests are failing |
@dadgar I don't think test was failed due to this PR. I fetched and re-push the PR, and now it passed tests. |
Ah... The travis tests misreport their success right now. Working on that. Here are the raw logs: TestPlanCommand_From_URL |
Oh, sorry. I missed it. Thank you. I updated. |
Awesome thank you so much! |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
No description provided.