Skip to content

Commit

Permalink
Bootcamp
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftwareSennin committed Nov 16, 2024
0 parents commit 44b6a03
Show file tree
Hide file tree
Showing 456 changed files with 105,754 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bablerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
157 changes: 157 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"version": "0.2",
"language": "en_US",
"words": [
"ABAC",
"acrpull",
"adoptopenjdk",
"aluable",
"Armon",
"awscli",
"AWSCLIV",
"azurerm",
"Bento",
"Billings-Alston",
"blaa",
"boto",
"Brolliar",
"burnup",
"cfssl",
"cfssljson",
"Chainguard",
"cifs",
"CNCF",
"Codecademy",
"Codecov",
"dbservers",
"devel",
"devopsbootcamp",
"distro",
"distros",
"Docsify",
"Docu",
"dōjō",
"Ecdnendpoint",
"Ecdnprofile",
"eddieb",
"egotiable",
"elete",
"Errorf",
"ETAG",
"Fioravanti's",
"fluentd",
"Fontaine",
"gesparza",
"gitea",
"gofmt",
"GWLB",
"Hashicup",
"healthz",
"hpas",
"HTTPIP",
"Inclusivity",
"Intelli",
"Intn",
"joda",
"jodatime",
"Katacode",
"kdeardorff",
"keepassxc",
"Kial",
"Kroll",
"kubebuilder",
"kubelet",
"kubelets",
"Kubewarden",
"kungfu",
"Kyverno",
"LBBE",
"liatr",
"Liatrians",
"Liatrio",
"Mikayla",
"msdemo",
"mumoshu",
"myapp",
"meher",
"mydeployment",
"myfile",
"mypod",
"myservice",
"ndependent",
"nqzxz",
"octumn",
"Pactionly",
"pdate",
"Phippy",
"pvcs",
"Qube",
"reate",
"SARIF",
"schedulable",
"Schreiber",
"SCTP",
"SDLC",
"Servlet",
"shuf",
"sonarqube",
"Souza",
"stimable",
"struct",
"structs",
"terraformrc",
"testvm",
"tfplugindocs",
"tfsdk",
"tfvars",
"theia",
"Uncompress",
"uncontainerized",
"uncordon",
"Unsets",
"unstaged",
"VM's",
"VMSS",
"VNET",
"westus",
"zxrnr",
"scaffolder"
],
"dictionaries": [
"aws",
"companies",
"css",
"docker",
"html",
"k8s",
"markdown",
"misc",
"npm",
"softwareTerms",
"useCompounds"
],
"flagWords": [
"hte",
"github:GitHub",
"github's:GitHub's"
],
"files": [
"*.md",
"**/*.md"
],
"ignorePaths": [
".cspell.json",
"examples/**",
"fontawesome/**",
"img/**",
"node_modules/**"
],
"ignoreRegExpList": [
"\\S+[gG]ithub\\S*"
],
"features": {
"weighted-suggestions": true
},
"allowCompoundWords": true,
"useGitignore": true
}
18 changes: 18 additions & 0 deletions .github/workflows/markdown-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: markdown-linter
on:
pull_request:
branches:
- master
types: [opened, synchronize, reopened, ready_for_review]

jobs:
lint:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v18
with:
globs: |
*.md
**/*.md
59 changes: 59 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Run webpack build
run: npx webpack --config webpack.prod.js

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
25 changes: 25 additions & 0 deletions .github/workflows/test-front-matter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test Front Matter

on:
pull_request:
branches: [ '*' ]
workflow_dispatch:

jobs:
test-front-matter:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install dependencies
run: npm ci

- name: Run Compare Front Matter
run: npm run compare-front-matter
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store
.idea/
/examples/ch6/devops-api/devops-api

examples/ch2/vagrant_docker_example/.vagrant/

.env

## Docsify
docsify/

## Node
node_modules/

## VSCode
.vscode
.code-workspace


## Webpack
dist/
106 changes: 106 additions & 0 deletions .husky/front-matter-condenser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
const fs = require('fs');
const path = require('path');
const matter = require('gray-matter');

const green = '\x1b[32m';
const reset = '\x1b[0m';
const yellow = '\x1b[33m';
const red = '\x1b[31m';
const MASTER_RECORD_PATH = path.join(__dirname, '../docs/README.md');
const SIDEBAR_PATH = path.join(__dirname, '../docs/_sidebar.md');

async function main() {
try {

// See if we should update the master record
const args = process.argv.slice(2);
let update = false;
if (args[0] === 'update') {
update = true;
}

// Using _sidebar.md as the list of exercises that we cover in the bootcamp
// create a list of all markdown files that might contain front-matter
const sidebar = fs.readFileSync(SIDEBAR_PATH, 'utf8');

const markdownFiles = sidebar.match(/\([^\)]+\.md\)/g);

// Remove parentheses and filter out addendum items
const cleanedFiles = markdownFiles
.map(file => file.slice(1, -1))
.filter(file => !file.startsWith('addendum'))
.map(file => path.join(__dirname, '../docs/', file ));

// Read the master record and extract just the front matter.
let { data: masterRecord, content } = matter(fs.readFileSync(MASTER_RECORD_PATH, 'utf8'));

// Object where we will rebuild the master record
let data = {};

let masterRecordChanged = false;

for (const mdFile of cleanedFiles) {
if (!fs.existsSync(mdFile)) {
console.error(`${red}${mdFile} does not exist or _sidebar.md needs to be udpated.${reset}`);
process.exit(1);
}

// Read the content of the .md file.
const fileContent = fs.readFileSync(mdFile, 'utf8');

// Parse the YAML front matter.
const { data: exerciseData } = matter(fileContent);

// merge the front-matter from the staged file into the master record.
// This will overwrite the inner object on the master record if it exists
// and also add it if it doesnt.
if (exerciseData) {
data = { ...data, ...exerciseData };
masterRecordChanged = true;
}
}

// Create an array of key-value pairs and then sorts them alphabetically by the keys.
const sortedEntries = Object.entries(data).sort(
(a, b) => a[0].localeCompare(b[0])
);
const sortedMasterEntries = Object.entries(masterRecord).sort(
(a, b) => a[0].localeCompare(b[0])
);

// Create a new object from the sorted entries
const sortedData = Object.fromEntries(sortedEntries);
const sortedMasterRecord = Object.fromEntries(sortedMasterEntries);

// Stringify the object and compare. This handles the case of an .md file being updated
// but not the front-data
if (JSON.stringify(sortedData) === JSON.stringify(sortedMasterRecord)) {
masterRecordChanged = false;
}

if (masterRecordChanged) {
// Stringify the updated front-matter and origional content
const updatedContent = matter.stringify(content, sortedData);

// Update the master record with the new front-matter. Use the sorted
if (update) {
fs.writeFileSync(MASTER_RECORD_PATH, updatedContent);
console.error(`${yellow}New front matter detected${reset}`);
console.error(`${yellow}Please review changes to ./docs/README.md${reset}`);
process.exit(1);
}
console.error(`${yellow}Front matter missing from master record. Locally run \`npm run refresh-front-matter\`${reset}`);
process.exit(1);
} else {
// Continue with the commit.
console.log(`${green}No changes to master record, proceeding with commit.${reset}`);
process.exit(0);
}

} catch (error) {
console.error('An error occurred:', error);
process.exit(1);
}
}

main();
Loading

0 comments on commit 44b6a03

Please sign in to comment.