Skip to content

Commit

Permalink
Merge branch 'master' of github.com:spectrocloud/librarium into docum…
Browse files Browse the repository at this point in the history
…ent-oidc-options-for-spectro-vm-dashboard-pem-2283
  • Loading branch information
ritawatson committed Sep 27, 2023
2 parents 3ff4413 + c57e0b2 commit 90482e1
Show file tree
Hide file tree
Showing 263 changed files with 52,458 additions and 35,760 deletions.
2 changes: 1 addition & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"repoName": "librarium",
"editor": "code",

"targetBranchChoices": ["master", "version-4-0", "version-3-4", "version-3-3"],
"targetBranchChoices": ["master", "version-4-0", "version-3-4"],

"autoMerge": true,
"autoMergeMethod": "squash",
Expand Down
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ README.md
CHANGES
.gitignore
.cache
prow/
prow/
.env
11 changes: 7 additions & 4 deletions .github/workflows/aloglia_crawler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ name: Algolia Crawler

on:
workflow_run:
workflows: [Release to Production]
workflows: ["Release to Production"]
types: [completed]
jobs:
docsearch:
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Run scraper
env:
APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }}
Expand All @@ -25,4 +28,4 @@ jobs:
SLACK_USERNAME: "spectromate"
SLACK_ICON_EMOJI: ":robot_panic:"
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: 'The Docs Algolia crawler cron job failed. Please check the GitHub Actions logs for more details.'
SLACK_MESSAGE: 'The Docs Algolia crawler job failed. Please check the GitHub Actions logs for more details.'
17 changes: 15 additions & 2 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,23 @@ jobs:
|| (github.event.action == 'closed')
)
steps:

- name: Retrieve Credentials
id: import-secrets
uses: hashicorp/[email protected]
with:
url: https://vault.prism.spectrocloud.com
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: /providers/github/organizations/spectrocloud/token?org_name=spectrocloud token | VAULT_GITHUB_TOKEN

- name: Backport Action
uses: sqren/backport-github-action@v8.9.3
uses: sqren/backport-github-action@v9.3.0-a
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# We are using a PAT token through our Vault Operator to address the issue of PRs workflows not being triggered
# Refer to issue https://github.com/sqren/backport-github-action/issues/79 for more details.
github_token: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }}
auto_backport_label_prefix: backport-
add_original_reviewers: true

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/eslint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
build:
name: Build
needs: [run-ci]
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout Repository
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/image_optimizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
image-optimizer:
name: Image Optimization
needs: [run-ci]
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout Repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packs-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- name: Retrieve Credentials
id: import-secrets
uses: hashicorp/vault-action@v2
uses: hashicorp/vault-action@v2.7.3
with:
url: https://vault.prism.spectrocloud.com
method: approle
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Pre-merge Checks
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches-ignore: [ 'version-*' ]

concurrency:
group: ci-${{ github.ref }}
Expand Down Expand Up @@ -55,8 +56,9 @@ jobs:
build:
name: Build
needs: [run-ci]
runs-on: ubuntu-latest
# runs-on: [self-hosted, linux, x64]
runs-on:
group: Default
labels: docbot
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout Repository
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_SEARCH_KEY: ${{ secrets.ALGOLIA_SEARCH_KEY }}
# The GATSBY_FULLSTORY_ORGID is removed so that preview builds don't get recorded in FullStory


concurrency:
group: preview-${{ github.ref }}
Expand All @@ -25,7 +25,9 @@ concurrency:
jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot

steps:
- name: Check out repository
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Release to Production

# Run this workflow every time a new commit is pushed to the master branch
# or a version branch (e.g. version-4-0)

on:
push:
branches: [master]
branches: ['master', 'version-**']
workflow_dispatch:


env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -16,13 +21,24 @@ env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_SEARCH_KEY: ${{ secrets.ALGOLIA_SEARCH_KEY }}


concurrency:
group: production-${{ github.workflow }}
cancel-in-progress: true

jobs:
build:
name: Build Website
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "master"


- name: Setup Node.js environment
uses: actions/setup-node@v3
Expand All @@ -34,6 +50,7 @@ jobs:

