diff --git a/.circleci/config.yml b/.circleci/config.yml index a6cbcd3a880..d8e70df5ab8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,101 +33,6 @@ commands: - ~/.cache/ jobs: - snyk-scan: - docker: - - image: cimg/python:3.10 - steps: - - attach_workspace: - at: ~/project - - checkout - - platform-helpers-general/step-load-dependencies - - platform-helpers-general/step-run-snyk-monitor: - scan-all-projects: true - skip-unresolved: false - run-on-non-main: true - - inclusive-linting: - docker: - - image: cimg/base:current - resource_class: small - steps: - - checkout - - run: bash ./scripts/inclusive-lint.sh - - node_build_checks: - docker: - - image: cimg/node:14.21.3-browsers - resource_class: large - environment: - NODE_OPTIONS: '--max_old_space_size=3584' - steps: - - checkout - - install-deps - - run: - name: Lint - command: yarn lint-all - - run: - name: Build - command: yarn build - - run: - name: Run checks - command: ./scripts/yarn-checks-ci.sh - - store_test_results: - path: test_results - - store_artifacts: - path: /tests/cypress/screenshots - - persist_to_workspace: - root: ~/project - paths: - - . - - .git - - nightly_link_checker: - docker: - - image: cimg/node:14.21.3-browsers - resource_class: large - environment: - NODE_OPTIONS: '--max_old_space_size=3584' - steps: - - checkout - - install-deps - - run: - name: Run script and capture logs - command: yarn build - - run: - name: Run link checker - command: yarn broken-link-checker:external 2>&1 | tee output.txt || true - - run: - name: Extract URLs from log - command: | - grep -o 'Link: https\?://[^[:space:]]*' output.txt | sed 's/Link: //' > urls.txt - cat urls.txt - when: always - - run: - name: Remove False Positives - command: | - comm -23 <(sort urls.txt | uniq) <(sort falsepos.txt | uniq) > broken_external_urls.txt - - run: - name: Print urls to log - command: | - cat broken_external_urls.txt - - run: - name: Send failure email if broken URLs found - when: on_success - command: | - broken_urls=$(comm -23 <(sort urls.txt | uniq) <(sort falsepos.txt | uniq)) - broken_urls=$(echo "$broken_urls" | sed 's/ /\n/g') - formatted_broken_urls=$(echo "$broken_urls" | awk '{printf "%s
\n", $0, $0}') - - if [ -n "$broken_urls" ]; then - curl --location --request POST 'https://www.cinotify.cc/api/notify' \ - -d "to=${NOTIFY_EMAIL}&subject=BROKEN URLS DETECTED: Dev Docs Nightly Job&type=text/html&body=

- Nightly link checker job complete. See the list of broken URLs below.

- Click here - to see job details.
-

List of broken URLs:

$formatted_broken_urls" - fi - netlify_manual: docker: - image: cimg/node:14.21.3-browsers @@ -136,6 +41,8 @@ jobs: - run: name: Has secrets? command: | + NETLIFY_AUTH_TOKEN="$NETLIFY_AUTH_TOKEN_2" + NETLIFY_SITE_ID="$NETLIFY_SITE_ID_2" if [ -z "$NETLIFY_AUTH_TOKEN" ] || [ -z "$NETLIFY_SITE_ID" ]; then echo "Missing required secrets." exit 1 @@ -145,113 +52,34 @@ jobs: - run: name: Build preview command: | + # mkdir -p packages/@okta/vuepress-site/dist + # pushd packages/@okta/vuepress-site/dist + # echo hi>readme.md + # popd yarn build - - run: - name: Install Netlify CLI - command: | - npm install netlify-cli@17.23.5 -g - - run: - name: Deploy preview to Netlify - command: | - netlify deploy --alias=preview-${CIRCLE_PULL_REQUEST##*/} --filter @okta/vuepress-site - - run: - name: Log preview link - command: | - if [ -n "$CIRCLE_PULL_REQUEST" ]; then - PR_NUMBER="${CIRCLE_PULL_REQUEST##*/}" - echo "Preview link:" - echo "https://preview-${PR_NUMBER}--reverent-murdock-829d24.netlify.app" - else - echo "No pull request detected. Preview link not available." - fi + - persist_to_workspace: + root: packages/@okta/vuepress-site/dist + paths: + - . - netlify_manual_with_redirects: + netlify_publish: docker: - - image: cimg/node:14.21.3-browsers + - image: cimg/node:18.20.0-browsers resource_class: xlarge steps: + - attach_workspace: + at: packages/@okta/vuepress-site/dist - run: - name: Has secrets? - command: | - if [ -z "$NETLIFY_AUTH_TOKEN" ] || [ -z "$NETLIFY_SITE_ID" ]; then - echo "Missing required secrets." - exit 1 - fi - - checkout - - install-deps - - run: - name: Build preview - command: | - yarn build-with-redirect - - run: - name: Install Netlify CLI - command: | - npm install netlify-cli@17.23.5 -g - - run: - name: Deploy preview to Netlify - command: | - netlify deploy --alias=preview-${CIRCLE_PULL_REQUEST##*/} --filter @okta/vuepress-site - - run: - name: Log preview link command: | - if [ -n "$CIRCLE_PULL_REQUEST" ]; then - PR_NUMBER="${CIRCLE_PULL_REQUEST##*/}" - echo "Preview link:" - echo "https://preview-${PR_NUMBER}--reverent-murdock-829d24.netlify.app" - else - echo "No pull request detected. Preview link not available." - fi - + npm install --save-dev netlify-cli@24.0.1 + npx netlify deploy --no-build --alias=preview-${CIRCLE_PULL_REQUEST##*/} --filter @okta/vuepress-site --dir=packages/@okta/vuepress-site/dist workflows: - linting: - when: - and: - - not: << pipeline.parameters.preview >> - - not: << pipeline.parameters.preview_with_redirect >> - jobs: - - inclusive-linting: - name: "Inclusive Linting" - - build_checks: - when: - and: - - not: << pipeline.parameters.preview >> - - not: << pipeline.parameters.preview_with_redirect >> - jobs: - - node_build_checks: - name: "Build and Checks" - - snyk-scan: - context: - - static-analysis - name: execute-snyk - requires: - - Build and Checks - filters: - branches: - only: - - master - - nightly: - triggers: - - schedule: - cron: "1 5 * * *" - filters: - branches: - only: - - master - jobs: - - nightly_link_checker: - name: "Nightly Link Checker" - - netlify_manual: + wf_netlify_manual: when: << pipeline.parameters.preview >> jobs: - - netlify_manual: - name: "Netlify Manual" + - netlify_manual + - netlify_publish: + requires: + - netlify_manual - netlify_manual_with_redirects: - when: << pipeline.parameters.preview_with_redirect >> - jobs: - - netlify_manual_with_redirects: - name: "Netlify Manual With Redirects" diff --git a/packages/@okta/vuepress-site/code/.gitignore b/packages/@okta/vuepress-site/code/.gitignore new file mode 100644 index 00000000000..e985853ed84 --- /dev/null +++ b/packages/@okta/vuepress-site/code/.gitignore @@ -0,0 +1 @@ +.vercel