-
Notifications
You must be signed in to change notification settings - Fork 499
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
Fetch module source files using Git or HTTP #1799
Comments
I agree with @casey - the workaround is simpler implementation, more versatile for justfile authors, and easier for end-users to read and understand. Also, adding any network-using feature to |
Ok, agree with your points, one question comes to mind.
but this line in the justfile will be common for both
|
You could have both users import a shared justfile, instead of a shared justfile importing the users modules. |
Let me present a use case: |
That |
Agree that adding that kind of network-related stuff could add some uneeded complexity. Of the few people that are asking for this feature, what are the identified use cases? For instance, if the relevant use-case is recipe re-use, the file could be fetched using some simple recipe dependency: ensure_env:
#!/bin/bash
if [[ -d foo ]]; then
cd foo
git pull
else
git clone [email protected]/foo.git
fi
reciepe_using_dependency *args: ensure_env
just -f .deps/foo.just foobar_recipe {{args}} Let's take @WladyX case. Let's say that the build target_name path:
docker buildx -t "{{target_name}}" {{path}} Then this file could be called in the specific micro-service's cwd := `pwd`
image_name := "my_super_image"
ensure_env:
# Do whatever is necessary to fetch submodule files
build: ensure_env
just -f <path_to_docker_just.build>/docker_build.just build {{image_name}} {{cwd}} Overall I believe that this kind of need could be filled by some cookbook snippets ? |
Had to adapt it a bit because it said:
so my working example is: in the main repo i have:
and in a child repo i have:
seems to work as expected. |
I'm going to close this for now, since I think that the workarounds are reasonable enough. |
Would it be possible to have your "update-mod" recipe "required" to use mod, to avoid the optional mod? I mean, something like:
(1) and (2) are much more trickier than most people think. And I would like this implemented somehow in its own module ! (1): the location can be a subfolder from the current project, but on some shared runner we might want to to place it in a shared location. (2): Also, avoid conflict would require to set the sha1 or the ref of the original location in the path somehow. So different implementation might be possible, so I would let that implemented in a module If you can provide some kind of basic "fetch" capability (not all systems have "curl" for instance), from http and git (with ref support and of course creds), and allow to make this shared/reuse module in its own dedicated module, this would make "just" so powerful. |
A few people would like to be able to load module source files from git or using HTTP.
I think that this probably isn't a good idea, but I wanted to make this issue for discussion.
The feature would work something like this, with some made up syntax:
Just would then fetch the file
https://foo.com/foo.just
and use it as the source for modulefoo
.The main reason that I think this would be a bad idea is the complexity of the feature, the difficulty of getting it right, and the ease of workarounds.
Some hard questions regarding how the feature would work:
just
automatically fetch files, or would you have to tell it to explicitly? The latter is probably better, since you might not wantjust
to fetch and execute files remotely.just
support? HTTP is pretty easy, but a common ask is for git support too.just
update module source files? We'd probably need a subcommand for re-fetching new source files.And the workaround looks something like this:
Then, you could run
just update
to fetch the source file, which would then be loaded the next time you ranjust
. Using git would looks something like:Then, you could run
just update
to fetch the git repofoo
, or update it if it already exists.This allows the user to get whatever behavior they want, so I'm not sure a dedicated feature would be an improvement.
The text was updated successfully, but these errors were encountered: