Accommodate 17.x branch names (#5174) (#5175)

This commit is contained in:
Misty Stanley-Jones 2017-10-30 16:28:58 -07:00 committed by GitHub
parent f802229908
commit b17d29bccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

14
hooks/post_push Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -e
# If this is an archive branch (like v1.4 or v1.11),
# build and push the docs-base branch at the end of
# a successful build of the branch
if [[ $SOURCE_BRANCH =~ (^v1\.[0-9]+$|^v1[7-9]\.[0-9]+$) ]]; then
git fetch origin docs-base:docs-base --depth 1 || ( echo "Couldn't fetch docs-base." && exit 1 )
git checkout docs-base || ( echo "Couldn't check out docs-base." && exit 1 )
docker build -t docs/docker.github.io:docs-base . || ( echo "Couldn't build docs-base Dockerfile." && exit 1 )
docker push docs/docker.github.io:docs-base || ( echo "Coudn't push new docs-base image." && exit 1 )
fi