diff options
-rwxr-xr-x | contrib/bst-here | 8 | ||||
-rw-r--r-- | doc/source/docker.rst | 19 |
2 files changed, 17 insertions, 10 deletions
diff --git a/contrib/bst-here b/contrib/bst-here index 595807df4..6b4e6b2f7 100755 --- a/contrib/bst-here +++ b/contrib/bst-here @@ -58,6 +58,12 @@ done BST_HERE_PS1="\[\033[01;34m\]\w\[\033[00m\]> " +if [ "$#" -eq 0 ]; then + command="/bin/bash -i" +else + command="/usr/bin/bst $@" +fi + exec docker run --rm -i${is_tty:+ -t} \ --cap-add SYS_ADMIN \ --env PS1="$BST_HERE_PS1" \ @@ -68,4 +74,4 @@ exec docker run --rm -i${is_tty:+ -t} \ --volume "$PWD":/src \ --workdir /src \ buildstream/buildstream-fedora:latest \ - "$@" + $command diff --git a/doc/source/docker.rst b/doc/source/docker.rst index 55e456d87..20dc6a9c1 100644 --- a/doc/source/docker.rst +++ b/doc/source/docker.rst @@ -21,18 +21,19 @@ Check if ``~/.local/bin`` appears in your PATH environment variable -- if it doesn't, you should `edit your ~/.profile so that it does <https://stackoverflow.com/questions/14637979/>`_. -Once ``bst-here`` is available in your PATH, you just prefix every BuildStream -command you need to run with ``bst-here`` so that it executes through the -wrapper. The latest version of the buildstream-fedora Docker image is -automatically pulled if needed. The contents of your working directory will be -made available at ``/src`` inside the container. +Once the script is available in your PATH, you can run ``bst-here`` to open a +shell session inside a new container based off the latest version of the +buildstream-fedora Docker image. The current working directory will be mounted +inside the container at ``/src``. -Two other volumes are set up by the ``bst-here`` script: +You can also run individual BuildStream commands as ``bst-here COMMAND``. For +example: ``bst-here show systems/my-system.bst``. Note that BuildStream won't +be able to integrate with Bash tab-completion if you invoke it in this way. + +Two Docker volumes are set up by the ``bst-here`` script: * buildstream-cache -- mounted at ``~/.cache/buildstream`` * buildstream-config -- mounted at ``~/.config/`` These are necessary so that your BuildStream cache and configuration files -persist between invocations of ``bst-here``. You can open a shell inside the -container by running ``bst-here -t /bin/bash``, which is useful if for example -you need to add something custom to ``~/.config/buildstream.conf``. +persist between invocations of ``bst-here``. |