Skip to content

Commit 44b6a03

Browse files
author
SoftwareSennin
committed
Bootcamp
0 parents  commit 44b6a03

File tree

456 files changed

+105754
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

456 files changed

+105754
-0
lines changed

.bablerc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/preset-env"]
3+
}

.cspell.json

+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{
2+
"version": "0.2",
3+
"language": "en_US",
4+
"words": [
5+
"ABAC",
6+
"acrpull",
7+
"adoptopenjdk",
8+
"aluable",
9+
"Armon",
10+
"awscli",
11+
"AWSCLIV",
12+
"azurerm",
13+
"Bento",
14+
"Billings-Alston",
15+
"blaa",
16+
"boto",
17+
"Brolliar",
18+
"burnup",
19+
"cfssl",
20+
"cfssljson",
21+
"Chainguard",
22+
"cifs",
23+
"CNCF",
24+
"Codecademy",
25+
"Codecov",
26+
"dbservers",
27+
"devel",
28+
"devopsbootcamp",
29+
"distro",
30+
"distros",
31+
"Docsify",
32+
"Docu",
33+
"dōjō",
34+
"Ecdnendpoint",
35+
"Ecdnprofile",
36+
"eddieb",
37+
"egotiable",
38+
"elete",
39+
"Errorf",
40+
"ETAG",
41+
"Fioravanti's",
42+
"fluentd",
43+
"Fontaine",
44+
"gesparza",
45+
"gitea",
46+
"gofmt",
47+
"GWLB",
48+
"Hashicup",
49+
"healthz",
50+
"hpas",
51+
"HTTPIP",
52+
"Inclusivity",
53+
"Intelli",
54+
"Intn",
55+
"joda",
56+
"jodatime",
57+
"Katacode",
58+
"kdeardorff",
59+
"keepassxc",
60+
"Kial",
61+
"Kroll",
62+
"kubebuilder",
63+
"kubelet",
64+
"kubelets",
65+
"Kubewarden",
66+
"kungfu",
67+
"Kyverno",
68+
"LBBE",
69+
"liatr",
70+
"Liatrians",
71+
"Liatrio",
72+
"Mikayla",
73+
"msdemo",
74+
"mumoshu",
75+
"myapp",
76+
"meher",
77+
"mydeployment",
78+
"myfile",
79+
"mypod",
80+
"myservice",
81+
"ndependent",
82+
"nqzxz",
83+
"octumn",
84+
"Pactionly",
85+
"pdate",
86+
"Phippy",
87+
"pvcs",
88+
"Qube",
89+
"reate",
90+
"SARIF",
91+
"schedulable",
92+
"Schreiber",
93+
"SCTP",
94+
"SDLC",
95+
"Servlet",
96+
"shuf",
97+
"sonarqube",
98+
"Souza",
99+
"stimable",
100+
"struct",
101+
"structs",
102+
"terraformrc",
103+
"testvm",
104+
"tfplugindocs",
105+
"tfsdk",
106+
"tfvars",
107+
"theia",
108+
"Uncompress",
109+
"uncontainerized",
110+
"uncordon",
111+
"Unsets",
112+
"unstaged",
113+
"VM's",
114+
"VMSS",
115+
"VNET",
116+
"westus",
117+
"zxrnr",
118+
"scaffolder"
119+
],
120+
"dictionaries": [
121+
"aws",
122+
"companies",
123+
"css",
124+
"docker",
125+
"html",
126+
"k8s",
127+
"markdown",
128+
"misc",
129+
"npm",
130+
"softwareTerms",
131+
"useCompounds"
132+
],
133+
"flagWords": [
134+
"hte",
135+
"github:GitHub",
136+
"github's:GitHub's"
137+
],
138+
"files": [
139+
"*.md",
140+
"**/*.md"
141+
],
142+
"ignorePaths": [
143+
".cspell.json",
144+
"examples/**",
145+
"fontawesome/**",
146+
"img/**",
147+
"node_modules/**"
148+
],
149+
"ignoreRegExpList": [
150+
"\\S+[gG]ithub\\S*"
151+
],
152+
"features": {
153+
"weighted-suggestions": true
154+
},
155+
"allowCompoundWords": true,
156+
"useGitignore": true
157+
}

