Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit f6816a5

Browse files
[HOUSEKEEPING] Finding broken links in md files and fix them (#432)
* [HOUSEKEEPING] Finding broken links in md files and fix them * using markdown-link-check * update md-lint * Update azure-pipelines.yml * script is not needed because we do not support windows runtime Co-authored-by: Yvonne Radsmikham <[email protected]>
1 parent d1862fc commit f6816a5

15 files changed

+100
-44
lines changed

azure-pipelines.yml

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ steps:
3636
yarn lint
3737
displayName: "YARN LINT"
3838
39+
- script: |
40+
yarn md-lint
41+
displayName: "YARN MARKDOWN LINT"
42+
3943
- script: |
4044
yarn build
4145
displayName: "YARN BUILD"

guides/config-file.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# spk-config.yaml
22

3-
The [`spk-config.yaml`](./spk-config.yaml) consists of three main sections:
3+
The [`spk-config.yaml`](../spk-config.yaml) consists of three main sections:
44

55
1. `introspection`
66
2. `infra`
@@ -35,7 +35,7 @@ There are two options to create environment variables:
3535
A recommended approach is to have a `.env` file in your folder **(make sure it's
3636
gitignored!)** with all variables and their values.
3737

38-
[Sample `.env`](./.env.example):
38+
[Sample `.env`](../.env.example):
3939

4040
```
4141
INTROSPECTION_STORAGE_ACCESS_KEY="access key"

guides/contributing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ ts-node src/index.ts project init # same as running `./spk project init`
4040

4141
### Implementing Commands
4242

43-
Refer to this [doc](./guides/command-implementation.md) for guidelines for
44-
implementing commands.
43+
Refer to this [doc](./command-implementation.md) for guidelines for implementing
44+
commands.
4545

4646
### Running Tests
4747

guides/infra/spk-infra-generation-pipeline.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ orchestrator for your Infrastructure Generation workflow using `spk infra`.
1313
[here](https://github.com/yradsmikham/spk-infra-hld). You should be able to
1414
create your Infra HLD repo using a scaffolding process via `spk` (i.e.
1515
`spk infra scaffold`). For more information on how to do that, please refer
16-
to the
17-
[Cloud Infra Management](https://github.com/CatalystCode/spk/blob/master/docs/cloud-infra-management.md#scaffold)
18-
doc.
16+
to the [Cloud Infra Management](../cloud-infra-management.md) doc.
1917

2018
## Setup
2119

guides/infra/spk-infra-under-the-hood.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ directory):
8282

8383
`spk` will extend the capability to clone private repositories using personal
8484
access tokens (PAT). For more information, please refer to this
85-
[section](https://github.com/CatalystCode/spk/blob/master/docs/cloud-infra-management.md#authentication)
86-
of Cloud Infra Management.
85+
[section](../cloud-infra-management.md#authentication-private-repos) of Cloud
86+
Infra Management.
8787

8888
## Future Considerations
8989

guides/infra/spk-terragrunt-overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ scaffolding and generation detailed in the
1313
4. [Multiple Template Environments](#multiple-template-environments)
1414
5. [Embedding in SPK](#embedding-in-spk)
1515
6. [Issues with Terragrunt Approach](#issues-with-terragrunt-approach)
16-
7. [`spk infra` Vision](/SPK-Infra.md)
16+
7. [`spk infra` Vision](./spk-terragrunt-day-2-scenarios.md)
1717

1818
## Prerequisites
1919

guides/manual-guide-to-rings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This guide presumes that you have set up your `spk` project, and installed all
66
necessary pipelines created via `spk project init` (the lifecycle pipeline),
77
`spk service create` (build update hld pipeline), and `spk hld init` (manifest
88
generation pipeline), and followed the
9-
[guidelines for creating helm charts](./building-helm-charts-for-spk).
9+
[guidelines for creating helm charts](./building-helm-charts-for-spk.md).
1010

1111
In `spk`, we offer the concept of a `ring` - a way to route inbound traffic to
1212
_revisions_ of a service on a Kubernetes cluster via request headers. For

guides/project-service-management-guide.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This document describes the workflow for deploying a set of services
2828
An overview of how these different pieces fit together from an automation
2929
perspective:
3030

31-
![spk resources](/guides/images/spk-resource-diagram.png "Bedrock SPK Resources")
31+
![spk resources](./images/spk-resource-diagram.png "Bedrock SPK Resources")
3232

3333
## Requirements
3434

@@ -134,7 +134,7 @@ applied to the Kubernetes cluster by Flux.
134134
```
135135

136136
**NOTE** `spk hld` command documentation can be found
137-
[here](/guides/hld-management.md).
137+
[here](./hld-management.md).
138138

139139
### Materialized Manifests Repository
140140

@@ -225,7 +225,7 @@ application repositories
225225
run `install-lifecycle-pipeline` once for each repo.
226226

227227
**NOTE** `spk project` command documentation can be found
228-
[here](/guides/project-management.md).
228+
[here](./project-management.md).
229229

230230
#### Adding a Service to a Application Repository
231231

@@ -249,7 +249,7 @@ application repositories
249249
definition in Azure Devops.
250250

251251
**NOTE** `spk service` command documentation can be found
252-
[here](/guides/service-management.md).
252+
[here](./service-management.md).
253253

254254
#### Helm Configuration for SPK
255255

@@ -426,7 +426,7 @@ parameters to `spk service create --helm-config-git`:
426426
```
427427

428428
**NOTE** `spk service` command documentation can be found
429-
[here](/guides/service-management.md).
429+
[here](./service-management.md).
430430

431431
## Helm Charts
432432

guides/service-introspection-onboarding.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Service Introspection shows information about a
55

66
Service introspection is used via the `spk deployment` commands. More
77
information about the commands is available in the command reference
8-
[here](https://github.com/CatalystCode/spk/blob/master/docs/service-introspection.md).
8+
[here](./service-introspection.md).
99

1010
The following diagram shows the main components of service introspection.
1111
![spk service introspection diagram](./images/service_introspection.png)
@@ -34,7 +34,7 @@ it or use an existing one.
3434
**Option 1:**
3535

3636
Use the
37-
[`spk deployment onboard`](https://github.com/CatalystCode/spk/blob/master/guides/service-introspection.md#onboard)
37+
[`spk deployment onboard`](https://catalystcode.github.io/spk/commands/#master@deployment_onboard)
3838
command.
3939

4040
**Option 2:**
@@ -248,10 +248,10 @@ After completing the steps in this guide, you should be able to:
248248

249249
- Validate and verify the `spk-config.yaml` settings and the service
250250
introspection storage using
251-
[`spk deployment validate`](https://github.com/CatalystCode/spk/blob/master/docs/service-introspection.md#validate)
251+
[`spk deployment validate`](https://catalystcode.github.io/spk/commands/#master@deployment_validate)
252252

253253
- Get information about your deployment using
254-
[`spk deployment get`](https://github.com/CatalystCode/spk/blob/master/docs/service-introspection.md#get)
254+
[`spk deployment get`](https://catalystcode.github.io/spk/commands/#master@deployment_get)
255255

256256
- Launch the dashboard to visualize the data using
257-
[`spk deployment dashboard`](https://github.com/CatalystCode/spk/blob/master/docs/service-introspection.md#dashboard)
257+
[`spk deployment dashboard`](https://catalystcode.github.io/spk/commands/#master@deployment_dashboard)

guides/service-introspection.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Global options:
3535
## Requirements
3636

3737
Fill out the service introspection settings in your spk config file, for example
38-
`spk-config.yaml`. [Sample config file](./../../spk-config.yaml).
38+
`spk-config.yaml`. [Sample config file](../spk-config.yaml).
3939

4040
```
4141
introspection:

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"build-cmd-docs": "ts-node tools/generateDoc.ts",
1111
"lint": "eslint 'src/**/*.ts{,x}'",
1212
"lint-fix": "eslint --fix 'src/**/*.ts{,x}'",
13+
"md-lint": "find guides -name \\*.md | xargs -n 1 markdown-link-check",
1314
"format": "prettier --write 'src/**/*.ts{,x}'",
1415
"test": "jest --rootDir src --reporters=jest-junit --reporters=default --coverage --coverageReporters=cobertura --coverageReporters=html",
1516
"test-watch": "jest --watchAll",
@@ -39,6 +40,7 @@
3940
"jest-junit": "^10.0.0",
4041
"jest-when": "^2.7.0",
4142
"lint-staged": ">=10",
43+
"markdown-link-check": "^3.8.0",
4244
"mock-fs": "^4.10.2",
4345
"nyc": "^14.1.1",
4446
"pkg": "^4.4.0",

src/lib/pipelines/variableGroup.test.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
/* eslint-disable @typescript-eslint/camelcase */
2-
import {
3-
VariableGroup,
4-
VariableGroupParameters,
5-
} from "azure-devops-node-api/interfaces/TaskAgentInterfaces";
2+
import { VariableGroupParameters } from "azure-devops-node-api/interfaces/TaskAgentInterfaces";
63
import uuid from "uuid/v4";
74
import * as azdoClient from "../azdoClient";
85
import { readYaml } from "../../config";

tools/generateDoc.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import fs from "fs";
22
import path from "path";
33
import { CommandBuildElements } from "../src/lib/commandBuilder";
44

5-
interface ICommand {
5+
interface Command {
66
command: string;
77
subcommands: CommandBuildElements[];
88
}
99

10-
interface ICommandElement extends CommandBuildElements {
10+
interface CommandElement extends CommandBuildElements {
1111
markdown?: string;
1212
}
1313

@@ -17,9 +17,9 @@ interface ICommandElement extends CommandBuildElements {
1717
const getAllDecorators = (curDir: string): CommandBuildElements[] => {
1818
const allFiles = fs.readdirSync(curDir);
1919
const jsonFiles = allFiles.filter(f => f.endsWith(".json"));
20-
const arrJson: ICommandElement[] = [];
20+
const arrJson: CommandElement[] = [];
2121
jsonFiles.forEach(fileName => {
22-
const json = require(path.join(curDir, fileName)) as ICommandElement;
22+
const json = require(path.join(curDir, fileName)) as CommandElement;
2323
if (!json.disabled) {
2424
const mdPath = path.join(
2525
curDir,
@@ -35,7 +35,7 @@ const getAllDecorators = (curDir: string): CommandBuildElements[] => {
3535
};
3636

3737
// get sub folders under commands folder.
38-
const getSubDirectories = (curDir: string) => {
38+
const getSubDirectories = (curDir: string): string[] => {
3939
return fs
4040
.readdirSync(curDir)
4141
.map(f => path.join(curDir, f))
@@ -46,7 +46,7 @@ const getSubDirectories = (curDir: string) => {
4646
// command object. e.g `spk infra generate` and
4747
// `spk deployment dashboard`
4848
const listCommands = (
49-
allCommands: ICommand[]
49+
allCommands: Command[]
5050
): { [key: string]: CommandBuildElements } => {
5151
const mainCommands: { [key: string]: CommandBuildElements } = {};
5252
allCommands.forEach(cmd => {
@@ -68,7 +68,7 @@ const dir = path.join(process.cwd(), "src", "commands");
6868
const commandDirs = getSubDirectories(dir);
6969
commandDirs.unshift(dir); // this is needed because `spk init` is outside `commands` folder
7070

71-
const commands: ICommand[] = commandDirs
71+
const commands: Command[] = commandDirs
7272
.map(d => {
7373
return {
7474
command: path.basename(d),

tools/locateAliases.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from "fs";
22
import path from "path";
33
import { CommandBuildElements } from "../src/lib/commandBuilder";
44

5-
interface ICommandElement extends CommandBuildElements {
5+
interface CommandElement extends CommandBuildElements {
66
markdown?: string;
77
}
88

@@ -12,9 +12,9 @@ interface ICommandElement extends CommandBuildElements {
1212
const getAllDecorators = (curDir: string): CommandBuildElements[] => {
1313
const allFiles = fs.readdirSync(curDir);
1414
const jsonFiles = allFiles.filter(f => f.endsWith(".json"));
15-
const arrJson: ICommandElement[] = [];
15+
const arrJson: CommandElement[] = [];
1616
jsonFiles.forEach(fileName => {
17-
const json = require(path.join(curDir, fileName)) as ICommandElement;
17+
const json = require(path.join(curDir, fileName)) as CommandElement;
1818
arrJson.push(json);
1919
});
2020
return arrJson;

0 commit comments

Comments
 (0)