diff options
author | Chandan Singh <chandan@chandansingh.net> | 2019-02-15 16:09:21 +0000 |
---|---|---|
committer | Chandan Singh <chandan@chandansingh.net> | 2019-02-15 16:09:21 +0000 |
commit | 677fc6c54252a09b929f434ca3e95b5b65108721 (patch) | |
tree | bead388f3bddb04bdf7e769b34480a0d33099e28 | |
parent | 91eb29a65941df15e515fb7956202c251225008e (diff) | |
parent | 2699c77cb8653560ee2e90c081b2208147a726a1 (diff) | |
download | buildstream-677fc6c54252a09b929f434ca3e95b5b65108721.tar.gz |
Merge branch 'chandan/bst-here-tags' into 'master'
contrib/bst-here: Allow users to specify image variant
See merge request BuildStream/buildstream!1153
-rwxr-xr-x | contrib/bst-here | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/contrib/bst-here b/contrib/bst-here index 037788e3a..01c2d2c13 100755 --- a/contrib/bst-here +++ b/contrib/bst-here @@ -25,16 +25,22 @@ usage() { cat <<EOF -USAGE: $(basename "$0") [-i BST_HERE_IMAGE] [-p] [-t] [-T] [-v VOLUME ...] [-h] [COMMAND [ARG..]] +USAGE: $(basename "$0") [-i BST_HERE_IMAGE] [-j TAG] [-p] [-t] [-T] [-v VOLUME ...] [-h] [COMMAND [ARG..]] Run a bst command in a new BuildStream container. If no command is specified, an interactive shell is launched using "/bin/bash -i". +See https://hub.docker.com/r/buildstream/buildstream for details on image +variants. + OPTIONS: -i IMAGE Specify Docker image to use; can also be specified by setting BST_HERE_IMAGE environment variable. + (default: buildstream/buildstream) + -j TAG Specify the tag of the Docker image to use. + (default: latest) -p Pull the latest buildstream image before running. -t Force pseudo-terminal allocation. -T Disable pseudo-terminal allocation. @@ -46,7 +52,8 @@ EOF exit "$1" } -bst_here_image="${BST_HERE_IMAGE:-buildstream/buildstream-fedora:latest}" +bst_here_image="${BST_HERE_IMAGE:-buildstream/buildstream}" +bst_here_tag= is_tty= update=false @@ -57,12 +64,15 @@ then is_tty=y fi -while getopts i:ptTv:h arg +while getopts i:j:ptTv:h arg do case $arg in i) bst_here_image="$OPTARG" ;; + j) + bst_here_tag="$OPTARG" + ;; p) update=true ;; @@ -83,6 +93,10 @@ do esac done +if [ -n "$bst_here_tag" ]; then + bst_here_image="$bst_here_image:$bst_here_tag" +fi + test "$OPTIND" -gt 1 && shift $(( OPTIND - 1 )) |