mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-09 11:02:57 +00:00
[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.
This commit is contained in:
28
pyspark-notebook/hooks/manifest.tmpl
Normal file
28
pyspark-notebook/hooks/manifest.tmpl
Normal file
@@ -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
|
@@ -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
|
||||
|
Reference in New Issue
Block a user