Skip to content
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

fix: rename esi-shell option --version to --tag #99

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:

- name: Test esi-shell
run: |
./esi-shell -v ${{ env.TAG }} "opticks-full-prepare && opticks-t"
./esi-shell -t ${{ env.TAG }} "opticks-full-prepare && opticks-t"
13 changes: 6 additions & 7 deletions esi-shell
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ REQUIRED_DOCKER_VERSION=23.0.0

# set default values
IMAGE_NAME="ghcr.io/bnlnpps/esi-shell"
DEFAULT_VERSION="latest"
VERSION=$DEFAULT_VERSION
IMAGE_TAG="latest"
ESI_SHELL_VERSION=
CONTAINER_COMMAND=
CONTAINER_OPTIONS=
Expand All @@ -40,8 +39,8 @@ usage() {
echo " ./esi-shell [OPTIONS] [COMMAND] [-- CONTAINER_OPTIONS]"
echo ""
echo "OPTIONS:"
echo " -v, --version Specific esi-shell version to use (Default: $DEFAULT_VERSION)"
echo " -h, --help Print this message"
echo " -t, --tag Specific esi-shell tag to use (Default: $IMAGE_TAG)"
echo ""
echo "COMMAND is a command to execute in the container, leave it empty for interactive shell. For example:"
echo " pwd"
Expand All @@ -55,7 +54,7 @@ usage() {
echo ""
echo "EXAMPLES:"
echo " - Start an interactive shell: ./esi-shell"
echo " - Use specific version: ./esi-shell -v 0.1.0"
echo " - Use specific tag: ./esi-shell -t 0.1.0"
echo " - Execute a single command: ./esi-shell echo \$OPTIX_DIR"
echo " - Configure remote image: ./esi-shell -- --pull=always -e HOME=\$HOME"
echo ""
Expand Down Expand Up @@ -103,8 +102,8 @@ warn() {
while [[ $# -gt 0 ]]
do
case $1 in
-v | --version)
VERSION=${2:-$DEFAULT_VERSION}
-t | --tag)
IMAGE_TAG=${2:-$IMAGE_TAG}
shift
shift
;;
Expand Down Expand Up @@ -279,7 +278,7 @@ fi
USABLE_SINGULARITY="$(find_tool singularity)"
USABLE_DOCKER="$(find_tool docker)"

IMG=${IMAGE_NAME}:${VERSION}
IMG=${IMAGE_NAME}:${IMAGE_TAG}
ohai "Using esi-shell image: ${IMG}"

if [[ -n "${USABLE_DOCKER-}" ]]
Expand Down