Skip to content

Commit

Permalink
Add steps to docs for running website dev environment locally
Browse files Browse the repository at this point in the history
As a user it is not straight forward on how to run the dev environment. I can not run the website locally without running npm, the sync script and hugo in a specific order. As a user it is also annoying to create an alias to run a makefile. I changed the makefile so that I do not have to make an alias. As a developer, I do not believe this is documented anywhere and following this guide will fix this issue. tektoncd#3
  • Loading branch information
popcor255 authored and tekton-robot committed Jun 17, 2020
1 parent 95611df commit c51fc38
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 35 deletions.
61 changes: 27 additions & 34 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,40 @@
# Developing the Tekton website

- [Developing the Tekton website](#developing-the-tekton-website)
- [Running Locally](#running-locally)
- [tekton.dev](#tektondev)
- [Running Locally](#running-locally)
- [tekton.dev](#tektondev)

## Running Locally


The [tekton.dev](#tekton.dev) is deployed on Netlify. Netlify will invoke
[the Makefile](.Makefile) to build the website.

This is configured in:

* [netlify.toml](netlify.toml)
* [runtime.txt](runtime.txt) (the python runtime)
* [requirements.txt](requirements.txt) (the python requirements)
## Dependencies

To run it locally you will need to install:
* [python3](https://www.python.org/downloads/)
* [hugo (EXTENDED VERSION)](https://github.com/gohugoio/hugo/releases)
* [pip](https://pip.pypa.io/en/stable/installing/)
* [npm v6.14.5](https://nodejs.org/en/)
* [node v14.3.0](https://nodejs.org/en/)
* [netlify cli](https://cli.netlify.com/getting-started)
* [netlify account](https://app.netlify.com/)

* [Hugo](https://gohugo.io/) [version 0.53](netlify.toml)
* `npm` to install Hugo's requirements:
* `npm install` (in directory with [package.json](package.json))

Then you can run [hugo commands](https://gohugo.io/getting-started/usage/) such as:
## Running Locally

Step 1
```bash
hugo server
git clone https://github.com/tektoncd/website && cd website
```

To run the [Makefile](Makefile) you will need more dependencies and flags:

* `python` aliased to python3.7 - [sync.py](sync/sync.py) is running `python` but assumes this is python3 (configured in [runtime.txt](runtime.txt))
* `pip`, to install python requirements:
* Install with `pip install -r requirements.txt`

To run the makefile locally, you'll have to set the env var:

* [`DEPLOY_PRIME_URL`](https://docs.netlify.com/configure-builds/environment-variables/) to the path to your website files

For example:

Step 2
```bash
npm install
```
Step 3
```bash
pip install -r requirements.txt
```
Step 4
```bash
python3 sync/sync.py
```
Step 5
```bash
DEPLOY_PRIME_URL=localhost make preview-build
netlify dev
```

## tekton.dev
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: sync
sync:
python sync/sync.py
python3 sync/sync.py

.PHONY: serve
serve:
Expand Down

0 comments on commit c51fc38

Please sign in to comment.