.github/workflows/markdown-linter.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: markdown-linter
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
types: [opened, synchronize, reopened, ready_for_review]
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
if: github.event.pull_request.draft == false
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: DavidAnson/markdownlint-cli2-action@v18
15+
with:
16+
globs: |
17+
*.md
18+
**/*.md

.github/workflows/static.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["master"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 18
41+
42+
- name: Install dependencies
43+
run: npm ci
44+
45+
- name: Run webpack build
46+
run: npx webpack --config webpack.prod.js
47+
48+
- name: Setup Pages
49+
uses: actions/configure-pages@v5
50+
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
# Upload entire repository
55+
path: '.'
56+
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test Front Matter
2+
3+
on:
4+
pull_request:
5+
branches: [ '*' ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
test-front-matter:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '18'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run Compare Front Matter
25+
run: npm run compare-front-matter

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.DS_Store
2+
.idea/
3+
/examples/ch6/devops-api/devops-api
4+
5+
examples/ch2/vagrant_docker_example/.vagrant/
6+
7+
.env
8+
9+
## Docsify
10+
docsify/
11+
12+
## Node
13+
node_modules/
14+
15+
## VSCode
16+
.vscode
17+
.code-workspace
18+
19+
20+
## Webpack
21+
dist/

.husky/front-matter-condenser.js

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
const matter = require('gray-matter');
4+
5+
const green = '\x1b[32m';
6+
const reset = '\x1b[0m';
7+
const yellow = '\x1b[33m';
8+
const red = '\x1b[31m';
9+
const MASTER_RECORD_PATH = path.join(__dirname, '../docs/README.md');
10+
const SIDEBAR_PATH = path.join(__dirname, '../docs/_sidebar.md');
11+
12+
async function main() {
13+
try {
14+
15+
// See if we should update the master record
16+
const args = process.argv.slice(2);
17+
let update = false;
18+
if (args[0] === 'update') {
19+
update = true;
20+
}
21+
22+
// Using _sidebar.md as the list of exercises that we cover in the bootcamp
23+
// create a list of all markdown files that might contain front-matter
24+
const sidebar = fs.readFileSync(SIDEBAR_PATH, 'utf8');
25+
26+
const markdownFiles = sidebar.match(/\([^\)]+\.md\)/g);
27+
28+
// Remove parentheses and filter out addendum items
29+
const cleanedFiles = markdownFiles
30+
.map(file => file.slice(1, -1))
31+
.filter(file => !file.startsWith('addendum'))
32+
.map(file => path.join(__dirname, '../docs/', file ));
33+
34+
// Read the master record and extract just the front matter.
35+
let { data: masterRecord, content } = matter(fs.readFileSync(MASTER_RECORD_PATH, 'utf8'));
36+
37+
// Object where we will rebuild the master record
38+
let data = {};
39+
40+
let masterRecordChanged = false;
41+
42+
for (const mdFile of cleanedFiles) {
43+
if (!fs.existsSync(mdFile)) {
44+
console.error(`${red}${mdFile} does not exist or _sidebar.md needs to be udpated.${reset}`);
45+
process.exit(1);
46+
}
47+
48+
// Read the content of the .md file.
49+
const fileContent = fs.readFileSync(mdFile, 'utf8');
50+
51+
// Parse the YAML front matter.
52+
const { data: exerciseData } = matter(fileContent);
53+
54+
// merge the front-matter from the staged file into the master record.
55+
// This will overwrite the inner object on the master record if it exists
56+
// and also add it if it doesnt.
57+
if (exerciseData) {
58+
data = { ...data, ...exerciseData };
59+
masterRecordChanged = true;
60+
}
61+
}
62+
63+
// Create an array of key-value pairs and then sorts them alphabetically by the keys.
64+
const sortedEntries = Object.entries(data).sort(
65+
(a, b) => a[0].localeCompare(b[0])
66+
);
67+
const sortedMasterEntries = Object.entries(masterRecord).sort(
68+
(a, b) => a[0].localeCompare(b[0])
69+
);
70+
71+
// Create a new object from the sorted entries
72+
const sortedData = Object.fromEntries(sortedEntries);
73+
const sortedMasterRecord = Object.fromEntries(sortedMasterEntries);
74+
75+
// Stringify the object and compare. This handles the case of an .md file being updated
76+
// but not the front-data
77+
if (JSON.stringify(sortedData) === JSON.stringify(sortedMasterRecord)) {
78+
masterRecordChanged = false;
79+
}
80+
81+
if (masterRecordChanged) {
82+
// Stringify the updated front-matter and origional content
83+
const updatedContent = matter.stringify(content, sortedData);
84+
85+
// Update the master record with the new front-matter. Use the sorted
86+
if (update) {
87+
fs.writeFileSync(MASTER_RECORD_PATH, updatedContent);
88+
console.error(`${yellow}New front matter detected${reset}`);
89+
console.error(`${yellow}Please review changes to ./docs/README.md${reset}`);
90+
process.exit(1);
91+
}
92+
console.error(`${yellow}Front matter missing from master record. Locally run \`npm run refresh-front-matter\`${reset}`);
93+
process.exit(1);
94+
} else {
95+
// Continue with the commit.
96+
console.log(`${green}No changes to master record, proceeding with commit.${reset}`);
97+
process.exit(0);
98+
}
99+
100+
} catch (error) {
101+
console.error('An error occurred:', error);
102+
process.exit(1);
103+
}
104+
}
105+
106+
main();

0 commit comments

Comments
 (0)