Skip to content

Commit

Permalink
Merge branch 'master' into PLT-1117
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-cardenas-coding committed Apr 29, 2024
2 parents 609e1a8 + 1891b0d commit e0f1748
Show file tree
Hide file tree
Showing 289 changed files with 437,724 additions and 87,970 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/aloglia_crawler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ on:
workflow_run:
workflows: ["Release to Production"]
types: [completed]
workflow_dispatch:

env:
ALGOLIA_CRAWLER_USER_ID: ${{ secrets.ALGOLIA_CRAWLER_V3_USER_ID }}
ALGOLIA_CRAWLER_API_KEY: ${{ secrets.ALGOLIA_CRAWLER_V3_API_KEY }}
CRAWLER_ID: ${{ secrets.ALGOLIA_CRAWLER_V3_ID }}

jobs:
docsearch:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -18,6 +25,11 @@ jobs:
API_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
run: docker run -e APPLICATION_ID=$APPLICATION_ID -e API_KEY=$API_KEY -e "CONFIG=$(cat ./docsearch.config.json | jq -r tostring)" algolia/docsearch-scraper

- name: Trigger DocSearch v3 Crawler
run: |
curl -H "Content-Type: application/json" -X POST --user ${ALGOLIA_CRAWLER_USER_ID}:${ALGOLIA_CRAWLER_API_KEY} "https://crawler.algolia.com/api/1/crawlers/${CRAWLER_ID}/reindex"
- name: Slack Notification
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly-docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- cron: '15 22 * * 1-5' # 22:15 UTC, Monday through Friday
workflow_dispatch:


env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# We cannot use our production values for nightly Docker builds as that would leak our production secrets.
Expand All @@ -28,6 +29,7 @@ jobs:

- name: Compile
run: |
touch .env
make build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:

- name: Build
run: |
touch .env
make build
- name: Deploy Preview
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:

- name: Compile
run: |
touch .env
make versions-ci
make build
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ palette-docs.pdf

