mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
Trigger build of docs-base after successful build of archive branch
This commit is contained in:
committed by
Misty Stanley-Jones
parent
7a500c0fe3
commit
5249ec11a5
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
.git
|
||||
_site
|
||||
@@ -1,11 +1,3 @@
|
||||
FROM starefossen/github-pages:onbuild
|
||||
|
||||
ONBUILD RUN git clone https://www.github.com/docker/docker.github.io docs
|
||||
|
||||
ONBUILD WORKDIR docs
|
||||
|
||||
ONBUILD RUN git checkout v1.5
|
||||
|
||||
ONBUILD COPY . /usr/src/app
|
||||
|
||||
CMD jekyll serve -d /_site --watch -H 0.0.0.0 -P 4000
|
||||
|
||||
14
hooks/post_push
Executable file
14
hooks/post_push
Executable 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]+$ ]]; 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
|
||||
Reference in New Issue
Block a user