Skip to content

Commit b4a323b

Browse files
author
Sean Sundberg
authored
Adds support for development on windows (#501)
- Updates batch scripts from windows testing - Updates documentation contribution info - Fixes broken links - Adds 3 retries to linkchecker Signed-off-by: Sean Sundberg <[email protected]>
1 parent 3a6634b commit b4a323b

File tree

14 files changed

+116
-21
lines changed

14 files changed

+116
-21
lines changed

build.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
@echo on
3+
4+
cspell "docs/**/*.md"
5+
mkdocs build
6+
linkchecker -f linkcheckerrc public

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -e
44

55
cspell "docs/**/*.md"
66
mkdocs build
7-
linkchecker -f linkcheckerrc public
7+
linkchecker -r 3 -f linkcheckerrc public

dev/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM squidfunk/mkdocs-material:7.1.8
22

3-
RUN apk add --no-cache --update nodejs npm
3+
RUN apk add --no-cache --update nodejs npm dos2unix
44

55
WORKDIR /site
66
COPY ./package*.json /site/
@@ -10,6 +10,6 @@ RUN pip --no-cache-dir install git+https://github.com/linkchecker/linkchecker@v1
1010
# NodeJS Dependencies
1111
RUN npm ci
1212
COPY dev/entrypoint.sh /entrypoint.sh
13-
RUN chmod +x /entrypoint.sh
13+
RUN dos2unix /entrypoint.sh && chmod +x /entrypoint.sh
1414

1515
ENTRYPOINT ["/entrypoint.sh"]

dev/build.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
set IMAGE=%1
3+
if "%IMAGE%"=="" (set IMAGE=devguide-dev)
4+
5+
set SCRIPT_DIR=%~dp0
6+
set ROOT_DIR="%SCRIPT_DIR%.."
7+
8+
docker build -t %IMAGE% -f %SCRIPT_DIR%Dockerfile %ROOT_DIR%

dev/clean.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
set NAME=%1
3+
if "%NAME%"=="" (set NAME=devguide-dev)
4+
5+
ECHO "Cleaning up old container '%NAME%'..."
6+
docker rm "%NAME%" --force 1>NUL 2>NUL
7+
8+
echo "Finished clean up"

dev/logs.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
set NAME=%1
3+
if "%NAME%"=="" (set NAME=devguide-dev)
4+
5+
docker logs -f %NAME%

dev/run.bat

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
set NAME=%1
3+
if "%NAME%"=="" (set NAME=devguide-dev)
4+
5+
set PORT=%2
6+
if "%PORT%"=="" (set PORT=8000)
7+
8+
set IMAGE=%3
9+
if "%IMAGE%"=="" (set IMAGE=devguide-dev)
10+
11+
docker run --name %NAME% -d -p %PORT%:%PORT% -v "%cd%:/site" %IMAGE%
12+
echo "Dev environment running with live reloading enabled. Open http://localhost:%PORT% to see the site"
13+
echo "For live logs run:"
14+
echo "docker logs -f %NAME%"

docs/contribute/documentation.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,42 @@ To work on documentation and be able to view the rendered web site you need to c
88

99
=== "Tooling within a Docker container"
1010

11-
You can use a Docker container and run MkDocs from the container, so no local installation is required:
11+
You can use a Docker container and run MkDocs from the container, so no local installation is required.
12+
13+
**Prerequisites**
1214

1315
- You need to have [Docker](https://www.docker.com) installed and running on your system
1416
- There are helper configurations installed if you have npm from [Node.JS](https://nodejs.org) installed.
15-
- Build the development docker container image, this is only need it once if the dependencies have not changed. Run `npm run dev:build`
17+
18+
**Setup**
19+
20+
Build the development docker container image, this is only need it once if the dependencies have not changed.
21+
22+
- Run `npm run dev:build`
23+
24+
**Work with the development environment**
25+
26+
_Start_
27+
1628
- To start developing run command `npm run dev` in the root directory of the git repo (where **package.json** and **mkdocs.yaml** are located)
1729
- Open a browser to `http://localhost:8000`, where you will see the documentation site. This will live update as you save changes to the Markdown files in the docs folder
18-
- To stop developing run command `npm dev:stop` in another terminal window, which will terminate the docker container
19-
- View the scripts section of **package.json** in the root folder of the git repo for additional options available
20-
- To build the static HTML file and check all links and spelling run command `npm run build`
30+
31+
_Stop_
32+
33+
- Run `npm dev:stop` in another terminal window, which will terminate the docker container
34+
35+
_Link checker_
36+
2137
- To check links in the built site (`npm run build` must be run first), use the linkchecker, with command `npm run dev:links`. This command should be run in the root folder of the project, containing the **linkcheckerrc** file.
38+
39+
_Spell checker_
40+
2241
- To check spelling `npm run dev:spell` should be run in the root folder of the project, containing the **cspell.json** file.
2342

43+
_Build static site_
44+
45+
- To build the static HTML file and check all links and spelling run command `npm run build`
46+
2447
=== "Local mkdocs and python tooling installation"
2548

2649
You can install MkDocs and associated plugins on your development system and run the tools locally:

docs/learning/dev-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To install the IBM Cloud CLI follow the instructions in the [IBM Cloud documenta
4040

4141
The oc command is available from all installations of RedHat OpenShift or CodeReady Containers. Navigate and log into the web console for the cluster, then in the dropdown accessed by clicking the help icon (a question mark next to you username at the top of the web console) you will find a link to the install images for various operating systems.
4242

43-
The install images are also available to download from [RedHat](https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/){: target=_blank}. Be sure to get the latest version of the oc command.
43+
The install images are also available to download from [RedHat](https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/){: target=_blank}. Be sure to get the latest version of the oc command.
4444

4545
## User accounts
4646

docs/reference/tools/sonar-qube.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SonarQube performs static code analysis to evaluate code quality, using analysis
1010
- **Application Security**: Detect vulnerabilities and hot spots that can be exploited to compromise the program
1111
- **Technical Debt**: Keep you codebase maintainable to increase developer velocity
1212

13-
SonarQube [plugs into the application lifecycle management (ALM)](https://docs.sonarqube.org/latest/architecture/architecture-integration/#header-2) process to make continuous inspection part of continuous integration. Adding code analysis to ALM provides regular, timely feedback on the quality of the code being produced. The goal is to detect problems as soon as possible so that they can be resolved before they can impact production end users.
13+
SonarQube [plugs into the application lifecycle management (ALM)](https://docs.sonarqube.org/latest/#header-1) process to make continuous inspection part of continuous integration. Adding code analysis to ALM provides regular, timely feedback on the quality of the code being produced. The goal is to detect problems as soon as possible so that they can be resolved before they can impact production end users.
1414

1515
The continuous integration (CI) server integrates SonarQube into the ALM.The SonarQube solution consists of several components: The central component is the SonarQube Server, which runs the SonarScanner, processes the resulting analysis reports, stores the reports in SonarQube Database, and displays the reports in the SonarQube UI. A CI server uses a stage/goal/task in its build automation to trigger the language-specific SonarScanner to scan the code being built. Developers can view the resulting analysis report in the SonarQube UI.
1616

0 commit comments

Comments
 (0)