Merge pull request #4199 from proppy/git-sync

contrib/git-sync: fix demo and doc
This commit is contained in:
Jeff Lowdermilk 2015-02-06 12:20:16 -08:00
commit b5cf392a00
5 changed files with 44 additions and 19 deletions

View File

@ -10,7 +10,7 @@ It can be used to source a container volume with the content of a git repo.
# build the container # build the container
docker build -t git-sync . docker build -t git-sync .
# run the git-sync container # run the git-sync container
docker run -d GIT_SYNC_REPO=https://github.com/GoogleCloudPlatform/kubernetes -e GIT_SYNC_BRANCH=gh-pages -r HEAD -v /git-data:/git git-sync docker run -d GIT_SYNC_REPO=https://github.com/GoogleCloudPlatform/kubernetes GIT_SYNC_DEST=/git -e GIT_SYNC_BRANCH=gh-pages -r HEAD GIT_SYNC_DEST=/git -v /git-data:/git git-sync
# run a nginx container to serve sync'ed content # run a nginx container to serve sync'ed content
docker run -d -p 8080:80 -v /git-data:/usr/share/nginx/html nginx docker run -d -p 8080:80 -v /git-data:/usr/share/nginx/html nginx
``` ```

View File

@ -8,11 +8,11 @@ desiredState:
- name: git-sync - name: git-sync
image: proppy/git-sync image: proppy/git-sync
imagePullPolicy: PullAlways imagePullPolicy: PullAlways
env:: env:
- name: GIT_SYNC_REPO - name: GIT_SYNC_REPO
value: https://github.com/proppy/blog.git value: https://github.com/GoogleCloudPlatform/kubernetes.git
- name: GIT_SYNC_DEST - name: GIT_SYNC_DEST
value: /git value: /git
volumeMounts: volumeMounts:
- name: markdown - name: markdown
mountPath: /git mountPath: /git
@ -20,12 +20,12 @@ desiredState:
image: proppy/hugo image: proppy/hugo
imagePullPolicy: PullAlways imagePullPolicy: PullAlways
env: env:
- name: SRC - name: HUGO_SRC
value: /src value: /src/contrib/git-sync/demo/blog
- name: BUILD_DRAFT - name: HUGO_BUILD_DRAFT
value: 'true' value: 'true'
- name: BASE_URL - name: HUGO_BASE_URL
value: kube.proppy.sh value: example.com
volumeMounts: volumeMounts:
- name: markdown - name: markdown
mountPath: /src mountPath: /src

View File

@ -1,13 +1,26 @@
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang FROM golang
RUN go get -v github.com/spf13/hugo RUN go get -v github.com/spf13/hugo
RUN git clone --recursive https://github.com/spf13/hugoThemes.git /themes RUN git clone --recursive https://github.com/spf13/hugoThemes.git /themes
VOLUME ["/src", "/dest"] VOLUME ["/src", "/dest"]
EXPOSE 1313 EXPOSE 1313
ENV SRC /src ENV HUGO_SRC /src
ENV DEST /dest ENV HUGO_DEST /dest
ENV THEME hyde ENV HUGO_THEME hyde
ENV BUILD_DRAFT false ENV HUGO_BUILD_DRAFT false
ENV BASE_URL "" ENV HUGO_BASE_URL ""
ADD run-hugo /run-hugo ADD run-hugo /run-hugo
ENTRYPOINT ["/run-hugo"] ENTRYPOINT ["/run-hugo"]
CMD ["server", "--source=${SRC}", "--theme=${THEME}", "--buildDrafts=${BUILD_DRAFT}", "--baseUrl=${BASE_URL}", "--watch", "--destination=${DEST}", "--appendPort=false"] CMD ["server", "--source=${HUGO_SRC}", "--theme=${HUGO_THEME}", "--buildDrafts=${HUGO_BUILD_DRAFT}", "--baseUrl=${HUGO_BASE_URL}", "--watch", "--destination=${HUGO_DEST}", "--appendPort=false"]

View File

@ -0,0 +1,12 @@
# hugo
`hugo` is a container that convert markdown into html using [hugo static site generator](http://gohugo.io/).
## Usage
```
# build the container
docker build -t hugo .
# run the hugo container
docker run -e HUGO_BASE_URL=example.com -v /path/to/md:/src -v /path/to/html:/dest hugo
``

View File

@ -15,7 +15,7 @@
# limitations under the License. # limitations under the License.
set -ex set -ex
if [ ! -d ${SRC}/themes ]; then if [ ! -d ${HUGO_SRC}/themes ]; then
ln -s /themes ${SRC}/themes ln -s /themes ${HUGO_SRC}/themes
fi fi
hugo $(eval echo $*) # force default CMD env expansion hugo $(eval echo $*) # force default CMD env expansion