diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
new file mode 100644
index 0000000000..0e22ad5a8d
--- /dev/null
+++ b/.github/workflows/docker.yml
@@ -0,0 +1,62 @@
+name: Build Docker Images
+
+on:
+ push:
+ paths-ignore:
+ - "*.md"
+ - "binder/**"
+ - "docs/**"
+ - "examples/**"
+
+jobs:
+ build:
+ name: Build Docker Images
+ runs-on: ubuntu-latest
+ if: "!contains(github.event.head_commit.message , 'ci skip')"
+ steps:
+ - name: Clone Main Repo
+ uses: actions/checkout@v2
+ with:
+ path: main
+ - name: Clone Wiki
+ uses: actions/checkout@v2
+ with:
+ repository: ${{github.repository}}.wiki
+ path: wiki
+ - name: Set Up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.8
+ - name: Install Dev Dependencies
+ run: |
+ python -m pip install --upgrade pip
+ make -C main dev-env lint-install
+ - name: Lint Dockerfiles
+ run: make -C main lint-all
+ - name: Build Docker Images
+ run: make -C main build-test-all
+ - name: Run Post-Build Hooks
+ run: make -C main hook-all
+ env:
+ COMMIT_MSG: "${{github.event.head_commit.message}}"
+ WIKI_PATH: ../wiki
+
+ push:
+ name: Push Docker Images
+ runs-on: ubuntu-latest
+ needs:
+ - build
+ if: github.ref == 'refs/heads/master'
+ steps:
+ - name: Login to Docker Hub
+ run: >
+ echo '${{secrets.DOCKERHUB_PASSWORD}}' | docker login --username
+ '${{secrets.DOCKERHUB_USERNAME}}'' --password-stdin
+ - name: Push Images to DockerHub
+ run: make -C main push-all
+ - name: Push Wiki to GitHub
+ run: make -C main git-commit
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_REPOSITORY: ${{github.repository}}.wiki
+ LOCAL_PATH: ../wiki
diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml
new file mode 100644
index 0000000000..04c5ae374b
--- /dev/null
+++ b/.github/workflows/sphinx.yml
@@ -0,0 +1,45 @@
+name: Build Sphinx Documentation
+
+on:
+ push:
+ paths:
+ - "docs/**"
+ - ".github/workflows/sphinx.yml"
+
+jobs:
+ build:
+ name: Build Sphinx Documentation
+ runs-on: ubuntu-latest
+ if: "!contains(github.event.head_commit.message , 'ci skip')"
+ steps:
+ - name: Checkout Repo
+ uses: actions/checkout@v2
+ - name: Set Up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.x
+ - name: Install Dev Dependencies
+ run: |
+ python -m pip install --upgrade pip
+ make dev-env
+ - name: Build Documentation
+ run: make docs
+
+ gettext:
+ name: Update Translation Source Strings
+ runs-on: ubuntu-latest
+ needs:
+ - build
+ if: github.ref == 'refs/heads/master'
+ steps:
+ - name: Extract Source Strings
+ working-directory: docs
+ run: |
+ make gettext
+ sphinx-intl update -p _build/gettext -l en
+ - name: Push Strings to Master
+ run: make git-commit
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_REPOSITORY: ${{ github.repository }}
+ LOCAL_PATH: ./docs/locale/en
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 5c41139572..0000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,48 +0,0 @@
----
-dist: bionic
-language: python
-python:
- - 3.7
-sudo: required
-services:
- - docker
-
-jobs:
- include:
- - stage: diff-test
- install:
- - pip install --upgrade pip
- - make dev-env
- - make lint-install
- script:
- - set -e
- - if [ $(make n-docs-diff) -ne 0 ]; then make docs; fi;
- - if [ $(make n-other-diff) -ne 0 ]; then make lint-build-test-all DARGS="--build-arg TEST_ONLY_BUILD=1"; fi;
- - stage: push-tx
- install:
- - pip install --upgrade pip
- - make dev-env
- script:
- - if [ $(make n-docs-diff DIFF_RANGE=$TRAVIS_COMMIT_RANGE) -ne 0 ]; then make tx-en; fi;
- - stage: full-test
- install:
- - pip install --upgrade pip
- - make dev-env
- - make lint-install
- script:
- - set -e
- - make docs
- - make lint-build-test-all DARGS="--build-arg TEST_ONLY_BUILD=1"
-
-stages:
- - name: diff-test
- if: type = pull_request
- - name: push-tx
- if: type = push AND branch = master
- - name: full-test
- if: type = cron AND branch = master
-
-env:
- global:
- # yamllint disable-line
- secure: JDQKgB1laaenzmEGI9gduwK/iS0030qsl62njJg3jib0R8wxBi2OeetEdoGl9m4NFsqqnp0OO7nm4rzGfuwjL1A38flSlXOTxhjm/hvo3vmnqVu5lDcdk9+IRkafnfd3Dyd86tLxRVETOqZwCLmdNkB2fmQII8du5IIqbJuUGp8DrG7kVMf3NBr9rjkZRfByQrgG4s1NXuT61VvpWMPJAOhcrImuHBheVJDEV0U3n6Xavd7Wo+pAHrHU8exvYTZ1IzZMbHc6K0iC/NpCHcH9+9DAeLDk/q1aDNqbTExnQevOHZzNqgHC2qFOlN4jfy/TLYLpLXtUismneBBqVSK3iZso3Vqy2BRXWgouI+Tt+08ffocy9XPwEzSwkgPgDlFVUikPOy5imwjpDb13RMIyMY4CKlSOdQx2rH2kPkZ0MJJPcki3KGuGl3qRvqyblMn+lZvjAu6WVLZfo7EtcxsQ0ZZxbAbGoUVl27FHg+UvIfC0I3wEcZIp7oED47Q8s0MdCijD3AwkRPvx/iyp3J0A42su7kkOooFcmUItEIqegQJ4Aki1FBv2i5vHmBobClktytZceLsKvzCeLjMpL9HcUVfUaJDKRwtUYIozpYeBnac+E6J1s6glcqLrXIHWez8N6SzokBa6SPqdtODdzzk5OJupByub6CYWsRXvxIQ7/wI=
diff --git a/Makefile b/Makefile
index 5ab9caf1ba..b8d255011d 100644
--- a/Makefile
+++ b/Makefile
@@ -4,9 +4,8 @@
# Use bash for inline if-statements in arch_patch target
SHELL:=bash
-OWNER:=jupyter
ARCH:=$(shell uname -m)
-DIFF_RANGE?=master...HEAD
+OWNER?=jupyter
# Need to list the images in build dependency order
ifeq ($(ARCH),ppc64le)
@@ -76,22 +75,34 @@ dev/%: ## run a foreground container for a stack
dev-env: ## install libraries required to build docs and run tests
pip install -r requirements-dev.txt
-lint/%: ARGS?=
-lint/%: ## lint the dockerfile(s) for a stack
- @echo "Linting Dockerfiles in $(notdir $@)..."
- @git ls-files --exclude='Dockerfile*' --ignored $(notdir $@) | grep -v ppc64 | xargs -L 1 $(HADOLINT) $(ARGS)
- @echo "Linting done!"
-
-lint-all: $(foreach I,$(ALL_IMAGES),lint/$(I) ) ## lint all stacks
+docs: ## build HTML documentation
+ make -C docs html
-lint-build-test-all: $(foreach I,$(ALL_IMAGES),lint/$(I) arch_patch/$(I) build/$(I) test/$(I) ) ## lint, build and test all stacks
+git-commit: LOCAL_PATH?=.
+git-commit: export GITHUB_SHA?=$(shell git rev-parse HEAD)
+git-commit: GITHUB_REPOSITORY?=jupyter/docker-stacks
+git-commit: ## commit outstading git changes and push to remote
+ @git config --global user.name "GitHub Actions"
+ @git config --global user.email "actions@users.noreply.github.com"
+ @git remote add publisher https://$${GITHUB_TOKEN}@github.com/$${GITHUB_REPOSITORY}.git
-lint-install: ## install hadolint
- @echo "Installing hadolint at $(HADOLINT) ..."
- @curl -sL -o $(HADOLINT) "https://github.com/hadolint/hadolint/releases/download/v1.18.0/hadolint-$(shell uname -s)-$(shell uname -m)"
- @chmod 700 $(HADOLINT)
- @echo "Installation done!"
- @$(HADOLINT) --version
+ @cd $(LOCAL_PATH)
+ @git checkout master
+ @git add -A -- .
+ @git commit -m "[ci skip] Automated publish for $${GITHUB_SHA}" || exit 0
+ @git push -u publisher master
+
+hook/%: export COMMIT_MSG?=$(shell git log -1 --pretty=%B)
+hook/%: export GITHUB_SHA?=$(shell git rev-parse HEAD)
+hook/%: export WIKI_PATH?=../wiki
+hook/%: ## run post-build hooks for an image
+ BUILD_TIMESTAMP="$$(date -u +%FT%TZ)" \
+ DOCKER_REPO="$(OWNER)/$(notdir $@)" \
+ IMAGE_NAME="$(OWNER)/$(notdir $@):latest" \
+ IMAGE_SHORT_NAME="$(notdir $@)" \
+ $(SHELL) $(notdir $@)/hooks/run_hook
+
+hook-all: $(foreach I,$(ALL_IMAGES),hook/$(I) ) ## run post-build hooks for all images
img-clean: img-rm-dang img-rm ## clean dangling and jupyter images
@@ -107,20 +118,33 @@ img-rm-dang: ## remove dangling images (tagged None)
@echo "Removing dangling images ..."
-docker rmi --force $(shell docker images -f "dangling=true" -q) 2> /dev/null
-docs: ## build HTML documentation
- make -C docs html
+lint/%: ARGS?=
+lint/%: ## lint the dockerfile(s) for a stack
+ @echo "Linting Dockerfiles in $(notdir $@)..."
+ @git ls-files --exclude='Dockerfile*' --ignored $(notdir $@) | grep -v ppc64 | xargs -L 1 $(HADOLINT) $(ARGS)
+ @echo "Linting done!"
-n-docs-diff: ## number of docs/ files changed since branch from master
- @git diff --name-only $(DIFF_RANGE) -- docs/ ':!docs/locale' | wc -l | awk '{print $$1}'
+lint-all: $(foreach I,$(ALL_IMAGES),lint/$(I) ) ## lint all stacks
+lint-build-test-all: $(foreach I,$(ALL_IMAGES),lint/$(I) arch_patch/$(I) build/$(I) test/$(I) ) ## lint, build and test all stacks
-n-other-diff: ## number of files outside docs/ changed since branch from master
- @git diff --name-only $(DIFF_RANGE) -- ':!docs/' | wc -l | awk '{print $$1}'
+lint-install: ## install hadolint
+ @echo "Installing hadolint at $(HADOLINT) ..."
+ @curl -sL -o $(HADOLINT) "https://github.com/hadolint/hadolint/releases/download/v1.18.0/hadolint-$(shell uname -s)-$(shell uname -m)"
+ @chmod 700 $(HADOLINT)
+ @echo "Installation done!"
+ @$(HADOLINT) --version
pull/%: DARGS?=
pull/%: ## pull a jupyter image
docker pull $(DARGS) $(OWNER)/$(notdir $@)
+push/%: DARGS?=
+push/%: ## push all tags for a jupyter image
+ docker push $(DARGS) $(OWNER)/$(notdir $@)
+
+push-all: $(foreach I,$(ALL_IMAGES),push/$(I) ) ## push all tagged images
+
run/%: DARGS?=
run/%: ## run a bash in interactive mode in a stack
docker run -it --rm $(DARGS) $(OWNER)/$(notdir $@) $(SHELL)
@@ -129,20 +153,6 @@ run-sudo/%: DARGS?=
run-sudo/%: ## run a bash in interactive mode as root in a stack
docker run -it --rm -u root $(DARGS) $(OWNER)/$(notdir $@) $(SHELL)
-tx-en: ## rebuild en locale strings and push to master (req: GH_TOKEN)
- @git config --global user.email "travis@travis-ci.org"
- @git config --global user.name "Travis CI"
- @git checkout master
-
- @make -C docs clean gettext
- @cd docs && sphinx-intl update -p _build/gettext -l en
-
- @git add docs/locale/en
- @git commit -m "[ci skip] Update en source strings (build: $$TRAVIS_JOB_NUMBER)"
-
- @git remote add origin-tx https://$${GH_TOKEN}@github.com/jupyter/docker-stacks.git
- @git push -u origin-tx master
-
test/%: ## run tests against a stack (only common tests or common tests + specific tests)
@if [ ! -d "$(notdir $@)/test" ]; then TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest -m "not info" test; \
else TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest -m "not info" test $(notdir $@)/test; fi
diff --git a/all-spark-notebook/hooks/index.tmpl b/all-spark-notebook/hooks/index.tmpl
deleted file mode 100644
index fb2c60560c..0000000000
--- a/all-spark-notebook/hooks/index.tmpl
+++ /dev/null
@@ -1,2 +0,0 @@
-INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${SOURCE_COMMIT}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
-sed "/|-|/a ${INDEX_ROW}" -i "$INDEX_FILE"
\ No newline at end of file
diff --git a/all-spark-notebook/hooks/post_push b/all-spark-notebook/hooks/post_push
deleted file mode 100755
index 1f9f191457..0000000000
--- a/all-spark-notebook/hooks/post_push
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-set -e
-
-# Tag the latest build with the short git sha. Push the tag in addition
-# to the "latest" tag already pushed.
-GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
-docker tag $IMAGE_NAME $DOCKER_REPO:$GIT_SHA_TAG
-docker push $DOCKER_REPO:$GIT_SHA_TAG
-
-# Create a working directory.
-BUILD_TIMESTAMP=$(date -u +%FT%TZ)
-WORKDIR=$(mktemp -d)
-GIT_URI="git@github.com:jupyter/docker-stacks.wiki.git"
-GIT_SANDBOX="${WORKDIR}/docker-stacks.wiki"
-IMAGE_SHORT_NAME=$(basename $DOCKER_REPO)
-MANIFEST_FILE="${GIT_SANDBOX}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
-INDEX_FILE="${GIT_SANDBOX}/Home.md"
-
-# Configure git so it can push back to GitHub.
-eval $(ssh-agent -s)
-ssh-add <(base64 -d <(echo "$DEPLOY_KEY"))
-ssh-add -l
-git config --global user.email "jupyter@googlegroups.com"
-git config --global user.name "Jupyter Docker Stacks"
-
-# Glone the GitHub project wiki.
-pushd "$WORKDIR"
-git clone "$GIT_URI"
-popd
-
-# Render the build manifest template.
-mkdir -p $(dirname "$MANIFEST_FILE")
-source hooks/manifest.tmpl
-source hooks/index.tmpl
-
-# Push the wiki update back to GitHub.
-pushd "$GIT_SANDBOX"
-git add .
-git commit -m "DOC: Build ${MANIFEST_FILE}"
-git push -u origin master
-popd
-
-# Shutdown the ssh agent for good measure.
-ssh-agent -k
-
-# Invoke all downstream build triggers.
-set +e
-for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g")
-do
- curl -X POST $url
-done
\ No newline at end of file
diff --git a/all-spark-notebook/hooks/manifest.tmpl b/all-spark-notebook/hooks/run_hook
old mode 100644
new mode 100755
similarity index 52%
rename from all-spark-notebook/hooks/manifest.tmpl
rename to all-spark-notebook/hooks/run_hook
index 69610a25da..cbfc0d6a46
--- a/all-spark-notebook/hooks/manifest.tmpl
+++ b/all-spark-notebook/hooks/run_hook
@@ -1,9 +1,23 @@
+#!/bin/bash
+set -e
+
+# Apply tags
+GIT_SHA_TAG=${GITHUB_SHA:0:12}
+docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
+
+# Update index
+INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${GITHUB_SHA}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
+sed "/|-|/a ${INDEX_ROW}" -i "${WIKI_PATH}/Home.md"
+
+# Build manifest
+MANIFEST_FILE="${WIKI_PATH}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
+mkdir -p $(dirname "$MANIFEST_FILE")
+
cat << EOF > "$MANIFEST_FILE"
* Build datetime: ${BUILD_TIMESTAMP}
-* DockerHub build code: ${BUILD_CODE}
* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
-* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
+* Git commit SHA: [${GITHUB_SHA}](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
* Git commit message:
\`\`\`
${COMMIT_MSG}
diff --git a/base-notebook/hooks/apply_tags b/base-notebook/hooks/apply_tags
deleted file mode 100644
index 580fae9762..0000000000
--- a/base-notebook/hooks/apply_tags
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-set -e
-
-# Tag the latest build with the short git sha as well as version of key runtimes
-# and packages.
-GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
-docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
-PY_VERSION_TAG="python-$(docker run --rm ${IMAGE_NAME} python --version 2>&1 | awk '{print $2}')"
-docker tag $IMAGE_NAME "$DOCKER_REPO:$PY_VERSION_TAG"
-NB_VERSION_TAG="notebook-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyter-notebook --version | tr -d '\r')"
-docker tag $IMAGE_NAME "$DOCKER_REPO:${NB_VERSION_TAG%% }"
-LAB_VERSION_TAG="lab-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyter-lab --version | tr -d '\r')"
-docker tag $IMAGE_NAME "$DOCKER_REPO:${LAB_VERSION_TAG%%\r}"
-HUB_VERSION_TAG="hub-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyterhub --version | tr -d '\r')"
-docker tag $IMAGE_NAME "$DOCKER_REPO:${HUB_VERSION_TAG%%\r}"
\ No newline at end of file
diff --git a/base-notebook/hooks/index.tmpl b/base-notebook/hooks/index.tmpl
deleted file mode 100644
index c6f8f897f1..0000000000
--- a/base-notebook/hooks/index.tmpl
+++ /dev/null
@@ -1,2 +0,0 @@
-INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${PY_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${NB_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${LAB_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${HUB_VERSION_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${SOURCE_COMMIT}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
-sed "/|-|/a ${INDEX_ROW}" -i "$INDEX_FILE"
\ No newline at end of file
diff --git a/base-notebook/hooks/manifest.tmpl b/base-notebook/hooks/manifest.tmpl
deleted file mode 100644
index 378a94cb1b..0000000000
--- a/base-notebook/hooks/manifest.tmpl
+++ /dev/null
@@ -1,31 +0,0 @@
-cat << EOF > "$MANIFEST_FILE"
-* Build datetime: ${BUILD_TIMESTAMP}
-* DockerHub build code: ${BUILD_CODE}
-* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
-* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
-* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
-* Git commit message:
-\`\`\`
-${COMMIT_MSG}
-\`\`\`
-
-## Python Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} python --version)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda info)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda list)
-\`\`\`
-
-## Apt Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} apt list --installed)
-\`\`\`
-EOF
\ No newline at end of file
diff --git a/base-notebook/hooks/post_checkout b/base-notebook/hooks/post_checkout
deleted file mode 100644
index b72ed53b68..0000000000
--- a/base-notebook/hooks/post_checkout
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-if [[ "$COMMIT_MSG" = *"skip ci"* || "$COMMIT_MSG" = *"ci skip"* ]]; then
- exit 1;
-fi
\ No newline at end of file
diff --git a/base-notebook/hooks/post_push b/base-notebook/hooks/post_push
deleted file mode 100755
index 07c18214fd..0000000000
--- a/base-notebook/hooks/post_push
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-set -e
-
-# Apply and push all tags
-source hooks/apply_tags
-docker push $DOCKER_REPO
-
-# Create a working directory.
-BUILD_TIMESTAMP=$(date -u +%FT%TZ)
-WORKDIR=$(mktemp -d)
-GIT_URI="git@github.com:jupyter/docker-stacks.wiki.git"
-GIT_SANDBOX="${WORKDIR}/docker-stacks.wiki"
-IMAGE_SHORT_NAME=$(basename $DOCKER_REPO)
-MANIFEST_FILE="${GIT_SANDBOX}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
-INDEX_FILE="${GIT_SANDBOX}/Home.md"
-
-# Configure git so it can push back to GitHub.
-eval $(ssh-agent -s)
-ssh-add <(base64 -d <(echo "$DEPLOY_KEY"))
-ssh-add -l
-git config --global user.email "jupyter@googlegroups.com"
-git config --global user.name "Jupyter Docker Stacks"
-
-# Glone the GitHub project wiki.
-pushd "$WORKDIR"
-git clone "$GIT_URI"
-popd
-
-# Render the build manifest template.
-mkdir -p $(dirname "$MANIFEST_FILE")
-source hooks/manifest.tmpl
-source hooks/index.tmpl
-
-# Push the wiki update back to GitHub.
-pushd "$GIT_SANDBOX"
-git add .
-git commit -m "DOC: Build ${MANIFEST_FILE}"
-git push -u origin master
-popd
-
-# Shutdown the ssh agent for good measure.
-ssh-agent -k
-
-# Invoke all downstream build triggers.
-set +e
-for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g")
-do
- curl -X POST $url
-done
\ No newline at end of file
diff --git a/base-notebook/hooks/run_hook b/base-notebook/hooks/run_hook
new file mode 100755
index 0000000000..df571821df
--- /dev/null
+++ b/base-notebook/hooks/run_hook
@@ -0,0 +1,53 @@
+#!/bin/bash
+set -e
+
+# Apply tags
+GIT_SHA_TAG=${GITHUB_SHA:0:12}
+docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
+PY_VERSION_TAG="python-$(docker run --rm ${IMAGE_NAME} python --version 2>&1 | awk '{print $2}')"
+docker tag $IMAGE_NAME "$DOCKER_REPO:$PY_VERSION_TAG"
+NB_VERSION_TAG="notebook-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyter-notebook --version | tr -d '\r')"
+docker tag $IMAGE_NAME "$DOCKER_REPO:${NB_VERSION_TAG%% }"
+LAB_VERSION_TAG="lab-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyter-lab --version | tr -d '\r')"
+docker tag $IMAGE_NAME "$DOCKER_REPO:${LAB_VERSION_TAG%%\r}"
+HUB_VERSION_TAG="hub-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyterhub --version | tr -d '\r')"
+docker tag $IMAGE_NAME "$DOCKER_REPO:${HUB_VERSION_TAG%%\r}"
+
+# Update index
+INDEX_FILE="${WIKI_PATH}/Home.md"
+INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${PY_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${NB_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${LAB_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${HUB_VERSION_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${GITHUB_SHA}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
+sed "/|-|/a ${INDEX_ROW}" -i "$INDEX_FILE"
+
+# Build manifest
+MANIFEST_FILE="${WIKI_PATH}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
+mkdir -p $(dirname "$MANIFEST_FILE")
+cat << EOF > "$MANIFEST_FILE"
+* Build datetime: ${BUILD_TIMESTAMP}
+* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
+* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
+* Git commit SHA: [${GITHUB_SHA}](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
+* Git commit message:
+\`\`\`
+${COMMIT_MSG}
+\`\`\`
+
+## Python Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} python --version)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda info)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda list)
+\`\`\`
+
+## Apt Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} apt list --installed)
+\`\`\`
+EOF
diff --git a/base-notebook/test/test_container_options.py b/base-notebook/test/test_container_options.py
index a7565b4e80..f93a12ad26 100644
--- a/base-notebook/test/test_container_options.py
+++ b/base-notebook/test/test_container_options.py
@@ -76,6 +76,9 @@ def test_nb_user_change(container):
command=['start.sh', 'bash', '-c', 'sleep infinity']
)
+ # Give the chown time to complete. Use sleep, not wait, because the
+ # container sleeps forever.
+ time.sleep(10)
LOGGER.info(f"Checking if the user is changed to {nb_user} by the start script ...")
output = running_container.logs(stdout=True).decode("utf-8")
assert f"Set username to: {nb_user}" in output, f"User is not changed to {nb_user}"
@@ -123,6 +126,7 @@ def test_chown_home(container):
],
command=['start.sh', 'bash', '-c', 'chown root:root /home/jovyan && ls -alsh /home']
)
+ c.wait(timeout=120)
assert "Changing ownership of /home/jovyan to 1000:100 with options '-R'" in c.logs(stdout=True).decode('utf-8')
diff --git a/datascience-notebook/hooks/apply_tags b/datascience-notebook/hooks/apply_tags
deleted file mode 100644
index f219d585ae..0000000000
--- a/datascience-notebook/hooks/apply_tags
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-set -e
-
-# Tag the latest build with the short git sha as well as version of key runtimes
-# and packages.
-GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
-docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
-PY_VERSION_TAG="python-$(docker run --rm ${IMAGE_NAME} python --version 2>&1 | awk '{print $2}')"
-docker tag $IMAGE_NAME "$DOCKER_REPO:$PY_VERSION_TAG"
-R_VERSION_TAG="r-$(docker run --rm -a STDOUT ${IMAGE_NAME} R --version | sed -n 1p | awk '{print $3}')"
-docker tag $IMAGE_NAME "$DOCKER_REPO:${R_VERSION_TAG%%\r}"
-JULIA_VERSION_TAG="julia-$(docker run --rm -a STDOUT ${IMAGE_NAME} julia --version | awk '{print $3}')"
-docker tag $IMAGE_NAME "$DOCKER_REPO:${JULIA_VERSION_TAG%%\r}"
-NB_VERSION_TAG="notebook-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyter-notebook --version | tr -d '\r')"
-docker tag $IMAGE_NAME "$DOCKER_REPO:${NB_VERSION_TAG%% }"
-LAB_VERSION_TAG="lab-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyter-lab --version | tr -d '\r')"
-docker tag $IMAGE_NAME "$DOCKER_REPO:${LAB_VERSION_TAG%%\r}"
-HUB_VERSION_TAG="hub-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyterhub --version | tr -d '\r')"
-docker tag $IMAGE_NAME "$DOCKER_REPO:${HUB_VERSION_TAG%%\r}"
diff --git a/datascience-notebook/hooks/index.tmpl b/datascience-notebook/hooks/index.tmpl
deleted file mode 100644
index 27b8106097..0000000000
--- a/datascience-notebook/hooks/index.tmpl
+++ /dev/null
@@ -1,2 +0,0 @@
-INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${PY_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${JULIA_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${R_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${NB_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${LAB_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${HUB_VERSION_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${SOURCE_COMMIT}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
-sed "/|-|/a ${INDEX_ROW}" -i "$INDEX_FILE"
\ No newline at end of file
diff --git a/datascience-notebook/hooks/manifest.tmpl b/datascience-notebook/hooks/manifest.tmpl
deleted file mode 100644
index 1eb525fefe..0000000000
--- a/datascience-notebook/hooks/manifest.tmpl
+++ /dev/null
@@ -1,51 +0,0 @@
-cat << EOF > "$MANIFEST_FILE"
-* Build datetime: ${BUILD_TIMESTAMP}
-* DockerHub build code: ${BUILD_CODE}
-* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
-* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
-* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
-* Git commit message:
-\`\`\`
-${COMMIT_MSG}
-\`\`\`
-
-## Julia Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} julia -E 'using InteractiveUtils; versioninfo()')
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} julia -E 'import Pkg; Pkg.status()')
-\`\`\`
-
-## Python Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} python --version)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda info)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda list)
-\`\`\`
-
-## R Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} R --version)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} R --silent -e 'installed.packages(.Library)[, c(1,3)]')
-\`\`\`
-
-## Apt Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} apt list --installed)
-\`\`\`
-EOF
\ No newline at end of file
diff --git a/datascience-notebook/hooks/post_push b/datascience-notebook/hooks/post_push
deleted file mode 100755
index 220afebed6..0000000000
--- a/datascience-notebook/hooks/post_push
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-set -e
-
-# Apply and push all tags
-source hooks/apply_tags
-docker push $DOCKER_REPO
-
-# Tag the latest build with the short git sha. Push the tag in addition
-# to the "latest" tag already pushed.
-GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
-docker tag $IMAGE_NAME $DOCKER_REPO:$GIT_SHA_TAG
-docker push $DOCKER_REPO:$GIT_SHA_TAG
-
-# Create a working directory.
-BUILD_TIMESTAMP=$(date -u +%FT%TZ)
-WORKDIR=$(mktemp -d)
-GIT_URI="git@github.com:jupyter/docker-stacks.wiki.git"
-GIT_SANDBOX="${WORKDIR}/docker-stacks.wiki"
-IMAGE_SHORT_NAME=$(basename $DOCKER_REPO)
-MANIFEST_FILE="${GIT_SANDBOX}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
-INDEX_FILE="${GIT_SANDBOX}/Home.md"
-
-# Configure git so it can push back to GitHub.
-eval $(ssh-agent -s)
-ssh-add <(base64 -d <(echo "$DEPLOY_KEY"))
-ssh-add -l
-git config --global user.email "jupyter@googlegroups.com"
-git config --global user.name "Jupyter Docker Stacks"
-
-# Glone the GitHub project wiki.
-pushd "$WORKDIR"
-git clone "$GIT_URI"
-popd
-
-# Render the build manifest template.
-mkdir -p $(dirname "$MANIFEST_FILE")
-source hooks/manifest.tmpl
-source hooks/index.tmpl
-
-# Push the wiki update back to GitHub.
-pushd "$GIT_SANDBOX"
-git add .
-git commit -m "DOC: Build ${MANIFEST_FILE}"
-git push -u origin master
-popd
-
-# Shutdown the ssh agent for good measure.
-ssh-agent -k
-
-# Invoke all downstream build triggers.
-set +e
-for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g")
-do
- curl -X POST $url
-done
diff --git a/datascience-notebook/hooks/run_hook b/datascience-notebook/hooks/run_hook
new file mode 100755
index 0000000000..f60b8f3747
--- /dev/null
+++ b/datascience-notebook/hooks/run_hook
@@ -0,0 +1,78 @@
+#!/bin/bash
+set -e
+
+# Apply tags
+GIT_SHA_TAG=${GITHUB_SHA:0:12}
+docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
+PY_VERSION_TAG="python-$(docker run --rm ${IMAGE_NAME} python --version 2>&1 | awk '{print $2}')"
+docker tag $IMAGE_NAME "$DOCKER_REPO:$PY_VERSION_TAG"
+R_VERSION_TAG="r-$(docker run --rm -a STDOUT ${IMAGE_NAME} R --version | sed -n 1p | awk '{print $3}')"
+docker tag $IMAGE_NAME "$DOCKER_REPO:${R_VERSION_TAG%%\r}"
+JULIA_VERSION_TAG="julia-$(docker run --rm -a STDOUT ${IMAGE_NAME} julia --version | awk '{print $3}')"
+docker tag $IMAGE_NAME "$DOCKER_REPO:${JULIA_VERSION_TAG%%\r}"
+NB_VERSION_TAG="notebook-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyter-notebook --version | tr -d '\r')"
+docker tag $IMAGE_NAME "$DOCKER_REPO:${NB_VERSION_TAG%% }"
+LAB_VERSION_TAG="lab-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyter-lab --version | tr -d '\r')"
+docker tag $IMAGE_NAME "$DOCKER_REPO:${LAB_VERSION_TAG%%\r}"
+HUB_VERSION_TAG="hub-$(docker run --rm -a STDOUT ${IMAGE_NAME} jupyterhub --version | tr -d '\r')"
+docker tag $IMAGE_NAME "$DOCKER_REPO:${HUB_VERSION_TAG%%\r}"
+
+
+# Update index
+INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${PY_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${JULIA_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${R_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${NB_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${LAB_VERSION_TAG}\`
\`jupyter/${IMAGE_SHORT_NAME}:${HUB_VERSION_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${GITHUB_SHA}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
+sed "/|-|/a ${INDEX_ROW}" -i "${WIKI_PATH}/Home.md"
+
+# Build manifest
+MANIFEST_FILE="${WIKI_PATH}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
+mkdir -p $(dirname "$MANIFEST_FILE")
+
+cat << EOF > "$MANIFEST_FILE"
+* Build datetime: ${BUILD_TIMESTAMP}
+* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
+* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
+* Git commit SHA: [${GITHUB_SHA}](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
+* Git commit message:
+\`\`\`
+${COMMIT_MSG}
+\`\`\`
+
+## Julia Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} julia -E 'using InteractiveUtils; versioninfo()')
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} julia -E 'import Pkg; Pkg.status()')
+\`\`\`
+
+## Python Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} python --version)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda info)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda list)
+\`\`\`
+
+## R Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} R --version)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} R --silent -e 'installed.packages(.Library)[, c(1,3)]')
+\`\`\`
+
+## Apt Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} apt list --installed)
+\`\`\`
+EOF
\ No newline at end of file
diff --git a/minimal-notebook/hooks/index.tmpl b/minimal-notebook/hooks/index.tmpl
deleted file mode 100644
index fb2c60560c..0000000000
--- a/minimal-notebook/hooks/index.tmpl
+++ /dev/null
@@ -1,2 +0,0 @@
-INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${SOURCE_COMMIT}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
-sed "/|-|/a ${INDEX_ROW}" -i "$INDEX_FILE"
\ No newline at end of file
diff --git a/minimal-notebook/hooks/manifest.tmpl b/minimal-notebook/hooks/manifest.tmpl
deleted file mode 100644
index 378a94cb1b..0000000000
--- a/minimal-notebook/hooks/manifest.tmpl
+++ /dev/null
@@ -1,31 +0,0 @@
-cat << EOF > "$MANIFEST_FILE"
-* Build datetime: ${BUILD_TIMESTAMP}
-* DockerHub build code: ${BUILD_CODE}
-* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
-* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
-* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
-* Git commit message:
-\`\`\`
-${COMMIT_MSG}
-\`\`\`
-
-## Python Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} python --version)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda info)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda list)
-\`\`\`
-
-## Apt Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} apt list --installed)
-\`\`\`
-EOF
\ No newline at end of file
diff --git a/minimal-notebook/hooks/post_push b/minimal-notebook/hooks/post_push
deleted file mode 100755
index 1f9f191457..0000000000
--- a/minimal-notebook/hooks/post_push
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-set -e
-
-# Tag the latest build with the short git sha. Push the tag in addition
-# to the "latest" tag already pushed.
-GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
-docker tag $IMAGE_NAME $DOCKER_REPO:$GIT_SHA_TAG
-docker push $DOCKER_REPO:$GIT_SHA_TAG
-
-# Create a working directory.
-BUILD_TIMESTAMP=$(date -u +%FT%TZ)
-WORKDIR=$(mktemp -d)
-GIT_URI="git@github.com:jupyter/docker-stacks.wiki.git"
-GIT_SANDBOX="${WORKDIR}/docker-stacks.wiki"
-IMAGE_SHORT_NAME=$(basename $DOCKER_REPO)
-MANIFEST_FILE="${GIT_SANDBOX}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
-INDEX_FILE="${GIT_SANDBOX}/Home.md"
-
-# Configure git so it can push back to GitHub.
-eval $(ssh-agent -s)
-ssh-add <(base64 -d <(echo "$DEPLOY_KEY"))
-ssh-add -l
-git config --global user.email "jupyter@googlegroups.com"
-git config --global user.name "Jupyter Docker Stacks"
-
-# Glone the GitHub project wiki.
-pushd "$WORKDIR"
-git clone "$GIT_URI"
-popd
-
-# Render the build manifest template.
-mkdir -p $(dirname "$MANIFEST_FILE")
-source hooks/manifest.tmpl
-source hooks/index.tmpl
-
-# Push the wiki update back to GitHub.
-pushd "$GIT_SANDBOX"
-git add .
-git commit -m "DOC: Build ${MANIFEST_FILE}"
-git push -u origin master
-popd
-
-# Shutdown the ssh agent for good measure.
-ssh-agent -k
-
-# Invoke all downstream build triggers.
-set +e
-for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g")
-do
- curl -X POST $url
-done
\ No newline at end of file
diff --git a/minimal-notebook/hooks/run_hook b/minimal-notebook/hooks/run_hook
new file mode 100755
index 0000000000..783ffa926e
--- /dev/null
+++ b/minimal-notebook/hooks/run_hook
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -e
+
+# Apply tags
+GIT_SHA_TAG=${GITHUB_SHA:0:12}
+docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
+
+# Update index
+INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${GITHUB_SHA}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
+sed "/|-|/a ${INDEX_ROW}" -i "${WIKI_PATH}/Home.md"
+
+# Build manifest
+MANIFEST_FILE="${WIKI_PATH}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
+mkdir -p $(dirname "$MANIFEST_FILE")
+
+cat << EOF > "$MANIFEST_FILE"
+* Build datetime: ${BUILD_TIMESTAMP}
+* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
+* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
+* Git commit SHA: [${GITHUB_SHA}](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
+* Git commit message:
+\`\`\`
+${COMMIT_MSG}
+\`\`\`
+
+## Python Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} python --version)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda info)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda list)
+\`\`\`
+
+## Apt Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} apt list --installed)
+\`\`\`
+EOF
\ No newline at end of file
diff --git a/pyspark-notebook/hooks/index.tmpl b/pyspark-notebook/hooks/index.tmpl
deleted file mode 100644
index fb2c60560c..0000000000
--- a/pyspark-notebook/hooks/index.tmpl
+++ /dev/null
@@ -1,2 +0,0 @@
-INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${SOURCE_COMMIT}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
-sed "/|-|/a ${INDEX_ROW}" -i "$INDEX_FILE"
\ No newline at end of file
diff --git a/pyspark-notebook/hooks/manifest.tmpl b/pyspark-notebook/hooks/manifest.tmpl
deleted file mode 100644
index e1058b9545..0000000000
--- a/pyspark-notebook/hooks/manifest.tmpl
+++ /dev/null
@@ -1,37 +0,0 @@
-cat << EOF > "$MANIFEST_FILE"
-* Build datetime: ${BUILD_TIMESTAMP}
-* DockerHub build code: ${BUILD_CODE}
-* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
-* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
-* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
-* Git commit message:
-\`\`\`
-${COMMIT_MSG}
-\`\`\`
-
-## Apache Spark
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} bash -c '$SPARK_HOME/bin/spark-submit --version' 2>&1)
-\`\`\`
-
-## Python Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} python --version)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda info)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda list)
-\`\`\`
-
-## Apt Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} apt list --installed)
-\`\`\`
-EOF
\ No newline at end of file
diff --git a/pyspark-notebook/hooks/post_push b/pyspark-notebook/hooks/post_push
deleted file mode 100755
index 1f9f191457..0000000000
--- a/pyspark-notebook/hooks/post_push
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-set -e
-
-# Tag the latest build with the short git sha. Push the tag in addition
-# to the "latest" tag already pushed.
-GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
-docker tag $IMAGE_NAME $DOCKER_REPO:$GIT_SHA_TAG
-docker push $DOCKER_REPO:$GIT_SHA_TAG
-
-# Create a working directory.
-BUILD_TIMESTAMP=$(date -u +%FT%TZ)
-WORKDIR=$(mktemp -d)
-GIT_URI="git@github.com:jupyter/docker-stacks.wiki.git"
-GIT_SANDBOX="${WORKDIR}/docker-stacks.wiki"
-IMAGE_SHORT_NAME=$(basename $DOCKER_REPO)
-MANIFEST_FILE="${GIT_SANDBOX}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
-INDEX_FILE="${GIT_SANDBOX}/Home.md"
-
-# Configure git so it can push back to GitHub.
-eval $(ssh-agent -s)
-ssh-add <(base64 -d <(echo "$DEPLOY_KEY"))
-ssh-add -l
-git config --global user.email "jupyter@googlegroups.com"
-git config --global user.name "Jupyter Docker Stacks"
-
-# Glone the GitHub project wiki.
-pushd "$WORKDIR"
-git clone "$GIT_URI"
-popd
-
-# Render the build manifest template.
-mkdir -p $(dirname "$MANIFEST_FILE")
-source hooks/manifest.tmpl
-source hooks/index.tmpl
-
-# Push the wiki update back to GitHub.
-pushd "$GIT_SANDBOX"
-git add .
-git commit -m "DOC: Build ${MANIFEST_FILE}"
-git push -u origin master
-popd
-
-# Shutdown the ssh agent for good measure.
-ssh-agent -k
-
-# Invoke all downstream build triggers.
-set +e
-for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g")
-do
- curl -X POST $url
-done
\ No newline at end of file
diff --git a/pyspark-notebook/hooks/run_hook b/pyspark-notebook/hooks/run_hook
new file mode 100755
index 0000000000..d4c6552108
--- /dev/null
+++ b/pyspark-notebook/hooks/run_hook
@@ -0,0 +1,51 @@
+#!/bin/bash
+set -e
+
+# Apply tags
+GIT_SHA_TAG=${GITHUB_SHA:0:12}
+docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
+
+# Update index
+INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${GITHUB_SHA}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
+sed "/|-|/a ${INDEX_ROW}" -i "${WIKI_PATH}/Home.md"
+
+# Build manifest
+MANIFEST_FILE="${WIKI_PATH}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
+mkdir -p $(dirname "$MANIFEST_FILE")
+
+cat << EOF > "$MANIFEST_FILE"
+* Build datetime: ${BUILD_TIMESTAMP}
+* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
+* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
+* Git commit SHA: [${GITHUB_SHA}](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
+* Git commit message:
+\`\`\`
+${COMMIT_MSG}
+\`\`\`
+
+## Apache Spark
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} bash -c '$SPARK_HOME/bin/spark-submit --version' 2>&1)
+\`\`\`
+
+## Python Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} python --version)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda info)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda list)
+\`\`\`
+
+## Apt Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} apt list --installed)
+\`\`\`
+EOF
\ No newline at end of file
diff --git a/r-notebook/hooks/index.tmpl b/r-notebook/hooks/index.tmpl
deleted file mode 100644
index fb2c60560c..0000000000
--- a/r-notebook/hooks/index.tmpl
+++ /dev/null
@@ -1,2 +0,0 @@
-INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${SOURCE_COMMIT}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
-sed "/|-|/a ${INDEX_ROW}" -i "$INDEX_FILE"
\ No newline at end of file
diff --git a/r-notebook/hooks/manifest.tmpl b/r-notebook/hooks/manifest.tmpl
deleted file mode 100644
index 63f72a8f9d..0000000000
--- a/r-notebook/hooks/manifest.tmpl
+++ /dev/null
@@ -1,41 +0,0 @@
-cat << EOF > "$MANIFEST_FILE"
-* Build datetime: ${BUILD_TIMESTAMP}
-* DockerHub build code: ${BUILD_CODE}
-* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
-* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
-* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
-* Git commit message:
-\`\`\`
-${COMMIT_MSG}
-\`\`\`
-
-## R Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} R --version)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} R --silent -e 'installed.packages(.Library)[, c(1,3)]')
-\`\`\`
-
-## Python Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} python --version)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda info)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda list)
-\`\`\`
-
-## Apt Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} apt list --installed)
-\`\`\`
-EOF
\ No newline at end of file
diff --git a/r-notebook/hooks/post_push b/r-notebook/hooks/post_push
deleted file mode 100755
index 1f9f191457..0000000000
--- a/r-notebook/hooks/post_push
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-set -e
-
-# Tag the latest build with the short git sha. Push the tag in addition
-# to the "latest" tag already pushed.
-GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
-docker tag $IMAGE_NAME $DOCKER_REPO:$GIT_SHA_TAG
-docker push $DOCKER_REPO:$GIT_SHA_TAG
-
-# Create a working directory.
-BUILD_TIMESTAMP=$(date -u +%FT%TZ)
-WORKDIR=$(mktemp -d)
-GIT_URI="git@github.com:jupyter/docker-stacks.wiki.git"
-GIT_SANDBOX="${WORKDIR}/docker-stacks.wiki"
-IMAGE_SHORT_NAME=$(basename $DOCKER_REPO)
-MANIFEST_FILE="${GIT_SANDBOX}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
-INDEX_FILE="${GIT_SANDBOX}/Home.md"
-
-# Configure git so it can push back to GitHub.
-eval $(ssh-agent -s)
-ssh-add <(base64 -d <(echo "$DEPLOY_KEY"))
-ssh-add -l
-git config --global user.email "jupyter@googlegroups.com"
-git config --global user.name "Jupyter Docker Stacks"
-
-# Glone the GitHub project wiki.
-pushd "$WORKDIR"
-git clone "$GIT_URI"
-popd
-
-# Render the build manifest template.
-mkdir -p $(dirname "$MANIFEST_FILE")
-source hooks/manifest.tmpl
-source hooks/index.tmpl
-
-# Push the wiki update back to GitHub.
-pushd "$GIT_SANDBOX"
-git add .
-git commit -m "DOC: Build ${MANIFEST_FILE}"
-git push -u origin master
-popd
-
-# Shutdown the ssh agent for good measure.
-ssh-agent -k
-
-# Invoke all downstream build triggers.
-set +e
-for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g")
-do
- curl -X POST $url
-done
\ No newline at end of file
diff --git a/r-notebook/hooks/run_hook b/r-notebook/hooks/run_hook
new file mode 100755
index 0000000000..f01e57dfc5
--- /dev/null
+++ b/r-notebook/hooks/run_hook
@@ -0,0 +1,55 @@
+#!/bin/bash
+set -e
+
+# Apply tags
+GIT_SHA_TAG=${GITHUB_SHA:0:12}
+docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
+
+# Update index
+INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${GITHUB_SHA}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
+sed "/|-|/a ${INDEX_ROW}" -i "${WIKI_PATH}/Home.md"
+
+# Build manifest
+MANIFEST_FILE="${WIKI_PATH}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
+mkdir -p $(dirname "$MANIFEST_FILE")
+
+cat << EOF > "$MANIFEST_FILE"
+* Build datetime: ${BUILD_TIMESTAMP}
+* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
+* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
+* Git commit SHA: [${GITHUB_SHA}](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
+* Git commit message:
+\`\`\`
+${COMMIT_MSG}
+\`\`\`
+
+## R Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} R --version)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} R --silent -e 'installed.packages(.Library)[, c(1,3)]')
+\`\`\`
+
+## Python Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} python --version)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda info)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda list)
+\`\`\`
+
+## Apt Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} apt list --installed)
+\`\`\`
+EOF
\ No newline at end of file
diff --git a/scipy-notebook/hooks/index.tmpl b/scipy-notebook/hooks/index.tmpl
deleted file mode 100644
index fb2c60560c..0000000000
--- a/scipy-notebook/hooks/index.tmpl
+++ /dev/null
@@ -1,2 +0,0 @@
-INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${SOURCE_COMMIT}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
-sed "/|-|/a ${INDEX_ROW}" -i "$INDEX_FILE"
\ No newline at end of file
diff --git a/scipy-notebook/hooks/manifest.tmpl b/scipy-notebook/hooks/manifest.tmpl
deleted file mode 100644
index 378a94cb1b..0000000000
--- a/scipy-notebook/hooks/manifest.tmpl
+++ /dev/null
@@ -1,31 +0,0 @@
-cat << EOF > "$MANIFEST_FILE"
-* Build datetime: ${BUILD_TIMESTAMP}
-* DockerHub build code: ${BUILD_CODE}
-* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
-* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
-* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
-* Git commit message:
-\`\`\`
-${COMMIT_MSG}
-\`\`\`
-
-## Python Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} python --version)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda info)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda list)
-\`\`\`
-
-## Apt Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} apt list --installed)
-\`\`\`
-EOF
\ No newline at end of file
diff --git a/scipy-notebook/hooks/post_push b/scipy-notebook/hooks/post_push
deleted file mode 100755
index 1f9f191457..0000000000
--- a/scipy-notebook/hooks/post_push
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-set -e
-
-# Tag the latest build with the short git sha. Push the tag in addition
-# to the "latest" tag already pushed.
-GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
-docker tag $IMAGE_NAME $DOCKER_REPO:$GIT_SHA_TAG
-docker push $DOCKER_REPO:$GIT_SHA_TAG
-
-# Create a working directory.
-BUILD_TIMESTAMP=$(date -u +%FT%TZ)
-WORKDIR=$(mktemp -d)
-GIT_URI="git@github.com:jupyter/docker-stacks.wiki.git"
-GIT_SANDBOX="${WORKDIR}/docker-stacks.wiki"
-IMAGE_SHORT_NAME=$(basename $DOCKER_REPO)
-MANIFEST_FILE="${GIT_SANDBOX}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
-INDEX_FILE="${GIT_SANDBOX}/Home.md"
-
-# Configure git so it can push back to GitHub.
-eval $(ssh-agent -s)
-ssh-add <(base64 -d <(echo "$DEPLOY_KEY"))
-ssh-add -l
-git config --global user.email "jupyter@googlegroups.com"
-git config --global user.name "Jupyter Docker Stacks"
-
-# Glone the GitHub project wiki.
-pushd "$WORKDIR"
-git clone "$GIT_URI"
-popd
-
-# Render the build manifest template.
-mkdir -p $(dirname "$MANIFEST_FILE")
-source hooks/manifest.tmpl
-source hooks/index.tmpl
-
-# Push the wiki update back to GitHub.
-pushd "$GIT_SANDBOX"
-git add .
-git commit -m "DOC: Build ${MANIFEST_FILE}"
-git push -u origin master
-popd
-
-# Shutdown the ssh agent for good measure.
-ssh-agent -k
-
-# Invoke all downstream build triggers.
-set +e
-for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g")
-do
- curl -X POST $url
-done
\ No newline at end of file
diff --git a/scipy-notebook/hooks/run_hook b/scipy-notebook/hooks/run_hook
new file mode 100755
index 0000000000..783ffa926e
--- /dev/null
+++ b/scipy-notebook/hooks/run_hook
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -e
+
+# Apply tags
+GIT_SHA_TAG=${GITHUB_SHA:0:12}
+docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
+
+# Update index
+INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${GITHUB_SHA}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
+sed "/|-|/a ${INDEX_ROW}" -i "${WIKI_PATH}/Home.md"
+
+# Build manifest
+MANIFEST_FILE="${WIKI_PATH}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
+mkdir -p $(dirname "$MANIFEST_FILE")
+
+cat << EOF > "$MANIFEST_FILE"
+* Build datetime: ${BUILD_TIMESTAMP}
+* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
+* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
+* Git commit SHA: [${GITHUB_SHA}](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
+* Git commit message:
+\`\`\`
+${COMMIT_MSG}
+\`\`\`
+
+## Python Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} python --version)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda info)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda list)
+\`\`\`
+
+## Apt Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} apt list --installed)
+\`\`\`
+EOF
\ No newline at end of file
diff --git a/tensorflow-notebook/hooks/index.tmpl b/tensorflow-notebook/hooks/index.tmpl
deleted file mode 100644
index fb2c60560c..0000000000
--- a/tensorflow-notebook/hooks/index.tmpl
+++ /dev/null
@@ -1,2 +0,0 @@
-INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${SOURCE_COMMIT}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
-sed "/|-|/a ${INDEX_ROW}" -i "$INDEX_FILE"
\ No newline at end of file
diff --git a/tensorflow-notebook/hooks/manifest.tmpl b/tensorflow-notebook/hooks/manifest.tmpl
deleted file mode 100644
index 378a94cb1b..0000000000
--- a/tensorflow-notebook/hooks/manifest.tmpl
+++ /dev/null
@@ -1,31 +0,0 @@
-cat << EOF > "$MANIFEST_FILE"
-* Build datetime: ${BUILD_TIMESTAMP}
-* DockerHub build code: ${BUILD_CODE}
-* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
-* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
-* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
-* Git commit message:
-\`\`\`
-${COMMIT_MSG}
-\`\`\`
-
-## Python Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} python --version)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda info)
-\`\`\`
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} conda list)
-\`\`\`
-
-## Apt Packages
-
-\`\`\`
-$(docker run --rm ${IMAGE_NAME} apt list --installed)
-\`\`\`
-EOF
\ No newline at end of file
diff --git a/tensorflow-notebook/hooks/post_push b/tensorflow-notebook/hooks/post_push
deleted file mode 100755
index 1f9f191457..0000000000
--- a/tensorflow-notebook/hooks/post_push
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-set -e
-
-# Tag the latest build with the short git sha. Push the tag in addition
-# to the "latest" tag already pushed.
-GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
-docker tag $IMAGE_NAME $DOCKER_REPO:$GIT_SHA_TAG
-docker push $DOCKER_REPO:$GIT_SHA_TAG
-
-# Create a working directory.
-BUILD_TIMESTAMP=$(date -u +%FT%TZ)
-WORKDIR=$(mktemp -d)
-GIT_URI="git@github.com:jupyter/docker-stacks.wiki.git"
-GIT_SANDBOX="${WORKDIR}/docker-stacks.wiki"
-IMAGE_SHORT_NAME=$(basename $DOCKER_REPO)
-MANIFEST_FILE="${GIT_SANDBOX}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
-INDEX_FILE="${GIT_SANDBOX}/Home.md"
-
-# Configure git so it can push back to GitHub.
-eval $(ssh-agent -s)
-ssh-add <(base64 -d <(echo "$DEPLOY_KEY"))
-ssh-add -l
-git config --global user.email "jupyter@googlegroups.com"
-git config --global user.name "Jupyter Docker Stacks"
-
-# Glone the GitHub project wiki.
-pushd "$WORKDIR"
-git clone "$GIT_URI"
-popd
-
-# Render the build manifest template.
-mkdir -p $(dirname "$MANIFEST_FILE")
-source hooks/manifest.tmpl
-source hooks/index.tmpl
-
-# Push the wiki update back to GitHub.
-pushd "$GIT_SANDBOX"
-git add .
-git commit -m "DOC: Build ${MANIFEST_FILE}"
-git push -u origin master
-popd
-
-# Shutdown the ssh agent for good measure.
-ssh-agent -k
-
-# Invoke all downstream build triggers.
-set +e
-for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g")
-do
- curl -X POST $url
-done
\ No newline at end of file
diff --git a/tensorflow-notebook/hooks/run_hook b/tensorflow-notebook/hooks/run_hook
new file mode 100755
index 0000000000..783ffa926e
--- /dev/null
+++ b/tensorflow-notebook/hooks/run_hook
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -e
+
+# Apply tags
+GIT_SHA_TAG=${GITHUB_SHA:0:12}
+docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG"
+
+# Update index
+INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${GITHUB_SHA}/${IMAGE_SHORT_NAME}/Dockerfile)
[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
+sed "/|-|/a ${INDEX_ROW}" -i "${WIKI_PATH}/Home.md"
+
+# Build manifest
+MANIFEST_FILE="${WIKI_PATH}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
+mkdir -p $(dirname "$MANIFEST_FILE")
+
+cat << EOF > "$MANIFEST_FILE"
+* Build datetime: ${BUILD_TIMESTAMP}
+* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
+* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}")
+* Git commit SHA: [${GITHUB_SHA}](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})
+* Git commit message:
+\`\`\`
+${COMMIT_MSG}
+\`\`\`
+
+## Python Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} python --version)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda info)
+\`\`\`
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} conda list)
+\`\`\`
+
+## Apt Packages
+
+\`\`\`
+$(docker run --rm ${IMAGE_NAME} apt list --installed)
+\`\`\`
+EOF
\ No newline at end of file