docs/api-content/api-docs/v1/*.mdx
docs/api-content/api-docs/v1/sidebar.*
docs/api-content/api-docs/edge-v1/*.mdx
docs/api-content/api-docs/edge-v1/sidebar.*

# Versions Content
versions.json
Expand Down
7 changes: 7 additions & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,10 @@ fd60bdc4fdfe8b66925db07865cb530eab4978df:docs/docs-content/integrations/kubernet
511e735952ff4babb08c522a7febdd856740c3f9:docs/docs-content/vertex/system-management/reverse-proxy.md:private-key:141
511e735952ff4babb08c522a7febdd856740c3f9:docs/docs-content/vertex/system-management/reverse-proxy.md:private-key:167
511e735952ff4babb08c522a7febdd856740c3f9:docs/docs-content/vertex/system-management/reverse-proxy.md:private-key:239
9e62b4b635976b0ab93d4dddcf29d33365664091:docs/docs-content/integrations/kubernetes.md:generic-api-key:391
9e62b4b635976b0ab93d4dddcf29d33365664091:docs/docs-content/integrations/kubernetes.md:generic-api-key:759
9e62b4b635976b0ab93d4dddcf29d33365664091:docs/docs-content/integrations/kubernetes.md:generic-api-key:1125
e4040084011d4d7935a589959b96ebc5cfba7a94:docs/docs-content/integrations/kubernetes.md:generic-api-key:759
e4040084011d4d7935a589959b96ebc5cfba7a94:docs/docs-content/integrations/kubernetes.md:generic-api-key:1125
e4040084011d4d7935a589959b96ebc5cfba7a94:docs/docs-content/integrations/kubernetes.md:generic-api-key:391
87bf9f7353f94ac2ecf85da3be3412202de7b72f:docusaurus.config.js:generic-api-key:363
58 changes: 48 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.PHONY: initialize start commit build

-include .env

IMAGE:=spectrocloud/librarium
# Retrieve all modified files in the content folder and compare the difference between the master branch git tree blob AND this commit's git tree blob
CHANGED_FILE=$(shell git diff-tree -r --no-commit-id --name-only master HEAD | grep content)
Expand All @@ -8,6 +10,7 @@ TEMP_DIR=$(shell $TMPDIR)

CPUS := $(shell sysctl -n hw.ncpu | awk '{print int($$1 / 2)}')

ALOGLIA_CONFIG=$(shell cat docsearch.dev.config.json | jq -r tostring)


help: ## Display this help
Expand Down Expand Up @@ -39,7 +42,7 @@ clean-api: ## Clean API docs
@echo "cleaning api docs"
npm run clean-api-docs
# Remove the sidebar file as it's not removed by the clean-api command
rm -f docs/api-content/api-docs/v1/sidebar.ts
rm -f docs/api-content/api-docs/v1/sidebar.ts && rm -f docs/api-content/api-docs/edge-v1/sidebar.ts

clean-visuals:
@echo "Cleaning visual regression tests"
Expand Down Expand Up @@ -156,21 +159,56 @@ pdf-local: ## Generate PDF from local docs

###@ URL Checks

verify-url-links: ## Check for broken URLs in production
verify-url-links:
@echo "Checking for broken external URLs in markdown files..."
rm link_report.csv || echo "No report exists. Proceeding to scan step"
npx linkinator https://docs.spectrocloud.com/ --recurse --timeout 60000 --retry --retry-errors-count 3 --skip "^http(?!.*spectrocloud\\.com).*$"" --skip "^https:\/\/docs\.spectrocloud\.com\/.*\/supplemental\-packs$"" --format csv > temp_report.csv && sleep 2
grep -E '^[^,]*,[[:space:]]*([4-9][0-9]{2}|[0-9]{4,}),' temp_report.csv > link_report.csv && rm temp_report.csv

@npx linkinator "docs/**/*.md" --markdown --recurse --timeout 60000 --retry --retry-errors-jitter --retry-errors-count 3 \
--skip "^https:\/\/docs\.spectrocloud\.com.*$$" \
--skip "^https:\/\/docs\.spectrocloud\.com\/.*\/supplemental\-packs$$" \
--skip "^http:\/\/docs\.spectrocloud\.com.*$$" \
--skip "^https:\/\/software-private\.spectrocloud\.com.*$$" \
--skip "^\/.*\.md$$" \
--skip "!\[.*\]\(.*\)$$" \
--skip "\.(jpg|jpeg|png|gif|webp)$$" \
--skip "https:\/\/linux\.die\.net\/man\/.*$$" \
--skip "https:\/\/mysql\.com\/.*\.*$$" \
--skip "https:\/\/dev\.mysql\.com\/doc/\.*$$" \
--format csv > temp_report.csv && sleep 2
@grep -E 'https?://' temp_report.csv > filtered_report.csv
@grep -E ',[[:space:]]*([4-9][0-9]{2}|[0-9]{4,}),' filtered_report.csv > link_report.csv && rm temp_report.csv filtered_report.csv

verify-url-links-ci: ## Check for broken URLs in production in a GitHub Actions CI environment
@echo "Checking for broken external URLs in CI environment..."
rm link_report.json || echo "No report exists. Proceeding to scan step"
npx linkinator https://docs.spectrocloud.com/ --recurse --timeout 60000 --retry --retry-errors-count 3 --skip '^http(?!.*software-private.spectrocloud\\.com).*$'' --skip '^http(?!.*spectrocloud\\.com).*$'' --format json > temp_report.json
jq 'del(.links[] | select(.status <= 200))' temp_report.json > link_report.json
rm temp_report.json
mv link_report.json scripts/
@npx linkinator "docs/**/*.md" --markdown --recurse --timeout 60000 --retry --retry-errors-count 3 \
--skip "^https:\/\/docs\.spectrocloud\.com.*$$" \
--skip "^https:\/\/docs\.spectrocloud\.com\/.*\/supplemental\-packs$$" \
--skip "^http:\/\/docs\.spectrocloud\.com.*$$" \
--skip "^https:\/\/software-private\.spectrocloud\.com.*$$" \
--skip "^\/.*\.md$$" \
--skip "!\[.*\]\(.*\)$$" \
--skip "\.(jpg|jpeg|png|gif|webp)$$" \
--skip "https:\/\/linux\.die\.net\/man\/.*$$" \
--skip "https:\/\/mysql\.com\/.*\.*$$" \
--skip "https:\/\/dev\.mysql\.com\/doc/\.*$$" \
--format json > temp_report.json
@# Use jq to filter out links that do not start with http or https and keep only broken links
@jq '[.links[] | select(.url | test("^https?://")) | select(.status >= 400)]' temp_report.json > filtered_report.json
@rm temp_report.json
@mv filtered_report.json scripts/link_report.json

