From 10c58da40596dbaecf1fcf2397046413acd84427 Mon Sep 17 00:00:00 2001 From: Peter Parente Date: Fri, 15 Mar 2019 15:29:55 -0400 Subject: [PATCH] [ci skip] Add package manifest support Generates manifest pages and pushes them to the docker-stacks GitHub wiki. Does not update a global index of all builds yet. --- all-spark-notebook/hooks/manifest.tmpl | 28 +++++++++++++++++++ all-spark-notebook/hooks/post_push | 35 ++++++++++++++++++++++++ base-notebook/hooks/manifest.tmpl | 22 +++++++++++++++ base-notebook/hooks/post_push | 35 ++++++++++++++++++++++++ datascience-notebook/hooks/manifest.tmpl | 34 +++++++++++++++++++++++ datascience-notebook/hooks/post_push | 35 ++++++++++++++++++++++++ minimal-notebook/hooks/manifest.tmpl | 22 +++++++++++++++ minimal-notebook/hooks/post_push | 35 ++++++++++++++++++++++++ pyspark-notebook/hooks/manifest.tmpl | 28 +++++++++++++++++++ pyspark-notebook/hooks/post_push | 35 ++++++++++++++++++++++++ r-notebook/hooks/manifest.tmpl | 28 +++++++++++++++++++ r-notebook/hooks/post_push | 35 ++++++++++++++++++++++++ scipy-notebook/hooks/manifest.tmpl | 22 +++++++++++++++ scipy-notebook/hooks/post_push | 35 ++++++++++++++++++++++++ tensorflow-notebook/hooks/manifest.tmpl | 22 +++++++++++++++ tensorflow-notebook/hooks/post_push | 35 ++++++++++++++++++++++++ 16 files changed, 486 insertions(+) create mode 100644 all-spark-notebook/hooks/manifest.tmpl create mode 100644 base-notebook/hooks/manifest.tmpl create mode 100644 datascience-notebook/hooks/manifest.tmpl create mode 100644 minimal-notebook/hooks/manifest.tmpl create mode 100644 pyspark-notebook/hooks/manifest.tmpl create mode 100644 r-notebook/hooks/manifest.tmpl create mode 100644 scipy-notebook/hooks/manifest.tmpl create mode 100644 tensorflow-notebook/hooks/manifest.tmpl diff --git a/all-spark-notebook/hooks/manifest.tmpl b/all-spark-notebook/hooks/manifest.tmpl new file mode 100644 index 0000000000..42d822e4c6 --- /dev/null +++ b/all-spark-notebook/hooks/manifest.tmpl @@ -0,0 +1,28 @@ +cat << EOF > "$MANIFEST_FILE" +* Build datetime: $(date -u +%FT%TZ) +* DockerHub build code: ${BUILD_CODE} +* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG} +* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT}) +* Git commit message: +\`\`\` +${COMMIT_MSG} +\`\`\` + +## Apache Packages + +\`\`\` +$(docker run --rm ${IMAGE_NAME} spark-submit --version) +\`\`\` + +## Python Packages + +\`\`\` +$(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/all-spark-notebook/hooks/post_push b/all-spark-notebook/hooks/post_push index 0b8d0930b5..5bcea91748 100755 --- a/all-spark-notebook/hooks/post_push +++ b/all-spark-notebook/hooks/post_push @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Tag the latest build with the short git sha. Push the tag in addition # to the "latest" tag already pushed. @@ -6,7 +7,41 @@ 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. +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}-${SOURCE_COMMIT:0:12}.md" + +# Configure git so it can push back to GitHub. +eval $(ssh-agent -s) +ssh-add <(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 + +# 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 diff --git a/base-notebook/hooks/manifest.tmpl b/base-notebook/hooks/manifest.tmpl new file mode 100644 index 0000000000..6fdbc421a8 --- /dev/null +++ b/base-notebook/hooks/manifest.tmpl @@ -0,0 +1,22 @@ +cat << EOF > "$MANIFEST_FILE" +* Build datetime: $(date -u +%FT%TZ) +* DockerHub build code: ${BUILD_CODE} +* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG} +* 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} 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_push b/base-notebook/hooks/post_push index 0b8d0930b5..5bcea91748 100755 --- a/base-notebook/hooks/post_push +++ b/base-notebook/hooks/post_push @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Tag the latest build with the short git sha. Push the tag in addition # to the "latest" tag already pushed. @@ -6,7 +7,41 @@ 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. +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}-${SOURCE_COMMIT:0:12}.md" + +# Configure git so it can push back to GitHub. +eval $(ssh-agent -s) +ssh-add <(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 + +# 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 diff --git a/datascience-notebook/hooks/manifest.tmpl b/datascience-notebook/hooks/manifest.tmpl new file mode 100644 index 0000000000..36bf75c397 --- /dev/null +++ b/datascience-notebook/hooks/manifest.tmpl @@ -0,0 +1,34 @@ +cat << EOF > "$MANIFEST_FILE" +* Build datetime: $(date -u +%FT%TZ) +* DockerHub build code: ${BUILD_CODE} +* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG} +* 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 'import Pkg; Pkg.status()') +\`\`\` + +## Python Packages + +\`\`\` +$(docker run --rm ${IMAGE_NAME} conda list) +\`\`\` + +## R Packages + +\`\`\` +$(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 index 0b8d0930b5..5bcea91748 100755 --- a/datascience-notebook/hooks/post_push +++ b/datascience-notebook/hooks/post_push @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Tag the latest build with the short git sha. Push the tag in addition # to the "latest" tag already pushed. @@ -6,7 +7,41 @@ 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. +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}-${SOURCE_COMMIT:0:12}.md" + +# Configure git so it can push back to GitHub. +eval $(ssh-agent -s) +ssh-add <(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 + +# 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 diff --git a/minimal-notebook/hooks/manifest.tmpl b/minimal-notebook/hooks/manifest.tmpl new file mode 100644 index 0000000000..6fdbc421a8 --- /dev/null +++ b/minimal-notebook/hooks/manifest.tmpl @@ -0,0 +1,22 @@ +cat << EOF > "$MANIFEST_FILE" +* Build datetime: $(date -u +%FT%TZ) +* DockerHub build code: ${BUILD_CODE} +* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG} +* 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} 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 index 0b8d0930b5..5bcea91748 100755 --- a/minimal-notebook/hooks/post_push +++ b/minimal-notebook/hooks/post_push @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Tag the latest build with the short git sha. Push the tag in addition # to the "latest" tag already pushed. @@ -6,7 +7,41 @@ 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. +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}-${SOURCE_COMMIT:0:12}.md" + +# Configure git so it can push back to GitHub. +eval $(ssh-agent -s) +ssh-add <(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 + +# 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 diff --git a/pyspark-notebook/hooks/manifest.tmpl b/pyspark-notebook/hooks/manifest.tmpl new file mode 100644 index 0000000000..42d822e4c6 --- /dev/null +++ b/pyspark-notebook/hooks/manifest.tmpl @@ -0,0 +1,28 @@ +cat << EOF > "$MANIFEST_FILE" +* Build datetime: $(date -u +%FT%TZ) +* DockerHub build code: ${BUILD_CODE} +* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG} +* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT}) +* Git commit message: +\`\`\` +${COMMIT_MSG} +\`\`\` + +## Apache Packages + +\`\`\` +$(docker run --rm ${IMAGE_NAME} spark-submit --version) +\`\`\` + +## Python Packages + +\`\`\` +$(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 index 0b8d0930b5..5bcea91748 100755 --- a/pyspark-notebook/hooks/post_push +++ b/pyspark-notebook/hooks/post_push @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Tag the latest build with the short git sha. Push the tag in addition # to the "latest" tag already pushed. @@ -6,7 +7,41 @@ 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. +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}-${SOURCE_COMMIT:0:12}.md" + +# Configure git so it can push back to GitHub. +eval $(ssh-agent -s) +ssh-add <(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 + +# 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 diff --git a/r-notebook/hooks/manifest.tmpl b/r-notebook/hooks/manifest.tmpl new file mode 100644 index 0000000000..ad78696373 --- /dev/null +++ b/r-notebook/hooks/manifest.tmpl @@ -0,0 +1,28 @@ +cat << EOF > "$MANIFEST_FILE" +* Build datetime: $(date -u +%FT%TZ) +* DockerHub build code: ${BUILD_CODE} +* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG} +* 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 --silent -e 'installed.packages(.Library)[, c(1,3)]') +\`\`\` + +## Python Packages + +\`\`\` +$(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 index 0b8d0930b5..5bcea91748 100755 --- a/r-notebook/hooks/post_push +++ b/r-notebook/hooks/post_push @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Tag the latest build with the short git sha. Push the tag in addition # to the "latest" tag already pushed. @@ -6,7 +7,41 @@ 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. +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}-${SOURCE_COMMIT:0:12}.md" + +# Configure git so it can push back to GitHub. +eval $(ssh-agent -s) +ssh-add <(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 + +# 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 diff --git a/scipy-notebook/hooks/manifest.tmpl b/scipy-notebook/hooks/manifest.tmpl new file mode 100644 index 0000000000..6fdbc421a8 --- /dev/null +++ b/scipy-notebook/hooks/manifest.tmpl @@ -0,0 +1,22 @@ +cat << EOF > "$MANIFEST_FILE" +* Build datetime: $(date -u +%FT%TZ) +* DockerHub build code: ${BUILD_CODE} +* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG} +* 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} 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 index 0b8d0930b5..5bcea91748 100755 --- a/scipy-notebook/hooks/post_push +++ b/scipy-notebook/hooks/post_push @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Tag the latest build with the short git sha. Push the tag in addition # to the "latest" tag already pushed. @@ -6,7 +7,41 @@ 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. +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}-${SOURCE_COMMIT:0:12}.md" + +# Configure git so it can push back to GitHub. +eval $(ssh-agent -s) +ssh-add <(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 + +# 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 diff --git a/tensorflow-notebook/hooks/manifest.tmpl b/tensorflow-notebook/hooks/manifest.tmpl new file mode 100644 index 0000000000..6fdbc421a8 --- /dev/null +++ b/tensorflow-notebook/hooks/manifest.tmpl @@ -0,0 +1,22 @@ +cat << EOF > "$MANIFEST_FILE" +* Build datetime: $(date -u +%FT%TZ) +* DockerHub build code: ${BUILD_CODE} +* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG} +* 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} 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 index 0b8d0930b5..5bcea91748 100755 --- a/tensorflow-notebook/hooks/post_push +++ b/tensorflow-notebook/hooks/post_push @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Tag the latest build with the short git sha. Push the tag in addition # to the "latest" tag already pushed. @@ -6,7 +7,41 @@ 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. +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}-${SOURCE_COMMIT:0:12}.md" + +# Configure git so it can push back to GitHub. +eval $(ssh-agent -s) +ssh-add <(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 + +# 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