Skip to content

Commit

Permalink
BuildKite, resources: Deploy docs via a thegraph-docs deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannis Pohlmann committed May 9, 2018
1 parent 03f72d6 commit bad55e6
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .buildkite/pipeline.deploy-staging-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
steps:
- label: Build and push Docker image
command: |
cp resources/docker/thegraph-docs/Dockerfile . \
&& gcloud container builds submit \
--timeout=25m \
--tag gcr.io/the-graph-staging/thegraph-docs .
- wait
- label: Deploy the docs
command: |
kubectl apply \
--cluster=$BUILDKITE_TARGET_CLUSTER \
--user=$BUILDKITE_TARGET_CLUSTER \
-f resources/kubernetes/thegraph-docs/deployment.yaml \
&& kubectl apply \
--cluster=$BUILDKITE_TARGET_CLUSTER \
--user=$BUILDKITE_TARGET_CLUSTER \
-f resources/kubernetes/thegraph-docs/service.yaml
4 changes: 4 additions & 0 deletions .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ steps:
command: cargo fmt --all -- --write-mode=diff
- label: Run tests
command: cargo test
- wait
- label: Deploy to staging
trigger: the-graph-network-staging-deployment
branches: master
- label: Deploy staging docs
trigger: the-graph-network-staging-docs
branches: master
14 changes: 14 additions & 0 deletions resources/docker/thegraph-docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM rust:latest

# Install clang (required for dependencies)
RUN apt-get update \
&& apt-get install -y clang libclang-dev

# Install Python to serve the docs
RUN apt-get install python

# Copy, build, install and run thegraph-local-node
COPY . .
RUN cd thegraph-local-node && cargo doc --no-deps -p thegraph
WORKDIR target/doc/
CMD ["python", "-m", "SimpleHTTPServer", "8000"]
20 changes: 20 additions & 0 deletions resources/kubernetes/thegraph-docs/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: thegraph-docs
spec:
selector:
matchLabels:
app: thegraph-docs
replicas: 1
template:
metadata:
labels:
app: thegraph-docs
spec:
containers:
- name: thegraph-docs
image: gcr.io/the-graph-staging/thegraph-docs:latest
ports:
- name: http
containerPort: 8000
13 changes: 13 additions & 0 deletions resources/kubernetes/thegraph-docs/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: thegraph-docs
spec:
type: LoadBalancer
selector:
app: thegraph-docs
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8000

0 comments on commit bad55e6

Please sign in to comment.