###@ Image Formatting

format-images: ## Format images
@echo "formatting images in /static/assets/docs/images/ folder"
./scripts/compress-convert-images.sh
./scripts/compress-convert-images.sh

###@ Aloglia Indexing

update-dev-index: ## Update the Algolia index for the dev environment
@echo "updating Algolia index for dev environment"
docker run -e APPLICATION_ID=${ALGOLIA_APP_ID} -e API_KEY=${ALGOLIA_ADMIN_KEY} -e CONFIG='${ALOGLIA_CONFIG}' algolia/docsearch-scraper

remove-dev-index: ## Remove the Algolia index for the dev environment
@echo "removing Algolia index for dev environment"
algolia index delete dev-docusaurus-librarium --confirm
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,30 @@ To add a video, use the following syntax. Ensure you capitalize the letter "V":
<Video title="vsphere-pcg-creation" src="/cluster-creation-videos/vmware.mp4"></Video>
```
### Badges
The following badges are available for use:
> [!NOTE]
>
> All badges are globally available. No need to import them.
- Technical Preview Badge ![Technical Preview Badge](static/img/tech-preview-light.svg)
![Technical Preview Badge](static/img/tech-preview-dark.svg)
#### Technical Preview Badge
The technical preview badge is used to indicate that a feature is in technical preview. The badge is intended for
release notes in the context of a list. The following is an example of how to use the technical preview badge. The
component will automatically display the badge in the correct color based on the light theme (dark/light).
```markdown
- <TpBadge /> Cluster Profile variables, a new feature that allows you to define variables in a cluster profile. This
feature is in Tech Preview and is available only for Edge clusters. Profile variables allow you to define variable
types, apply validation, and more. Refer to the Cluster Profile Variables documentation to learn more about profile
variables.
```
### Simple Card Grid
This is a custom component that creates a grid of simple text cards with two columns, styled according to our color
Expand Down Expand Up @@ -744,3 +768,7 @@ make clean-versions
>
> The `docusaurus.config.js` file is updated by the [`update_docusaurus_config.js`](./docusaurus.config.js) script. DO
> NOT commit this file with the updated changes.
```
```
12 changes: 12 additions & 0 deletions apisidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ if (fs.existsSync(sidebarFilePath)) {
sidebarItems = require(sidebarFilePath);
}

let emcSidebarItems = [];
const sidebarEmcFilePath = "./docs/api-content/api-docs/edge-v1/sidebar.ts";
if (fs.existsSync(sidebarEmcFilePath)) {
emcSidebarItems = require(sidebarEmcFilePath);
}

module.exports = {
apiSidebar: [
{ type: "doc", id: "introduction", label: "Introduction" },
Expand All @@ -21,5 +27,11 @@ module.exports = {
link: { type: "generated-index", title: "Palette API V1" },
items: sidebarItems,
},
{
type: "category",
label: "Edge Host API V1",
link: { type: "generated-index", title: "Edge Host API V1" },
items: emcSidebarItems,
},
],
};
1 change: 1 addition & 0 deletions archiveVersions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"v4.1.x": "https://version-4-1.legacy.docs.spectrocloud.com",
"v4.0.x": "https://version-4-0.legacy.docs.spectrocloud.com",
"v3.4.x and prior": "https://version-3-4.legacy.docs.spectrocloud.com"
}
Loading

0 comments on commit e0f1748

Please sign in to comment.