Skip to content

Instantly share code, notes, and snippets.

@marble
Created January 8, 2020 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marble/61e1bbd6d9611f66ded52d28e72bb8d4 to your computer and use it in GitHub Desktop.
Save marble/61e1bbd6d9611f66ded52d28e72bb8d4 to your computer and use it in GitHub Desktop.
# 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