Skip to content

Commit

Permalink
archive(8.2) isolation: pt 2, reviewable steps (#4626)
Browse files Browse the repository at this point in the history
* chore: update version archival process to account for infrastructure changes (not in main yet; #4624)

* archiving(8.2): exclude all other versions from the main version file

* chore: update version numbers for isolation

* archiving(8.2): exclude all other versions from the optimize version file

* archiving(8.2): prevent unsupported site from being crawled

* archiving(8.2): fix Dockerfile for local debugging

* archiving(8.2): update theme components

* archiving(8.2): update CI workflows

* archiving(8.2): update docusaurus config

* archiving(8.2): configure Optimize docs instance

* archiving(8.2): correct a bunch of cross-version links

* archiving(8.2): remove nonexistent link in nav

* archiving(8.2): fix or remove bad links

* archiving(8.2): correct one more broken link

* archiving(8.2): remove all redirect rules except 8.2

* archiving(8.2): adjust redirect rules based on application environment
  • Loading branch information
pepopowitz authored Nov 20, 2024
1 parent cf52721 commit 48fcb8f
Show file tree
Hide file tree
Showing 59 changed files with 870 additions and 1,715 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,3 @@ jobs:
run: npm run build
env:
NODE_OPTIONS: --max_old_space_size=8192
- name: Remove https redirect
run: |
sed -i '/SERVER_PORT/d;/SERVER_NAME/d' build/.htaccess
- name: Run web server
run: |
docker run -d --name webserver -v "$PWD/build":/app -p 8888:8080 bitnami/apache:2.4.54
echo "container_ip=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' webserver)" >> $GITHUB_ENV
- name: Download sitemap from production
run: curl -sL https://docs.camunda.io/sitemap.xml | grep -oP '<loc>\K.*?(?=</loc>)' | sed "s!https://docs.camunda.io!http://${{ env.container_ip }}:8080!g" > sitemap.prod.txt
- name: Prepare product links
run: grep 'https://docs.camunda.io' product-links.txt | sed "s!https://docs.camunda.io!http://${{ env.container_ip }}:8080!g" > product-links.prod.txt
- name: Waiting for URL available
uses: nev7n/wait_for_response@v1
with:
url: "http://${{ env.container_ip }}:8080/"
- name: Validate sitemap links
uses: lycheeverse/lychee-action@v1.6.1
with:
args: "sitemap.prod.txt"
fail: true
- name: Validate product links
uses: lycheeverse/lychee-action@v1.6.1
with:
args: "product-links.prod.txt"
fail: true
- name: Check internal links
uses: untitaker/hyperlink@0.1.27
with:
args: build/
15 changes: 4 additions & 11 deletions .github/workflows/publish-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@ name: publish-prod
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "!0.25.[0-9]+"
- "!0.26.[0-9]+"
- "!1.0.[0-9]+"
- "!1.1.[0-9]+"
- "!1.2.[0-9]+"
- "!1.3.[0-9]+"
- "!8.0.[0-9]+"
- "!8.1.[0-9]+"
- "!8.2.[0-9]+"
- "8.2.[0-9]+"

permissions:
id-token: write
Expand All @@ -33,6 +24,8 @@ jobs:
run: npm run build
env:
NODE_OPTIONS: --max_old_space_size=8192
DOCS_SITE_URL: https://unsupported.docs.camunda.io
DOCS_SITE_BASE_URL: /8.2/
- name: Get Github Actions IP
id: ip
uses: haythem/public-ip@v1.3
Expand All @@ -48,7 +41,7 @@ jobs:
with:
switches: -avzr --delete
path: build/
remote_path: ${{ secrets.AWS_PROD_PUBLISH_PATH }}
remote_path: ${{ secrets.AWS_PROD_PUBLISH_PATH_UNSUPPORTED }}/8.2
remote_host: ${{ secrets.AWS_PROD_PUBLISH_HOST }}
remote_user: ${{ secrets.AWS_PROD_PUBLISH_USER }}
# vvvvv Intentionally missing the AWS_ prefix vvvvv
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: publish-stage
on:
push:
branches:
- "main"
- "unsupported/8.2"
tags-ignore:
- "*"

Expand All @@ -22,14 +22,14 @@ jobs:
run: npm ci
- name: Cache Docusaurus
uses: ./.github/actions/docusaurus-cache
- name: Update URL
run: 'sed -i ''s!url: "https://docs.camunda.io"!url: "https://stage.docs.camunda.io"!g'' docusaurus.config.js'
- name: Update redirects for environment
run: "sed -i 's!https://unsupported.docs.camunda.io!https://stage.unsupported.docs.camunda.io!g' ./static/.htaccess"
- name: Build
run: npm run build
env:
NODE_OPTIONS: --max_old_space_size=8192
DOCS_SITE_URL: https://stage.unsupported.docs.camunda.io
DOCS_SITE_BASE_URL: /8.2/
- name: Get Github Actions IP
id: ip
uses: haythem/public-ip@v1.3
Expand All @@ -45,7 +45,7 @@ jobs:
with:
switches: -avzr --delete
path: build/
remote_path: ${{ secrets.AWS_STAGE_PUBLISH_PATH }}
remote_path: ${{ secrets.AWS_STAGE_PUBLISH_PATH_UNSUPPORTED }}/8.2
remote_host: ${{ secrets.AWS_STAGE_PUBLISH_HOST }}
remote_user: ${{ secrets.AWS_STAGE_PUBLISH_USER }}
# vvvvv Intentionally missing the AWS_ prefix vvvvv
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
FROM httpd:alpine

RUN rm -r /usr/local/apache2/htdocs/*
COPY /build /usr/local/apache2/htdocs/
COPY /build /usr/local/apache2/htdocs/8.2/

# Remove SSL requirement
RUN sed -i \
'/SERVER_PORT/d;/SERVER_NAME/d' \
/usr/local/apache2/htdocs/.htaccess
/usr/local/apache2/htdocs/8.2/.htaccess

# Enable the rewrite module
RUN sed -i \
Expand Down
108 changes: 28 additions & 80 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ const { unsupportedVersions } = require("./src/versions");

const latestVersion = require("./src/versions").versionMappings[0].docsVersion;

const docsSiteUrl =
process.env.DOCS_SITE_URL || "https://unsupported.docs.camunda.io";

module.exports = {
title: "Camunda 8 Docs",
tagline:
"Start orchestrating your processes with Camunda 8 SaaS or Self-Managed.",
// url: "https://camunda-cloud.github.io",
url: process.env.DOCS_SITE_URL || "https://docs.camunda.io",
url: docsSiteUrl,
// baseUrl: "/camunda-cloud-documentation/",
baseUrl: process.env.DOCS_SITE_BASE_URL || "/",
customFields: {
canonicalUrlRoot: "https://docs.camunda.io",
canonicalUrlRoot: docsSiteUrl,
},
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
Expand Down Expand Up @@ -41,23 +44,14 @@ module.exports = {
path: "optimize",
routeBasePath: "optimize",
beforeDefaultRemarkPlugins: [versionedLinks],
sidebarPath: require.resolve("./optimize_sidebars.js"),
editUrl: "https://github.com/camunda/camunda-docs/edit/main/",
lastVersion: "3.10.0",
includeCurrentVersion: false,
versions: {
"3.14.0": {
label: "8.6 / 3.14.0",
},
"3.13.0": {
label: "8.5 / 3.13.0",
banner: "none",
},
"3.12.0": {
label: "8.4 / 3.12.0",
banner: "none",
},
"3.11.0": {
label: "8.3 / 3.11.0",
banner: "none",
"3.10.0": {
label: "3.10.0",
path: "/",
noIndex: true,
banner: "unmaintained",
},
},
},
Expand Down Expand Up @@ -177,10 +171,10 @@ module.exports = {
announcementBar: {
id: "camunda8",
content:
'📣 <b><a target="_blank" rel="noopener noreferrer" href="https://signup.camunda.com/accounts?utm_source=docs.camunda.io&utm_medium=referral&utm_content=banner">Sign up</a></b> for a free account to start orchestrating your business processes today.',
backgroundColor: "#14D890",
textColor: "#000",
isCloseable: true,
'🚨 This version of Camunda 8 is no longer actively maintained. For up-to-date documentation, see <b><a target="_blank" rel="noopener noreferrer" href="https://docs.camunda.io">the latest version</a></b>.',
backgroundColor: "#FFC600",
textColor: "#434343",
isCloseable: false,
},

prism: {
Expand All @@ -194,23 +188,8 @@ module.exports = {
},
items: [
{
type: "docsVersionDropdown",
type: "docsVersion",
position: "left",
dropdownItemsAfter: [
{
type: "html",
value: '<hr class="dropdown-separator">',
},
{
type: "html",
className: "dropdown-unsupported-versions",
value: "<b>Unsupported versions</b>",
},
...unsupportedVersions.map((version) => ({
label: version.label,
href: `https://unsupported.docs.camunda.io/${version.urlSuffix}/`,
})),
],
},
{
type: "doc",
Expand Down Expand Up @@ -259,13 +238,9 @@ module.exports = {
label: "How to use our docs",
to: "meta",
},
{
label: "Camunda Help Center",
to: "docs/reference/camunda-help-center",
},
{
label: "Try free",
href: "https://signup.camunda.com/accounts?utm_source=docs.camunda.io&utm_medium=referral&utm_content=footer",
href: "https://signup.camunda.com/accounts?utm_source=unsupported.docs.camunda.io&utm_medium=referral&utm_content=footer",
},
{
label: "Contact",
Expand All @@ -277,7 +252,7 @@ module.exports = {
title: "Community",
items: [
{
html: `<a href="https://twitter.com/camunda" target="_blank" rel="noreferrer noopener"><img src= "/img/twitter.svg" alt="Camunda on Twitter" class="footer-logos" /></a> <a href="https://github.com/camunda" target="_blank" rel="noreferrer noopener"><img src= "/img/github-mark-white.svg" alt="Camunda on GitHub" class="footer-logos" /></a>`,
html: `<a href="https://twitter.com/camunda" target="_blank" rel="noreferrer noopener"><img src="/8.2/img/twitter.svg" alt="Camunda on Twitter" class="footer-logos" /></a> <a href="https://github.com/camunda" target="_blank" rel="noreferrer noopener"><img src="/8.2/img/github-mark-white.svg" alt="Camunda on GitHub" class="footer-logos" /></a>`,
},
{
label: "Forum",
Expand Down Expand Up @@ -341,12 +316,6 @@ module.exports = {
],
copyright: `Copyright © ${new Date().getFullYear()} Camunda`,
},
algolia: {
// These keys are for our new standalone algolia instance!
apiKey: "d701d38126d1a43866047d3ab97680d1",
appId: "6KYF3VMCXZ",
indexName: "camunda",
},
languageTabs: [
{
highlight: "bash",
Expand Down Expand Up @@ -408,46 +377,25 @@ module.exports = {
"@docusaurus/preset-classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
editUrl: "https://github.com/camunda/camunda-docs/edit/main/",
lastVersion: "8.2",
includeCurrentVersion: false,
beforeDefaultRemarkPlugins: [versionedLinks],
// 👋 When cutting a new version, remove the banner for maintained versions by adding an entry. Remove the entry to versions >18 months old.
versions: {
8.5: {
banner: "none",
},
8.4: {
banner: "none",
},
8.3: {
banner: "none",
8.2: {
label: "8.2",
path: "/",
noIndex: true,
banner: "unmaintained",
},
},
docLayoutComponent: "@theme/DocPage",
docItemComponent: "@theme/ApiItem",
},
blog: false,
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
sitemap: {
changefreq: "weekly",
priority: 0.5,
ignorePatterns: [
"/docs/**/assets/**",
"/docs/**/tags/**",
"/docs/next/**",
"/docs/8.2/**",
"/docs/8.3/**",
"/docs/8.4/**",
"/docs/8.5/**",
"/optimize/3.10.0/**",
"/optimize/3.11.0/**",
"/optimize/3.12.0/**",
"/optimize/3.13.0/**",
"/optimize/next/**",
],
// exclude everything from sitemap
ignorePatterns: ["**"],
},
},
],
Expand Down
17 changes: 11 additions & 6 deletions hacks/isolateVersion/6-updateCIWorkflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,29 @@ sed -i '' "/tags:/a\\
- \"$ARCHIVED_VERSION.[0-9]+\"
" .github/workflows/publish-prod.yaml

# c. replace the main docs remote_path with this isolated version's remote_path.
# c. add `unsupported.` to docs URLs
sed -i '' 's/https:\/\/docs.camunda.io/https:\/\/unsupported.docs.camunda.io/' .github/workflows/publish-prod.yaml

# d. replace the main docs remote_path with this isolated version's remote_path.
sed -i '' "s/remote_path: \${{ secrets.AWS_PROD_PUBLISH_PATH }}/remote_path: \${{ secrets.AWS_PROD_PUBLISH_PATH_UNSUPPORTED }}\/$ARCHIVED_VERSION/g" .github/workflows/publish-prod.yaml

# e. update `DOCS_SITE_BASE_URL` to specify isolated version
sed -i '' "s/DOCS_SITE_BASE_URL: \//DOCS_SITE_BASE_URL: \/$ARCHIVED_VERSION\//" .github/workflows/publish-prod.yaml

# 3. publish-stage:
sed -i '' '/Disable Indexing/{N; d;}' .github/workflows/publish-stage.yaml

# a. replace `branches: - main` with `branches: - unsupported/{version}`
sed -i '' "s/- \"main\"/- \"unsupported\/$ARCHIVED_VERSION\"/" .github/workflows/publish-stage.yaml

# b. remove `disable indexing` step

# c. add `unsupported.` to docs URLs
# b. add `unsupported.` to docs URLs
sed -i '' 's/https:\/\/docs.camunda.io/https:\/\/unsupported.docs.camunda.io/' .github/workflows/publish-stage.yaml
sed -i '' 's/https:\/\/stage.docs.camunda.io/https:\/\/stage.unsupported.docs.camunda.io/' .github/workflows/publish-stage.yaml

# d. replace `${{ secrets.AWS_STAGE_PUBLISH_PATH }}` with `${{ secrets.AWS_STAGE_PUBLISH_PATH_UNSUPPORTED }}/{version}`
# c. replace `${{ secrets.AWS_STAGE_PUBLISH_PATH }}` with `${{ secrets.AWS_STAGE_PUBLISH_PATH_UNSUPPORTED }}/{version}`
sed -i '' "s/remote_path: \${{ secrets.AWS_STAGE_PUBLISH_PATH }}/remote_path: \${{ secrets.AWS_STAGE_PUBLISH_PATH_UNSUPPORTED }}\/$ARCHIVED_VERSION/g" .github/workflows/publish-stage.yaml

# d. update `DOCS_SITE_BASE_URL` to specify isolated version
sed -i '' "s/DOCS_SITE_BASE_URL: \//DOCS_SITE_BASE_URL: \/$ARCHIVED_VERSION\//" .github/workflows/publish-stage.yaml

git add .github/workflows
git commit -m "archiving($ARCHIVED_VERSION): update CI workflows"
3 changes: 0 additions & 3 deletions hacks/isolateVersion/7-updateDocusaurusConfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ notify "Updating docusaurus.config.js..."
# Update `url` to include `unsupported`
sed -i '' "s/docs.camunda.io/unsupported.docs.camunda.io/" docusaurus.config.js

# Update `baseUrl` to specify isolated version
sed -i '' "s/baseUrl: \"\\/\"/baseUrl: \"\/$ARCHIVED_VERSION\/\"/" docusaurus.config.js

# Update footer social icons based on the new baseUrl
sed -i '' "s/src= \"\/img\//src=\"\/$ARCHIVED_VERSION\/img\//g" docusaurus.config.js

Expand Down
4 changes: 2 additions & 2 deletions hacks/isolateVersion/allSteps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -e # exit at first error

# Before running this script make sure these versions are correct!
ARCHIVED_VERSION="8.1"
ARCHIVED_OPTIMIZE_VERSION="3.9.0"
ARCHIVED_VERSION="8.2"
ARCHIVED_OPTIMIZE_VERSION="3.10.0"

GREEN='\033[0;32m'
YELLOW='\033[0;33m'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Settings for webhooks which can receive custom alert notifications. You can conf
Settings for automatic cleanup of historic process/decision instances based on their end time.

:::note
Two types of history cleanup are available for Camunda 8 users at this time - process data cleanup and external variable cleanup. For more information, see [History cleanup](/optimize/self-managed/optimize-deployment/configuration/history-cleanup.md).
Two types of history cleanup are available for Camunda 8 users at this time - process data cleanup and external variable cleanup. For more information, see [History cleanup](/self-managed/optimize-deployment/configuration/history-cleanup.md).
:::

| YAML Path | Default Value | Description |
Expand Down
Loading

0 comments on commit 48fcb8f

Please sign in to comment.