Skip to content

Commit d033a45

Browse files
committed
GitBook build scripts
1 parent 3140cbb commit d033a45

File tree

6 files changed

+106
-0
lines changed

6 files changed

+106
-0
lines changed

build/gitbook/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2018 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM node:6
16+
17+
RUN npm install -g gitbook-cli
18+
19+
RUN gitbook fetch 3.2.3

build/gitbook/cloudbuild.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2018 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
steps:
16+
- name: "gcr.io/kubebuilder/gitbook"
17+
dir: "docs/book"
18+
args: ["/usr/local/bin/gitbook", "install"]
19+
- name: "gcr.io/kubebuilder/gitbook"
20+
dir: "docs/book"
21+
args: ["/usr/local/bin/gitbook", "build"]
22+
- name: "gcr.io/cloud-builders/docker"
23+
dir: "docs/book"
24+
args: ["build", ".", "-t", "gcr.io/kubebuilder/book"]
25+
- name: "gcr.io/cloud-builders/docker"
26+
dir: "docs/book"
27+
args: ["push", "gcr.io/kubebuilder/book"]

build/gitbook/config/deployment.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
run: gitbook
6+
name: gitbook
7+
spec:
8+
replicas: 3
9+
selector:
10+
matchLabels:
11+
run: gitbook
12+
template:
13+
metadata:
14+
labels:
15+
run: gitbook
16+
spec:
17+
containers:
18+
- image: gcr.io/kubebuilder/book
19+
imagePullPolicy: Always
20+
name: gitbook

build/gitbook/config/service.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
run: gitbook
6+
name: gitbook
7+
spec:
8+
ports:
9+
- port: 80
10+
protocol: TCP
11+
targetPort: 80
12+
selector:
13+
run: gitbook
14+
type: LoadBalancer

docs/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# Running GitBook
3+
4+
1. Follow the instructions at [https://toolchain.gitbook.com/](https://toolchain.gitbook.com/) to
5+
install gitbook.
6+
2. cd into the `docs/book` directory
7+
3. Run `gitbook server`
8+
4. Visit `localhost:4000`

docs/book/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2018 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
FROM nginx
17+
18+
COPY _book /usr/share/nginx/html

0 commit comments

Comments
 (0)