Skip to content

Commit

Permalink
GitBook build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pwittrock committed Apr 28, 2018
1 parent 3140cbb commit d033a45
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 0 deletions.
19 changes: 19 additions & 0 deletions build/gitbook/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2018 The Kubernetes Authors.
#
# 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 node:6

RUN npm install -g gitbook-cli

RUN gitbook fetch 3.2.3
27 changes: 27 additions & 0 deletions build/gitbook/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2018 The Kubernetes Authors.
#
# 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.

steps:
- name: "gcr.io/kubebuilder/gitbook"
dir: "docs/book"
args: ["/usr/local/bin/gitbook", "install"]
- name: "gcr.io/kubebuilder/gitbook"
dir: "docs/book"
args: ["/usr/local/bin/gitbook", "build"]
- name: "gcr.io/cloud-builders/docker"
dir: "docs/book"
args: ["build", ".", "-t", "gcr.io/kubebuilder/book"]
- name: "gcr.io/cloud-builders/docker"
dir: "docs/book"
args: ["push", "gcr.io/kubebuilder/book"]
20 changes: 20 additions & 0 deletions build/gitbook/config/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
run: gitbook
name: gitbook
spec:
replicas: 3
selector:
matchLabels:
run: gitbook
template:
metadata:
labels:
run: gitbook
spec:
containers:
- image: gcr.io/kubebuilder/book
imagePullPolicy: Always
name: gitbook
14 changes: 14 additions & 0 deletions build/gitbook/config/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
run: gitbook
name: gitbook
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
run: gitbook
type: LoadBalancer
8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# Running GitBook

1. Follow the instructions at [https://toolchain.gitbook.com/](https://toolchain.gitbook.com/) to
install gitbook.
2. cd into the `docs/book` directory
3. Run `gitbook server`
4. Visit `localhost:4000`
18 changes: 18 additions & 0 deletions docs/book/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2018 The Kubernetes Authors.
#
# 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 nginx

COPY _book /usr/share/nginx/html

0 comments on commit d033a45

Please sign in to comment.