Skip to content

Commit e2e0b81

Browse files
committed
Add updated production deployment guidelines
1 parent a8260b3 commit e2e0b81

File tree

2 files changed

+51
-52
lines changed

2 files changed

+51
-52
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[id="contributing-to-docs-docs-production-deployment"]
2+
= Production deployment of the OpenShift documentation
3+
:icons:
4+
:toc: macro
5+
:toc-title:
6+
:toclevels: 1
7+
:linkattrs:
8+
:description: How to deploy the entire set of documentation
9+
10+
toc::[]
11+
12+
== Source-to-image pipeline
13+
OpenShift documentation is built and deployed on an https://cloud.redhat.com/products/dedicated/[OpenShift Dedicated cluster]
14+
using a https://github.com/openshift/source-to-image[source-to-image] build pipeline.
15+
16+
The source-to-image builder image is built from a https://github.com/openshift-cs/docs-builder/[community project in GitHub]
17+
and published to https://quay.io/repository/openshift-cs/docs-builder.
18+
19+
== Documentation deployment
20+
Deploying the OpenShift documentation is simplified by using a
21+
https://github.com/openshift-cs/docs-builder/blob/main/template.yaml[pre-built OpenShift template YAML].
22+
23+
You can use the following command to deploy the OpenShift Container Platform (commercial) documentation
24+
25+
[source,terminal]
26+
----
27+
oc new-app https://raw.githubusercontent.com/openshift-cs/docs-builder/main/template.yaml \
28+
-p NAME=docs-openshift-com \
29+
-p PACKAGE=commercial \
30+
-p APPLICATION_DOMAIN=docs.openshift.com \
31+
-p BUILD_REPO=https://github.com/openshift/openshift-docs.git \
32+
-p BUILD_BRANCH=main
33+
----
34+
35+
You can use the following command to deploy the OKD (community) documentation
36+
37+
[source,terminal]
38+
----
39+
oc new-app https://raw.githubusercontent.com/openshift-cs/docs-builder/main/template.yaml \
40+
-p NAME=docs-openshift-com \
41+
-p PACKAGE=community \
42+
-p APPLICATION_DOMAIN=docs.openshift.com \
43+
-p BUILD_REPO=https://github.com/openshift/openshift-docs.git \
44+
-p BUILD_BRANCH=main
45+
----
46+
47+
== Deployment customization
48+
It's possible to change the documentation source repository to another repository for development by changing the
49+
`BUILD_REPO` parameter in the `oc new-app` command.
50+
51+
To change the builder image, provide the `BUILDER_IMAGE` parameter in the `oc new-app` command.

contributing_to_docs/tools_and_setup.adoc

-52
Original file line numberDiff line numberDiff line change
@@ -135,55 +135,3 @@ edit existing content or create assemblies and modules.
135135
some basic guidelines to keep things consistent across our content.
136136
* link:create_or_edit_content.adoc[Create a local working branch] on your
137137
workstation to edit existing content or create content.
138-
139-
=== How to deploy to your own OpenShift cluster for testing
140-
141-
You can deploy to your own OpenShift cluster for development. This process will use your github repo to launch the website,
142-
and therefore your github repo must have all of the upstream branches. `main` is used for site changes,
143-
so assuming all your work is in `main`, you can remove all remote branches and then push the upstream branches.
144-
145-
146-
Removing remote branches and updating with upstream branches (this assumes remote repos called `origin` and `upstream`)
147-
[WARNING]
148-
====
149-
This is a destructive process, make sure that this is purely a development repo, as all local and remote branches will be deleted
150-
by performing the below commands.
151-
====
152-
----
153-
$ git fetch --all
154-
$ for branch in $(git branch -r | grep -v "main" | grep "^ origin"); do git push origin --delete $(echo $branch | cut -d '/' -f 2); done
155-
$ git branch -D $(git branch | grep -v 'main' | xargs)
156-
$ for branch in $(git branch -r | grep -v "main" | grep "^ upstream"); do git branch --track $(echo $branch | cut -d '/' -f 2) $(echo $branch | tr -d '[:space:]'); done
157-
$ for branch in $(git branch | grep -v "main"); do git push origin $(echo $branch | tr -d '[:space:]'); done
158-
----
159-
160-
Deploying the docs site to an OpenShift cluster
161-
----
162-
$ oc process -f asciibinder-template.yml -p NAME=community-docs \
163-
-p SOURCE_REPOSITORY_URL=$(git remote get-url origin) \
164-
-p SOURCE_REPOSITORY_REF=$(git rev-parse --abbrev-ref HEAD) \
165-
-p DOC_TYPE=community \
166-
| oc create -f -
167-
$ oc process -f asciibinder-template.yml -p NAME=commercial-docs \
168-
-p SOURCE_REPOSITORY_URL=$(git remote get-url origin) \
169-
-p SOURCE_REPOSITORY_REF=$(git rev-parse --abbrev-ref HEAD) \
170-
-p DOC_TYPE=commercial \
171-
| oc create -f -
172-
----
173-
174-
[NOTE]
175-
====
176-
If the build fails with "Fetch source failed" status, you can
177-
delete all the created objects and re-run above with an HTTP uri
178-
as the `SOURCE_REPOSITORY_URL`, or you can
179-
link:https://docs.okd.io/latest/dev_guide/builds/build_inputs.html#source-secrets-combinations[create a source secret]
180-
and add it to the stg1 build, `oc set build-secret --source bc/stg1-docs <secret name>`.
181-
====
182-
183-
184-
You can delete all created objects by running
185-
186-
----
187-
$ oc delete all -l app=community-docs
188-
$ oc delete all -l app=commercial-docs
189-
----

0 commit comments

Comments
 (0)