Skip to content
Permalink
Browse files
Update prepare script in readme (#763)
  • Loading branch information
zhongjiajie committed Apr 7, 2022
1 parent 61fb51e commit 6c25a3df35c21777dc60985fa8640871c797b3dd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 27 deletions.
@@ -0,0 +1,22 @@
# How Prepare Script Work

## Background

Our latest documents are in directory `docs` DolphinScheduler [main repository](https://github.com/apache/dolphinscheduler.git),
and the history documents before version 3.0.0-alpha is in branch [history-docs](https://github.com/apache/dolphinscheduler-website/tree/history-docs)
in [website repository](https://github.com/apache/dolphinscheduler-website). In this case, you have to collect them from
above repository into current working path before you compile them to HTML.

Of course, you could collect all content manually, but we already provider convenience script to do that, all you have to
do is run a single command in this project root directory:

```shell
./scripts/prepare_docs.sh
```

It would do all prepare things for you.

> Note: When you failed to run the command and see some log like "unable to access" in your terminal, you can set and
> environment variable `export PROTOCOL_MODE=ssh` and then run command `./scripts/prepare_docs.sh` again. After setting the
> variable will clone source code in SSH protocol instead of HTTPS protocol, and it will stable and fast in some cases like
> local development.
@@ -1,42 +1,24 @@
# Apache DolphinScheduler Official Website

This project keeps all sources used for building up DolphinScheduler official website which is served at https://dolphinscheduler.apache.org/.
This project keeps all sources used for building up DolphinScheduler's official website which is served at https://dolphinscheduler.apache.org/.

## Prerequisite

DolphinScheduler website is powered by [docsite](https://github.com/chengshiwen/docsite-ext).
DolphinScheduler website is powered by [docsite](https://github.com/chengshiwen/docsite-ext). Please also make sure your
node version is 10+, version lower than 10.x is not supported yet.

Please also make sure your node version is 10+, version lower than 10.x is not supported yet.

## Prepare All Related Resource

Our latest documents are in DolphinScheduler [main repository](https://github.com/apache/dolphinscheduler.git) directory
`docs`, and the history documents is in branch [history-docs](https://github.com/apache/dolphinscheduler-website/tree/history-docs)
in this repository. In this case, you have to collect them from somewhere to current working path before you compile
them to HTML format.

Of course, you could collect all content manually, but we already provider convenience script to do that, all you have to
do is run a single command:

```shell
./scripts/prepare_docs.sh
```

It would do all prepare things for you.

> Note: When you failed to run the command and see some log like "unable to access" in your terminal, you can set and
> environment variable `export DEV_MODE=true` and then run command `./scripts/prepare_docs.sh` again. After setting the
> variable will clone source code in SSH instead of HTTPS, it will stable and fast in some cases.
## Build instruction
## Build Website Locally

1. Run `npm install` in the root directory to install the dependencies.
2. Run `npm run start` in the root directory to start a local server, you will see the website in 'http://localhost:8080'.
2. Run `./scripts/prepare_docs.sh` prepare all related resources, for more information you could see [how prepare script work](HOW_PREPARE_WOKR.md)
3. Run `npm run start` in the root directory to start a local server, you will see the website in 'http://localhost:8080'.

```
Note: if you clone the code in Windows, not Mac. Please read the details below.
Note: if you clone the code in Windows, not Mac or Linux. Please read the details below.
If you execute the commands like the two steps above, you will get the exception "UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, symlink '2.0.3' -> 'latest'".
When meeting this problem. You can run two steps in the cmd.exe as an ADMINISTRATOR MEMBER.
```

3. Run `npm run build` to build source code into dist directory.
4. Verify your change locally: `python -m SimpleHTTPServer 8000`, when your python version is 3 use :`python3 -m http.server 8000` instead.

0 comments on commit 6c25a3d

Please sign in to comment.