Skip to content

Commit ae5d1b8

Browse files
committed
Refine workflow for site build and netlify deployment.
Signed-off-by: James Blair <[email protected]>
1 parent d2a1a5e commit ae5d1b8

File tree

4 files changed

+31
-33
lines changed

4 files changed

+31
-33
lines changed

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
SHELL := /bin/bash
15+
16+
# Install dependencies
17+
.PHONY: install
18+
install:
19+
# Create python virtual environment
20+
python3 -m venv venv/
21+
22+
# Active virtual environment
23+
source ./venv/bin/activate
24+
25+
# Install python depdendencies
26+
pip install -r requirements.txt
27+
1428

1529
# Build the documentation.
1630
.PHONY: docs
@@ -20,3 +34,13 @@ docs:
2034

2135
# Generate docs with mkdocs
2236
mkdocs build
37+
38+
39+
# Cleanup local directory
40+
.PHONY: cleanup
41+
cleanup:
42+
# Remove python virtual environment
43+
rm -rf venv
44+
45+
# Remove site build
46+
rm -rf site

README.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,17 @@ Participation in the Kubernetes community is governed by the [Kubernetes Code of
2222

2323
## Install and run
2424

25-
Install Python and the requirements.
25+
Install Python and the requirements for this site using the included `Makefile`.
2626

2727
```
28-
python3 -m venv venv/
29-
source venv/bin/activate
30-
pip install -r requirements.txt
28+
make install
3129
```
3230

33-
Install the mkdocs plugins
34-
35-
```
36-
pip install mkdocs-awesome-pages-plugin
37-
pip install mkdocs-macros-plugin
38-
pip install mkdocs-redirects
39-
```
4031
Use the mkdocs CLI to serve a development version of the site.
4132

4233
```mkdocs serve```
4334

44-
Navigate to localhost:8000 to see the site.
35+
Navigate to `localhost:8000` to see the site.
4536

4637
## Build and deploy
4738

netlify.toml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,3 @@
33
command = "make docs"
44
publish = "site"
55
environment = { PYTHON_VERSION = "3.8" }
6-
7-
# Standard Netlify redirects
8-
[[redirects]]
9-
from = "https://main--kubernetes-sigs-multicluster.netlify.com/*"
10-
to = "https://main.multicluster.sigs.k8s.io/:splat"
11-
status = 301
12-
force = true
13-
14-
# HTTP-to-HTTPS rules
15-
[[redirects]]
16-
from = "http://main.multicluster.sigs.k8s.io/*"
17-
to = "https://main.multicluster.sigs.k8s.io/:splat"
18-
status = 301
19-
force = true
20-
21-
[[redirects]]
22-
from = "http://main--kubernetes-sigs-multicluster.netlify.com/*"
23-
to = "http://main.multicluster.sigs.k8s.io/:splat"
24-
status = 301
25-
force = true

requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
mkdocs-material
1+
mkdocs-material
2+
mkdocs-awesome-pages-plugin
3+
mkdocs-macros-plugin
4+
mkdocs-redirects

0 commit comments

Comments
 (0)