- name: Compile
run: |
make versions-ci
make build
- name: Upload to AWS
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/url-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ concurrency:
name: Broken URL check
jobs:
markdown-link-check:
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot
steps:
- id: checkout
name: Checkout Repository
Expand Down
45 changes: 39 additions & 6 deletions .github/workflows/version-branch-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ name: Version Branch Update
on:
pull_request:
branches:
- 'backport/version-*'
- 'version-[0-9]-[0-9]'
types: [opened, synchronize, reopened]
workflow_dispatch:



concurrency:
Expand All @@ -22,16 +24,21 @@ env:
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_SEARCH_KEY: ${{ secrets.ALGOLIA_SEARCH_KEY }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}


jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on:
group: Default
labels: docbot


steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4



Expand All @@ -41,10 +48,36 @@ jobs:
node-version: '18'
cache: 'npm'


- run: npm ci


- name: Build
- name: Post Netlify progress
uses: mshick/add-pr-comment@v2
with:
message: |
🤖 Starting the Netlify preview build for commit ${{ github.sha }}. This may take a few minutes.
refresh-message-position: true

- name: Netlify Build
run: |
make build
netlify build --context deploy-preview
- name: Deploy to Netlify
id: netlify
uses: nwtgck/[email protected]
with:
publish-dir: ./build
deploy-message: 'Manual Netlify deployment from GitHub Actions - ${{ github.sha }}'
enable-pull-request-comment: true
overwrites-pull-request-comment: true
enable-commit-comment: true

- name: Post Netlify URL
uses: mshick/add-pr-comment@v2
with:
message: |
🚀 Netlify preview deployed succesfully for commit ${{ github.sha }}. Click [here](${{steps.netlify.outputs.deploy-url}}) to preview the changes.
message-failure: |
👎 Uh oh! The Netlify Preview failed to deploy for commit ${{ github.sha }}. Please check the Netlify logs for more information.
refresh-message-position: true
update-only: true
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ palette-docs.pdf

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

# Versions Content
versions.json
versioned_docs/
versioned_sidebars/
versioned_sidebars/*
temp.docusaurus.config.js
staging_docs/
staging_sidebars/
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

./scripts/check-branch.sh
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ RUN apk add util-linux && \
chmod +x /entry.sh && \
mkdir .cache && \
npm ci && \
chown -R node:node /librarium
chown -R node:node /librarium && \
echo -e "ALGOLIA_APP_ID=1234567890\nALGOLIA_SEARCH_KEY=1234567890" > .env

EXPOSE 9000
USER node
Expand Down
32 changes: 29 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@ 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)

TEMP_DIR=$(shell $TMPDIR)

help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[0m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)


initialize: ## Initialize the repository dependencies
@echo "initializing npm dependencies"
npm ci
touch .env
npx husky-init

clean: ## Clean build artifacts
rm -rf node_modules build public .cache .docusaurus
docker image rm $(IMAGE)
docker image rm $(IMAGE) || echo "No image exists."

##@ npm Targets

initialize: ## Initialize npm dependencies
init: ## Initialize npm dependencies
@echo "initializing npm dependencies"
npm ci
npx husky install

start: ## Start a local development server
npm run start
Expand All @@ -26,6 +36,15 @@ build: ## Run npm build
rm -rf build
npm run build

versions: ## Create Docusarus content versions
@echo "creating versions"
./scripts/versions.sh $(TMPDIR)


versions-ci: ## Create Docusarus content versions in a GitHub Actions CI environment
@echo "creating versions"
./scripts/versions.sh $$RUNNER_TEMP

##@ Git Targets

commit: ## Add a Git commit. Usage: make commit MESSAGE="<your message here>"
Expand All @@ -43,15 +62,22 @@ docker-start: docker-image ## Start a local development container
docker run --rm -it -v $(CURDIR)/docs:/librarium/docs/ -p 9000:9000 $(IMAGE)


##@ Writing Checks

sync-vale: ## Install Vale plugins
vale sync

check-writing: ## Run Vale lint checks
vale $(CHANGED_FILE)


##@ Clean Server Artifacts

fix-server: ## Fix server issues by removing the cache folder and reinstalling node modules
@echo "fixing server"
rm -rfv node_modules && rm -rfv .cache/ && npm ci
rm -rfv node_modules && npm ci && npm run clear

###@ PDF Generation

pdf: ## Generate PDF from docs
@echo "generating pdf"
Expand Down
Loading

0 comments on commit 90482e1

Please sign in to comment.