Created
January 8, 2020 15:24
-
-
Save marble/61e1bbd6d9611f66ded52d28e72bb8d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# what we pull | |
TAG_1=develop-benjaminkott | |
# what we use | |
TAG_2="2.5.0-dev-bk" | |
# where to keep the shell-commands.sh file | |
T3DOCS_DOCKRUN_SOURCE_FOLDER=~/.dockrun/dockrun_t3rd | |
# what file gets sourced from .zshrc | |
T3DOCS_DOCKRUN_SOURCE=~/.dockrun/dockrun_t3rd/shell-commands.sh | |
headline () { | |
echo | |
echo "$1" | |
echo "==================================================" | |
} | |
run () { | |
echo "$1" | |
echo | |
eval "$1" | |
} | |
headline "What Docker images do we have?" | |
run "docker image ls | grep t3docs/render-documentation" | |
headline "Pull from Docker" | |
run "docker pull t3docs/render-documentation:develop-benjaminkott" | |
headline "Create tag $TAG_2" | |
run "docker tag t3docs/render-documentation:$TAG_1 t3docs/render-documentation:$TAG_2" | |
headline "Run the Docker image" | |
run "docker run --rm t3docs/render-documentation:$TAG_2" | |
headline "Show shell commands" | |
run "docker run --rm t3docs/render-documentation:$TAG_2 show-shell-commands" | |
if ((1)) && [[ -d "$T3DOCS_DOCKRUN_SOURCE_FOLDER" ]]; then | |
headline "Save shell commands for shell" | |
run "docker run --rm t3docs/render-documentation:$TAG_2 show-shell-commands >\"$T3DOCS_DOCKRUN_SOURCE\"" | |
headline "Activate the dockrun_t3rd command" | |
source "$T3DOCS_DOCKRUN_SOURCE" | |
fi | |
headline "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment