Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create .env file automatically after npm install (don't overwrite if already exists) #515

Merged
merged 2 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ This allows running the documentation site which serves as a development platfor

Review the default env variable values in the `docker-compose.yml` file.
The defaults should work for most systems, but can be changed if needed.

To change them:

1. Create a `.env` file from the template:

```bash
cp .env.dist .env
```

2. Edit the new `.env` file as needed
To change them, edit the `.env` file as needed.

### Use Docker Compose

Expand All @@ -41,39 +32,39 @@ docker compose run --rm node_shell

#### Run the Dev Server

1. Install dependencies (run within `node_shell`):
1. **Within `node_shell`:** Install dependencies:

```bash
npm ci
```

2. Run development server (run on host):
2. **On host:** Run development server:

```bash
docker compose up node_dev_server mkdocs_dev_server
```

#### Build the Project

1. Make sure the dev server is not running (run on host):
1. **On host:** Make sure the dev server is not running:

```bash
docker compose down
```

2. Install dependencies (run within `node_shell`):
2. **Within `node_shell`:** Install dependencies:

```bash
npm ci
```

3. Build JS (run on host):
3. **On host:** Build JS:

```bash
docker compose run --rm node_build_site
```

4. Build mkDocs (run on host):
4. **On host:** Build mkDocs:

```bash
docker compose run --rm mkdocs_build_site
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"lint": "npm run eslint && npm run markdownlint && npm run stylelint",
"markdownlint": "markdownlint-cli2 \"CONTRIBUTING.md\" \"README.md\" \"RELEASING.md\" \"src/**/*.md\"",
"postbuild": "npm run copy",
"postinstall": "cp -n .env.dist .env || true",
"precopy": "rm -rf dist && mkdir dist",
"prepublishOnly": "npm run build",
"start": "webpack --watch --mode=development",
Expand Down
Loading