Replies: 1 comment
-
I created a little repository that demos the functionality: https://github.com/jceb/just-docker Here are more examples of how this could be used: https://github.com/jceb/just-docker/blob/main/Justfile#L38 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For some time, I've been using Just to write big tasks that are called from CI/CD pipelines - GitHub Actions and GitLab Runner. This has the advantage, that I can test and execute most parts of my pipelines locally on my computer and reduce lock-in into one specific CI/CD pipeline runner.
I've been thinking about how Just could be even more useful for CI/CD pipeline execution. One of the big challenges for pipelines is to have all the required tools in place, e.g. the correct Java or Node version + many other tools that are complex to set up. Containers are the status quo of how tools are brought into pipelines. How Just could be enhanced with Docker Containers?
Since Just supports custom Shebang lines, I came up with the following prototype. I created a custom program
env
that takes a script and executes it inside a container + it mounts the local directory.Then, I created the following Justfile (currently, there's bug #2027 that prevents the
run-nu
task to work properly):I'm a neovim user, so I rely on https://github.com/IndianBoy42/tree-sitter-just for syntax highlighting. Therefore, syntax highlighting works fine for bash and nushell code as long as the executing program is called
env
;-) 👍The
env
program receives from Just the task's script in a separate file as the last argument.env
then runs a docker container as the current user, mounts the current path and the script, and finally executes the script via the specified interpreter.I'm wondering, should such a mechanism be added to Just or should it stay as a separate solution? Should it be a separate script (e.g.
docker-env
/just-env
) or should it be something built into Just's language? Also, how should different runtimes, apart from docker, be supported?Thank you for considering this idea. I'm looking forward to your feedback.
Beta Was this translation helpful? Give feedback.
All reactions