mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 14:33:00 +00:00
add docker cloud hooks for onbuild
This commit is contained in:
3
hooks/README.md
Normal file
3
hooks/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Docker Cloud build hooks
|
||||
|
||||
These are the hooks
|
14
hooks/build
Normal file
14
hooks/build
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
docker build -t $DOCKER_REPO:$DOCKER_TAG .
|
||||
# build onbuild
|
||||
docker build --build-arg BASE_IMAGE=$DOCKER_REPO:$DOCKER_TAG -t ${DOCKER_REPO}-onbuild:$DOCKER_TAG .
|
||||
|
||||
for V in master $stable; do
|
||||
|
||||
docker build --build-arg JUPYTERHUB_VERSION=$V -t $DOCKER_REPO:$V .
|
||||
done
|
||||
|
||||
echo "tagging $IMAGE_NAME"
|
||||
docker tag $DOCKER_REPO:$stable $IMAGE_NAME
|
25
hooks/post_push
Normal file
25
hooks/post_push
Normal file
@@ -0,0 +1,25 @@
|
||||
stable=0.8
|
||||
export ONBUILD=${DOCKER_REPO}_onbuild
|
||||
# push ONBUILD image
|
||||
docker push $ONBUILD:$DOCKER_TAG
|
||||
|
||||
function get_hub_version() {
|
||||
rm -f hub_version
|
||||
docker run --rm -v $PWD:/version -u $(id -u) -i $DOCKER_REPO:$DOCKER_TAG sh -c 'jupyterhub --version > /version/hub_version'
|
||||
hub_xyz=$(cat hub_version)
|
||||
split=( ${hub_xyz//./ } )
|
||||
hub_xy="${split[0]}.${split[1]}"
|
||||
}
|
||||
|
||||
|
||||
get_hub_version
|
||||
# when building 0.9.0.dev, push 0.9.0 and 0.9 tags as well
|
||||
docker tag $DOCKER_REPO:$hub_xyz $DOCKER_REPO:$DOCKER_TAG
|
||||
docker push $DOCKER_REPO:$hub_xyz
|
||||
docker tag $ONBUILD:$hub_xyz $ONBUILD:$DOCKER_TAG
|
||||
docker push $ONBUILD:$hub_xyz
|
||||
|
||||
docker tag $DOCKER_REPO:$hub_xy $DOCKER_REPO:$DOCKER_TAG
|
||||
docker push $DOCKER_REPO:$hub_xy
|
||||
docker tag $ONBUILD:$hub_xy $DOCKER_REPO:$DOCKER_TAG
|
||||
docker push $ONBUILD:$hub_xyz
|
Reference in New Issue
Block a user