diff --git a/.github/workflows/_deploy-production.yml b/.github/workflows/_deploy-production.yml index 679835db5..e1d12741d 100644 --- a/.github/workflows/_deploy-production.yml +++ b/.github/workflows/_deploy-production.yml @@ -31,16 +31,6 @@ jobs: with: fetch-depth: 0 - - name: Checkout werf repo - uses: actions/checkout@v6 - with: - repository: werf/werf - path: werf - fetch-depth: 0 - - - name: Inject trdl_channels.yaml - run: | - cp werf/trdl_channels.yaml .helm/trdl_channels.yaml - name: Install werf uses: werf/actions/install@v2 @@ -86,7 +76,6 @@ jobs: env: WERF_REPO: ghcr.io/${{ github.repository_owner }}/werfio-guides WERF_STAGES_STORAGE: ghcr.io/werf/werfio-guides-stages - WERF_SET_ACTIVE_RELEASE: global.active_release=2 WERFIO_GITHUB_TOKEN: ${{ secrets.API_TOKEN }} WERF_NAMESPACE: "werfio-production" WERF_RELEASE: "werfio-site-production" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cc4c632ee..f9ac5c96d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,21 +1,37 @@ name: Deploy on: + push: + branches: + - chore/docs-major-routing pull_request: types: [labeled, synchronize] workflow_dispatch: + inputs: + targetEnvironment: + description: "Target environment in dev cluster" + required: true + default: test + type: choice + options: + - test + - stage env: WERF_ENV: "production" WERF_REPO: "ghcr.io/${{ github.repository_owner }}/werfio-guides" WERF_STAGES_STORAGE: "ghcr.io/werf/werfio-guides-stages" - WERF_SET_ACTIVE_RELEASE: "global.active_release=2" WERFIO_GITHUB_TOKEN: "${{ secrets.API_TOKEN }}" jobs: converge: name: Deploy - if: contains(github.event.pull_request.labels.*.name, 'test website') || contains(github.event.pull_request.labels.*.name, 'stage website') + if: >- + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'pull_request' && + (contains(github.event.pull_request.labels.*.name, 'test website') || + contains(github.event.pull_request.labels.*.name, 'stage website'))) runs-on: prod-github-runner-0 steps: - name: Checkout code @@ -23,22 +39,14 @@ jobs: with: fetch-depth: 0 - - name: Checkout werf repo - uses: actions/checkout@v6 - with: - repository: werf/werf - path: werf - fetch-depth: 0 - - - name: Inject trdl_channels.yaml - run: | - cp werf/trdl_channels.yaml .helm/trdl_channels.yaml - - name: Install werf uses: werf/actions/install@v2 - name: Deploy to test - if: contains(github.event.pull_request.labels.*.name, 'test website') + if: >- + github.event_name == 'push' || + (github.event_name == 'workflow_dispatch' && github.event.inputs.targetEnvironment == 'test') || + (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'test website')) run: | . $(werf ci-env github --as-file) werf converge @@ -51,7 +59,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Deploy to stage - if: contains(github.event.pull_request.labels.*.name, 'stage website') + if: >- + (github.event_name == 'workflow_dispatch' && github.event.inputs.targetEnvironment == 'stage') || + (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'stage website')) run: | . $(werf ci-env github --as-file) werf converge diff --git a/.helm/templates/12-backend.yaml b/.helm/templates/12-backend.yaml index f8ea6406d..70e46621e 100644 --- a/.helm/templates/12-backend.yaml +++ b/.helm/templates/12-backend.yaml @@ -37,8 +37,12 @@ spec: name: http protocol: TCP env: - - name: ACTIVE_RELEASE - value: {{ .Values.global.active_release | quote }} + - name: CURRENT_DOCS_MAJOR + value: {{ include "docsCurrentMajor" . | quote }} + - name: SUPPORTED_DOCS_MAJOR_VERSIONS + value: {{ include "docsSupportedRootsCSV" . | quote }} + - name: DOCS_LATEST_ALIAS_ENABLED + value: {{ include "docsLatestAliasEnabled" . | quote }} - name: LOG_LEVEL value: "info" {{- if ne .Values.werf.env "production" }} @@ -53,13 +57,6 @@ spec: httpGet: path: /health port: 8080 - volumeMounts: - - name: trdl-data - mountPath: /app/trdl - volumes: - - name: trdl-data - configMap: - name: trdl-data --- apiVersion: v1 kind: Service @@ -96,15 +93,3 @@ spec: selector: matchLabels: service: backend ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: trdl-data -data: - trdl_channels.yaml: | -{{- if eq .Values.werf.env "production" }} -{{ .Files.Get "trdl_channels.yaml" | indent 4 }} -{{- else }} -{{ .Files.Get "trdl_channels-dev.yaml" | indent 4 }} -{{- end }} diff --git a/.helm/templates/_helpers.tpl b/.helm/templates/_helpers.tpl index 17ca01e65..c671f6860 100644 --- a/.helm/templates/_helpers.tpl +++ b/.helm/templates/_helpers.tpl @@ -54,3 +54,56 @@ affinity: {{- end }} {{- end }} +{{- define "docsCurrentMajor" -}} +{{- $current := pluck .Values.werf.env .Values.docsRouting.currentMajor | first | default .Values.docsRouting.currentMajor._default -}} +{{- $current = trim $current -}} +{{- $current = trimPrefix "/docs/" $current -}} +{{- $current = trimAll "/" $current -}} +{{- $current = lower $current -}} +{{- if hasPrefix "v" $current -}} +{{- $current -}} +{{- else -}} +{{- printf "v%s" $current -}} +{{- end -}} +{{- end }} + +{{- define "docsSupportedRootsCSV" -}} +{{- $roots := pluck .Values.werf.env .Values.docsRouting.supportedRoots | first | default .Values.docsRouting.supportedRoots._default -}} +{{- $items := list (include "docsCurrentMajor" .) -}} +{{- range $root := $roots }} + {{- $normalized := trim $root -}} + {{- $normalized = trimPrefix "/docs/" $normalized -}} + {{- $normalized = trimAll "/" $normalized -}} + {{- $normalized = lower $normalized -}} + {{- if and $normalized (regexMatch "^v[0-9]+$" $normalized) (not (has $normalized $items)) -}} + {{- $items = append $items $normalized -}} + {{- end -}} +{{- end -}} +{{- join "," $items -}} +{{- end }} + +{{- define "docsSupportedRootsPattern" -}} +{{- join "|" (splitList "," (include "docsSupportedRootsCSV" .)) -}} +{{- end }} + +{{- define "docsLatestAliasEnabled" -}} +{{- $configured := pluck .Values.werf.env .Values.docsRouting.latestAliasEnabled | first | default .Values.docsRouting.latestAliasEnabled._default | default "auto" -}} +{{- $configured = lower (trim (printf "%v" $configured)) -}} +{{- if or (eq $configured "true") (eq $configured "1") (eq $configured "yes") (eq $configured "on") -}} +true +{{- else if or (eq $configured "false") (eq $configured "0") (eq $configured "no") (eq $configured "off") -}} +false +{{- else if eq (include "docsSupportedRootsCSV" .) "v1" -}} +false +{{- else -}} +true +{{- end -}} +{{- end }} + +{{- define "docsModernStructuredRootsPattern" -}} +{{- $roots := without (splitList "," (include "docsSupportedRootsCSV" .)) "v1" -}} +{{- if gt (len $roots) 0 -}} +{{- join "|" $roots -}} +{{- end -}} +{{- end }} + diff --git a/.helm/templates/_rewrites.tpl b/.helm/templates/_rewrites.tpl index c02fac529..240457acc 100644 --- a/.helm/templates/_rewrites.tpl +++ b/.helm/templates/_rewrites.tpl @@ -1,5 +1,22 @@ # SHOULD BE IN SYNC WITH github.com/werf/werf/docs/.helm/templates/_rewrites.tpl {{- define "rewrites" }} +{{- $currentDocsMajor := include "docsCurrentMajor" . }} +{{- $latestAliasEnabled := include "docsLatestAliasEnabled" . }} +{{- $supportedDocsRootsPattern := include "docsSupportedRootsPattern" . }} +{{- $docsActiveVersionPattern := printf "(?:%s|pr-\\d+)" $supportedDocsRootsPattern }} +{{- $docsCompatibilityVersionPattern := "v\\d+(?:\\.[^/]+)+|v\\d+-(?:alpha|beta|ea|stable|rock-solid)" }} +{{- $docsVersionPattern := printf "(?:%s|%s)" $docsActiveVersionPattern $docsCompatibilityVersionPattern }} +{{- if eq $latestAliasEnabled "true" }} +{{- $docsVersionPattern = printf "(?:latest|%s)" $docsVersionPattern }} +{{- end }} +{{- $docsModernStructuredRootsPattern := include "docsModernStructuredRootsPattern" . }} +{{- $docsModernStructuredVersionPattern := "" }} +{{- if $docsModernStructuredRootsPattern }} +{{- $docsModernStructuredVersionPattern = printf "(?:%s|pr-\\d+)" $docsModernStructuredRootsPattern }} +{{- end }} +{{- $docsV12VersionPattern := "v1(?:\\.2(?:\\.\\d+(?:[^/]+)?)?)?" }} +{{- $docsV11VersionPattern := "v1\\.1(?:\\.\\d+(?:[^/]+)?)?" }} +{{- $docsV1LegacyVersionPattern := "v1(?:\\.[12](?:\\.\\d+(?:[^/]+)?)?)?" }} ############################################ # Normalize urls @@ -10,66 +27,87 @@ rewrite ^/css/(?.+) rewrite ^/images/(?.+) /assets/images/$tail redirect; rewrite ^/docs\.html$ /docs/ redirect; -rewrite ^/docs/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)$ /docs/$ver/ redirect; -rewrite ^/docs/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/index\.html$ /docs/$ver/ redirect; -rewrite ^/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/docs\.html$ /docs/$ver/ redirect; -rewrite ^/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/docs/?$ /docs/$ver/ redirect; -rewrite ^/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/docs/(?.+) /docs/$ver/$tail redirect; +rewrite ^/docs/(?{{ $docsVersionPattern }})$ /docs/$ver/ redirect; +rewrite ^/docs/(?{{ $docsVersionPattern }})/index\.html$ /docs/$ver/ redirect; +rewrite ^/(?{{ $docsVersionPattern }})/docs\.html$ /docs/$ver/ redirect; +rewrite ^/(?{{ $docsVersionPattern }})/docs/?$ /docs/$ver/ redirect; +rewrite ^/(?{{ $docsVersionPattern }})/docs/(?.+) /docs/$ver/$tail redirect; rewrite ^/documentation\.html$ /docs/ redirect; rewrite ^/documentation/?$ /docs/ redirect; -rewrite ^/documentation/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/?$ /docs/$ver/ redirect; -rewrite ^/documentation/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/index\.html$ /docs/$ver/ redirect; -rewrite ^/documentation/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/(?.+) /docs/$ver/$tail redirect; -rewrite ^/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/documentation\.html$ /docs/$ver/ redirect; -rewrite ^/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/documentation/?$ /docs/$ver/ redirect; -rewrite ^/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/documentation/(?.+) /docs/$ver/$tail redirect; - -rewrite ^/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/how_to/?$ /docs/$ver/how_to/ redirect; -rewrite ^/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/how_to/(?.+) /docs/$ver/how_to/$tail redirect; - -############################################ -# Temporary versioned redirects -############################################ - -rewrite ^/docs/?$ /docs/v2/ redirect; -rewrite ^/docs/(?!(v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/)(?:.+) /docs/v2/ redirect; - -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/?$ /docs/$ver/usage/project_configuration/overview.html redirect; -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/usage/?$ /docs/$ver/usage/project_configuration/overview.html redirect; -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/usage/project_configuration/?$ /docs/$ver/usage/project_configuration/overview.html redirect; -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/usage/build/?$ /docs/$ver/usage/build/overview.html redirect; -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/usage/build/stapel/?$ /docs/$ver/usage/build/stapel/overview.html redirect; -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/usage/deploy/?$ /docs/$ver/usage/deploy/overview.html redirect; -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/usage/distribute/?$ /docs/$ver/usage/distribute/overview.html redirect; -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/usage/cleanup/?$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/reference/?$ /docs/$ver/reference/werf_yaml.html redirect; -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/reference/cli/?$ /docs/$ver/reference/cli/overview.html redirect; -rewrite ^/docs/(?v2(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/resources/?$ /docs/$ver/resources/cheat_sheet.html redirect; - -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/?$ /docs/$ver/usage/project_configuration/overview.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/usage/?$ /docs/$ver/usage/project_configuration/overview.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/usage/project_configuration/?$ /docs/$ver/usage/project_configuration/overview.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/usage/build/?$ /docs/$ver/usage/build/overview.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/usage/build/stapel/?$ /docs/$ver/usage/build/stapel/overview.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/usage/deploy/?$ /docs/$ver/usage/deploy/overview.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/usage/distribute/?$ /docs/$ver/usage/distribute/overview.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/usage/cleanup/?$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/?$ /docs/$ver/reference/werf_yaml.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/cli/?$ /docs/$ver/reference/cli/overview.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/resources/?$ /docs/$ver/resources/cheat_sheet.html redirect; - -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/?$ /docs/$ver/index.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/configuration/?$ /docs/$ver/configuration/introduction.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/configuration/stapel_image/?$ /docs/$ver/configuration/stapel_image/naming.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/?$ /docs/$ver/reference/stages_and_images.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/deploy_process/?$ /docs/$ver/reference/deploy_process/deploy_into_kubernetes.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/plugging_into_cicd/?$ /docs/$ver/reference/plugging_into_cicd/overview.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/development_and_debug/?$ /docs/$ver/reference/development_and_debug/setup_minikube.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/toolbox/?$ /docs/$ver/reference/toolbox/slug.html redirect; - -############################################ -# Redirects for moved or deleted urls +rewrite ^/documentation/(?{{ $docsVersionPattern }})/?$ /docs/$ver/ redirect; +rewrite ^/documentation/(?{{ $docsVersionPattern }})/index\.html$ /docs/$ver/ redirect; +rewrite ^/documentation/(?{{ $docsVersionPattern }})/(?.+) /docs/$ver/$tail redirect; +rewrite ^/(?{{ $docsVersionPattern }})/documentation\.html$ /docs/$ver/ redirect; +rewrite ^/(?{{ $docsVersionPattern }})/documentation/?$ /docs/$ver/ redirect; +rewrite ^/(?{{ $docsVersionPattern }})/documentation/(?.+) /docs/$ver/$tail redirect; + +rewrite ^/(?{{ $docsV11VersionPattern }})/how_to/?$ /docs/$ver/how_to/ redirect; +rewrite ^/(?{{ $docsV11VersionPattern }})/how_to/(?.+) /docs/$ver/how_to/$tail redirect; + +############################################ +# Active docs major routing +############################################ + +rewrite ^/docs/?$ /docs/{{ $currentDocsMajor }}/ redirect; +{{- if eq $latestAliasEnabled "true" }} +rewrite ^/docs/latest/?$ /docs/{{ $currentDocsMajor }}/ redirect; +rewrite ^/docs/latest/(?.+)$ /docs/{{ $currentDocsMajor }}/$tail redirect; +{{- else }} +if ($uri ~ "^/docs/latest(?:/|$)") { + return 404; +} +{{- end }} + +############################################ +# Compatibility aliases -> fixed major roots +############################################ + +rewrite ^/docs/(?v[0-9]+)-(?:alpha|beta|ea|stable|rock-solid)/?(?.*)$ /docs/$major/$tail redirect; +rewrite ^/docs/(?v[0-9]+)(?:\.[^/]+)+/?(?.*)$ /docs/$major/$tail redirect; +rewrite ^/docs/(?!(?:{{ $docsActiveVersionPattern }}|{{ $docsCompatibilityVersionPattern }})/)(?:.+) /docs/{{ $currentDocsMajor }}/ redirect; + +############################################ +# Active docs roots with modern IA +############################################ + +{{- if $docsModernStructuredVersionPattern }} +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/?$ /docs/$ver/usage/project_configuration/overview.html redirect; +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/usage/?$ /docs/$ver/usage/project_configuration/overview.html redirect; +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/usage/project_configuration/?$ /docs/$ver/usage/project_configuration/overview.html redirect; +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/usage/build/?$ /docs/$ver/usage/build/overview.html redirect; +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/usage/build/stapel/?$ /docs/$ver/usage/build/stapel/overview.html redirect; +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/usage/deploy/?$ /docs/$ver/usage/deploy/overview.html redirect; +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/usage/distribute/?$ /docs/$ver/usage/distribute/overview.html redirect; +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/usage/cleanup/?$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/reference/?$ /docs/$ver/reference/werf_yaml.html redirect; +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/reference/cli/?$ /docs/$ver/reference/cli/overview.html redirect; +rewrite ^/docs/(?{{ $docsModernStructuredVersionPattern }})/resources/?$ /docs/$ver/resources/cheat_sheet.html redirect; +{{- end }} + +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/?$ /docs/$ver/usage/project_configuration/overview.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/usage/?$ /docs/$ver/usage/project_configuration/overview.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/usage/project_configuration/?$ /docs/$ver/usage/project_configuration/overview.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/usage/build/?$ /docs/$ver/usage/build/overview.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/usage/build/stapel/?$ /docs/$ver/usage/build/stapel/overview.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/usage/deploy/?$ /docs/$ver/usage/deploy/overview.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/usage/distribute/?$ /docs/$ver/usage/distribute/overview.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/usage/cleanup/?$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/?$ /docs/$ver/reference/werf_yaml.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/cli/?$ /docs/$ver/reference/cli/overview.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/resources/?$ /docs/$ver/resources/cheat_sheet.html redirect; + +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/?$ /docs/$ver/index.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/configuration/?$ /docs/$ver/configuration/introduction.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/configuration/stapel_image/?$ /docs/$ver/configuration/stapel_image/naming.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/?$ /docs/$ver/reference/stages_and_images.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/deploy_process/?$ /docs/$ver/reference/deploy_process/deploy_into_kubernetes.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/plugging_into_cicd/?$ /docs/$ver/reference/plugging_into_cicd/overview.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/development_and_debug/?$ /docs/$ver/reference/development_and_debug/setup_minikube.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/toolbox/?$ /docs/$ver/reference/toolbox/slug.html redirect; + +############################################ +# Historical redirects outside docs majors ############################################ rewrite ^/installation\.html$ /getting_started/ redirect; @@ -82,174 +120,174 @@ rewrite ^/introduction\.html$ # v1.1/v1.2 redirects for moved or deleted urls ############################################ -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/quickstart\.html$ /docs/$ver/ redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/using_with_ci_cd_systems\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; - -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/supported_registry_implementations\.html$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/buildah_mode\.html$ /docs/$ver/usage/build/process.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/building_images_with_stapel/artifacts\.html$ /docs/$ver/usage/build/stapel/imports.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/building_images_with_stapel/assembly_instructions\.html$ /docs/$ver/usage/build/stapel/instructions.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/building_images_with_stapel/base_image\.html$ /docs/$ver/usage/build/stapel/base.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/building_images_with_stapel/docker_directive\.html$ /docs/$ver/usage/build/stapel/dockerfile.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/building_images_with_stapel/git_directive\.html$ /docs/$ver/usage/build/stapel/git.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/building_images_with_stapel/import_directive\.html$ /docs/$ver/usage/build/stapel/imports.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/building_images_with_stapel/mount_directive\.html$ /docs/$ver/usage/build/stapel/mounts.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/bundles\.html$ /docs/$ver/usage/distribute/bundles.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/ci_cd_workflow_basics\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/generic_ci_cd_integration\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/github_actions\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/gitlab_ci_cd\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/run_in_container/run_in_docker_container\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/run_in_container/run_in_kubernetes\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/run_in_container/use_docker_container\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/run_in_container/use_github_actions_with_docker_executor\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/run_in_container/use_github_actions_with_kubernetes_executor\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/run_in_container/use_gitlab_ci_cd_with_docker_executor\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/run_in_container/use_gitlab_ci_cd_with_kubernetes_executor\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/run_in_container/use_kubernetes\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/werf_with_argocd/ci_cd_flow_overview\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/werf_with_argocd/configure_ci_cd\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/ci_cd/werf_with_argocd/prepare_kubernetes_cluster\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/cleanup\.html$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/configuration/giterminism\.html$ /docs/$ver/usage/project_configuration/giterminism.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/configuration/organizing_configuration\.html$ /docs/$ver/usage/project_configuration/werf_yaml_template_engine.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/configuration/supported_go_templates\.html$ /docs/$ver/usage/project_configuration/werf_yaml_template_engine.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/development_and_debug/stage_introspection\.html$ /docs/$ver/usage/build/stapel/base.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/giterminism\.html$ /docs/$ver/usage/project_configuration/giterminism.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/configuration/chart\.html$ /docs/$ver/usage/deploy/charts.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/configuration/chart_dependencies\.html$ /docs/$ver/usage/deploy/charts.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/configuration/giterminism\.html$ /docs/$ver/usage/project_configuration/giterminism.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/configuration/secrets\.html$ /docs/$ver/usage/deploy/values.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/configuration/templates\.html$ /docs/$ver/usage/deploy/templates.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/configuration/values\.html$ /docs/$ver/usage/deploy/values.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/deploy_process/annotating_and_labeling\.html$ /docs/$ver/usage/deploy/releases.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/deploy_process/deployment_order\.html$ /docs/$ver/usage/deploy/deployment_order.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/deploy_process/external_dependencies\.html$ /docs/$ver/usage/deploy/deployment_order.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/deploy_process/helm_hooks\.html$ /docs/$ver/usage/deploy/deployment_order.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/deploy_process/resources_adoption\.html$ /docs/$ver/usage/deploy/releases.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/deploy_process/steps\.html$ /docs/$ver/usage/deploy/deployment_order.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/overview\.html$ /docs/$ver/usage/deploy/overview.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/releases/manage_releases\.html$ /docs/$ver/usage/deploy/releases.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/releases/naming\.html$ /docs/$ver/usage/deploy/releases.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/releases/release\.html$ /docs/$ver/usage/deploy/releases.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/working_with_chart_dependencies\.html$ /docs/$ver/usage/deploy/charts.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/helm/working_with_secrets\.html$ /docs/$ver/usage/deploy/values.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/storage_layouts\.html$ /docs/$ver/usage/build/process.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/supported_container_registries\.html$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/advanced/synchronization\.html$ /docs/$ver/usage/build/process.html redirect; - -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/internals/build_process\.html$ /docs/$ver/usage/build/process.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/internals/development/stapel_image\.html$ /docs/$ver/usage/build/stapel/base.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/internals/how_ci_cd_integration_works/general_overview\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/internals/how_ci_cd_integration_works/github_actions\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/internals/how_ci_cd_integration_works/gitlab_ci_cd\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/internals/integration_with_ssh_agent\.html$ /docs/$ver/usage/build/stapel/base.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/internals/stages_and_storage\.html$ /docs/$ver/usage/build/process.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/internals/telemetry\.html$ /docs/$ver/resources/telemetry.html redirect; - -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/reference/build/artifact\.html$ /docs/$ver/usage/build/stapel/imports.html redirect; -rewrite ^/docs/(?v1\.[12](?:\.\d+(?:[^/]+)?)?|latest)/reference/cheat_sheet\.html$ /docs/$ver/resources/cheat_sheet.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/quickstart\.html$ /docs/$ver/ redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/using_with_ci_cd_systems\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; + +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/supported_registry_implementations\.html$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/buildah_mode\.html$ /docs/$ver/usage/build/process.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/building_images_with_stapel/artifacts\.html$ /docs/$ver/usage/build/stapel/imports.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/building_images_with_stapel/assembly_instructions\.html$ /docs/$ver/usage/build/stapel/instructions.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/building_images_with_stapel/base_image\.html$ /docs/$ver/usage/build/stapel/base.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/building_images_with_stapel/docker_directive\.html$ /docs/$ver/usage/build/stapel/dockerfile.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/building_images_with_stapel/git_directive\.html$ /docs/$ver/usage/build/stapel/git.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/building_images_with_stapel/import_directive\.html$ /docs/$ver/usage/build/stapel/imports.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/building_images_with_stapel/mount_directive\.html$ /docs/$ver/usage/build/stapel/mounts.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/bundles\.html$ /docs/$ver/usage/distribute/bundles.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/ci_cd_workflow_basics\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/generic_ci_cd_integration\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/github_actions\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/gitlab_ci_cd\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/run_in_container/run_in_docker_container\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/run_in_container/run_in_kubernetes\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/run_in_container/use_docker_container\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/run_in_container/use_github_actions_with_docker_executor\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/run_in_container/use_github_actions_with_kubernetes_executor\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/run_in_container/use_gitlab_ci_cd_with_docker_executor\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/run_in_container/use_gitlab_ci_cd_with_kubernetes_executor\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/run_in_container/use_kubernetes\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/werf_with_argocd/ci_cd_flow_overview\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/werf_with_argocd/configure_ci_cd\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/ci_cd/werf_with_argocd/prepare_kubernetes_cluster\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/cleanup\.html$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/configuration/giterminism\.html$ /docs/$ver/usage/project_configuration/giterminism.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/configuration/organizing_configuration\.html$ /docs/$ver/usage/project_configuration/werf_yaml_template_engine.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/configuration/supported_go_templates\.html$ /docs/$ver/usage/project_configuration/werf_yaml_template_engine.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/development_and_debug/stage_introspection\.html$ /docs/$ver/usage/build/stapel/base.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/giterminism\.html$ /docs/$ver/usage/project_configuration/giterminism.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/configuration/chart\.html$ /docs/$ver/usage/deploy/charts.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/configuration/chart_dependencies\.html$ /docs/$ver/usage/deploy/charts.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/configuration/giterminism\.html$ /docs/$ver/usage/project_configuration/giterminism.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/configuration/secrets\.html$ /docs/$ver/usage/deploy/values.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/configuration/templates\.html$ /docs/$ver/usage/deploy/templates.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/configuration/values\.html$ /docs/$ver/usage/deploy/values.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/deploy_process/annotating_and_labeling\.html$ /docs/$ver/usage/deploy/releases.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/deploy_process/deployment_order\.html$ /docs/$ver/usage/deploy/deployment_order.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/deploy_process/external_dependencies\.html$ /docs/$ver/usage/deploy/deployment_order.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/deploy_process/helm_hooks\.html$ /docs/$ver/usage/deploy/deployment_order.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/deploy_process/resources_adoption\.html$ /docs/$ver/usage/deploy/releases.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/deploy_process/steps\.html$ /docs/$ver/usage/deploy/deployment_order.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/overview\.html$ /docs/$ver/usage/deploy/overview.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/releases/manage_releases\.html$ /docs/$ver/usage/deploy/releases.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/releases/naming\.html$ /docs/$ver/usage/deploy/releases.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/releases/release\.html$ /docs/$ver/usage/deploy/releases.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/working_with_chart_dependencies\.html$ /docs/$ver/usage/deploy/charts.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/helm/working_with_secrets\.html$ /docs/$ver/usage/deploy/values.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/storage_layouts\.html$ /docs/$ver/usage/build/process.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/supported_container_registries\.html$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/advanced/synchronization\.html$ /docs/$ver/usage/build/process.html redirect; + +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/internals/build_process\.html$ /docs/$ver/usage/build/process.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/internals/development/stapel_image\.html$ /docs/$ver/usage/build/stapel/base.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/internals/how_ci_cd_integration_works/general_overview\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/internals/how_ci_cd_integration_works/github_actions\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/internals/how_ci_cd_integration_works/gitlab_ci_cd\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/internals/integration_with_ssh_agent\.html$ /docs/$ver/usage/build/stapel/base.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/internals/stages_and_storage\.html$ /docs/$ver/usage/build/process.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/internals/telemetry\.html$ /docs/$ver/resources/telemetry.html redirect; + +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/reference/build/artifact\.html$ /docs/$ver/usage/build/stapel/imports.html redirect; +rewrite ^/docs/(?{{ $docsV1LegacyVersionPattern }})/reference/cheat_sheet\.html$ /docs/$ver/resources/cheat_sheet.html redirect; ############################################ # v1.2 redirects for moved or deleted urls ############################################ -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/configurator\.html$ /docs/$ver/getting_started/ redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/configurator/?$ /docs/$ver/getting_started/ redirect; - -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/configuration/cleanup\.html$ /docs/$ver/reference/werf_yaml.html#cleanup redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/configuration/deploy_into_kubernetes\.html$ /docs/$ver/reference/werf_yaml.html#deploy redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/configuration/dockerfile_image\.html$ /docs/$ver/reference/werf_yaml.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/configuration/introduction\.html$ /docs/$ver/reference/werf_yaml.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/configuration/stapel_artifact\.html$ /docs/$ver/usage/build/stapel/imports.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/configuration/stapel_image/image_directives\.html$ /docs/$ver/reference/werf_yaml.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/configuration/stapel_image/naming\.html$ /docs/$ver/reference/werf_yaml.html#image-section redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/configuration/stapel_image/(?.+) /docs/$ver/advanced/building_images_with_stapel/$tail redirect; - -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/cli/main/(?.+) /docs/$ver/reference/cli/werf_$tail redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/cli/management/(?[^/]+)/(?[^/]+)$ /docs/$ver/reference/cli/werf_${tail1}_${tail2} redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/cli/management/(?[^/]+)/(?[^/]+)/(?[^/]+)$ /docs/$ver/reference/cli/werf_${tail1}_${tail2}_${tail3} redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/cli/management/(?[^/]+)/(?[^/]+)/(?[^/]+)/(?[^/]+)$ /docs/$ver/reference/cli/werf_${tail1}_${tail2}_${tail3}_${tail4} redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/cli/other/(?.+) /docs/$ver/reference/cli/werf_$tail redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/cli/toolbox/(?.+) /docs/$ver/reference/cli/werf_$tail redirect; - -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/development/stapel\.html$ /docs/$ver/usage/build/stapel/base.html redirect; - -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/guides/advanced_build/artifacts\.html$ /guides.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/guides/advanced_build/first_application\.html$ /guides.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/guides/advanced_build/mounts\.html$ /guides.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/guides/advanced_build/multi_images\.html$ /guides.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/guides/deploy_into_kubernetes\.html$ /docs/$ver/quickstart.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/guides/generic_ci_cd_integration\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/guides/getting_started\.html$ /docs/$ver/quickstart.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/guides/github_ci_cd_integration\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/guides/gitlab_ci_cd_integration\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/guides/installation\.html$ /docs/$ver/ redirect; - -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/build_process\.html$ /docs/$ver/usage/build/process.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/ci_cd_workflows_overview\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/cleaning_process\.html$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/deploy_process/deploy_into_kubernetes\.html$ /docs/$ver/usage/deploy/overview.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/deploy_process/working_with_chart_dependencies\.html$ /docs/$ver/usage/deploy/charts.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/development_and_debug/lint_and_render_chart\.html$ /docs/$ver/ redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/development_and_debug/stage_introspection\.html$ /docs/$ver/usage/build/stapel/base.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/plugging_into_cicd/gitlab_ci\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/plugging_into_cicd/overview\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/stages_and_images\.html$ /docs/$ver/usage/build/process.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/toolbox/slug\.html$ /docs/$ver/ redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/toolbox/ssh\.html$ /docs/$ver/usage/build/stapel/base.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/working_with_docker_registries\.html$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/reference/werf_yaml_template_engine\.html$ /docs/$ver/usage/project_configuration/werf_yaml_template_engine.html redirect; - -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/whats_new_in_v1_2/changelog\.html$ /docs/$ver/resources/how_to_migrate_from_v1_1_to_v1_2.html redirect; -rewrite ^/docs/(?v1\.2(?:\.\d+(?:[^/]+)?)?|latest)/whats_new_in_v1_2/how_to_migrate_from_v1_1_to_v1_2\.html$ /docs/$ver/resources/how_to_migrate_from_v1_1_to_v1_2.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/configurator\.html$ /docs/$ver/getting_started/ redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/configurator/?$ /docs/$ver/getting_started/ redirect; + +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/configuration/cleanup\.html$ /docs/$ver/reference/werf_yaml.html#cleanup redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/configuration/deploy_into_kubernetes\.html$ /docs/$ver/reference/werf_yaml.html#deploy redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/configuration/dockerfile_image\.html$ /docs/$ver/reference/werf_yaml.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/configuration/introduction\.html$ /docs/$ver/reference/werf_yaml.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/configuration/stapel_artifact\.html$ /docs/$ver/usage/build/stapel/imports.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/configuration/stapel_image/image_directives\.html$ /docs/$ver/reference/werf_yaml.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/configuration/stapel_image/naming\.html$ /docs/$ver/reference/werf_yaml.html#image-section redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/configuration/stapel_image/(?.+) /docs/$ver/advanced/building_images_with_stapel/$tail redirect; + +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/cli/main/(?.+) /docs/$ver/reference/cli/werf_$tail redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/cli/management/(?[^/]+)/(?[^/]+)$ /docs/$ver/reference/cli/werf_${tail1}_${tail2} redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/cli/management/(?[^/]+)/(?[^/]+)/(?[^/]+)$ /docs/$ver/reference/cli/werf_${tail1}_${tail2}_${tail3} redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/cli/management/(?[^/]+)/(?[^/]+)/(?[^/]+)/(?[^/]+)$ /docs/$ver/reference/cli/werf_${tail1}_${tail2}_${tail3}_${tail4} redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/cli/other/(?.+) /docs/$ver/reference/cli/werf_$tail redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/cli/toolbox/(?.+) /docs/$ver/reference/cli/werf_$tail redirect; + +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/development/stapel\.html$ /docs/$ver/usage/build/stapel/base.html redirect; + +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/guides/advanced_build/artifacts\.html$ /guides.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/guides/advanced_build/first_application\.html$ /guides.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/guides/advanced_build/mounts\.html$ /guides.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/guides/advanced_build/multi_images\.html$ /guides.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/guides/deploy_into_kubernetes\.html$ /docs/$ver/quickstart.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/guides/generic_ci_cd_integration\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/guides/getting_started\.html$ /docs/$ver/quickstart.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/guides/github_ci_cd_integration\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/guides/gitlab_ci_cd_integration\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/guides/installation\.html$ /docs/$ver/ redirect; + +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/build_process\.html$ /docs/$ver/usage/build/process.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/ci_cd_workflows_overview\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/cleaning_process\.html$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/deploy_process/deploy_into_kubernetes\.html$ /docs/$ver/usage/deploy/overview.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/deploy_process/working_with_chart_dependencies\.html$ /docs/$ver/usage/deploy/charts.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/development_and_debug/lint_and_render_chart\.html$ /docs/$ver/ redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/development_and_debug/stage_introspection\.html$ /docs/$ver/usage/build/stapel/base.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/plugging_into_cicd/gitlab_ci\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/plugging_into_cicd/overview\.html$ /docs/$ver/usage/integration_with_ci_cd_systems.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/stages_and_images\.html$ /docs/$ver/usage/build/process.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/toolbox/slug\.html$ /docs/$ver/ redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/toolbox/ssh\.html$ /docs/$ver/usage/build/stapel/base.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/working_with_docker_registries\.html$ /docs/$ver/usage/cleanup/cr_cleanup.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/reference/werf_yaml_template_engine\.html$ /docs/$ver/usage/project_configuration/werf_yaml_template_engine.html redirect; + +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/whats_new_in_v1_2/changelog\.html$ /docs/$ver/resources/how_to_migrate_from_v1_1_to_v1_2.html redirect; +rewrite ^/docs/(?{{ $docsV12VersionPattern }})/whats_new_in_v1_2/how_to_migrate_from_v1_1_to_v1_2\.html$ /docs/$ver/resources/how_to_migrate_from_v1_1_to_v1_2.html redirect; ############################################ # v1.1 redirects for moved or deleted urls ############################################ -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/quickstart\.html$ /docs/$ver/guides/getting_started.html redirect; - -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/how_to/?$ /docs/$ver/guides/ redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/how_to/mounts\.html$ /docs/$ver/guides/advanced_build/mounts.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/how_to/multi_images\.html$ /docs/$ver/guides/advanced_build/multi_images.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/how_to/artifacts\.html$ /docs/$ver/guides/advanced_build/artifacts.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/how_to/(?.+) /docs/$ver/guides/$tail redirect; - -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/guides/guides/unsupported_ci_cd_integration\.html$ /docs/$ver/guides/generic_ci_cd_integration.html redirect; - -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/cli/?$ /docs/$ver/reference/cli/ redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/cli/management/helm/get_release\.html$ /docs/$ver/reference/cli/werf_helm_get_release.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/cli/toolbox/meta/get_helm_release\.html$ /docs/$ver/reference/cli/werf_helm_get_release.html redirect; - -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/configuration/stapel_image/assembly_process\.html$ /docs/$ver/configuration/stapel_image/assembly_instructions.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/configuration/stapel_image/image_from_dockerfile\.html$ /docs/$ver/configuration/dockerfile_image.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/configuration/stapel_image/stage_introspection\.html$ /docs/$ver/advanced/development_and_debug/stage_introspection.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/configuration/stapel_image/stages\.html$ /docs/$ver/reference/stages_and_images.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/configuration/stapel_image/stages_and_images\.html$ /docs/$ver/internals/stages_and_storage.html redirect; - -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/cleanup_process\.html$ /docs/$ver/reference/cleaning_process.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/config\.html$ /docs/$ver/configuration/introduction.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/stages_and_images\.html$ /docs/$ver/internals/stages_and_storage.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/build/as_layers\.html$ /docs/$ver/reference/development_and_debug/as_layers.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/build/stage_introspection\.html$ /docs/$ver/reference/development_and_debug/stage_introspection.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/build/(?.+) /docs/$ver/configuration/stapel_image/$tail redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/deploy/chart_configuration\.html$ /docs/$ver/reference/deploy_process/deploy_into_kubernetes.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/deploy/deploy_to_kubernetes\.html$ /docs/$ver/reference/deploy_process/deploy_into_kubernetes.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/deploy/minikube\.html$ /docs/$ver/reference/development_and_debug/setup_minikube.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/deploy/secrets\.html$ /docs/$ver/reference/deploy_process/working_with_secrets.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/deploy/track_kubernetes_resources\.html$ /docs/$ver/reference/deploy_process/differences_with_helm.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/development_and_debug/stage_introspection\.html$ /docs/$ver/advanced/development_and_debug/stage_introspection.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/local_development/as_layers\.html$ /docs/$ver/reference/development_and_debug/as_layers.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/local_development/installing_minikube\.html$ /docs/$ver/reference/development_and_debug/setup_minikube.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/local_development/lint_and_render_chart\.html$ /docs/$ver/reference/development_and_debug/lint_and_render_chart.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/local_development/setup_minikube\.html$ /docs/$ver/reference/development_and_debug/setup_minikube.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/local_development/stage_introspection\.html$ /docs/$ver/reference/development_and_debug/stage_introspection.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/registry/authorization\.html$ /docs/$ver/reference/registry_authorization.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/registry/cleaning\.html$ /docs/$ver/reference/cleaning_process.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/registry/image_naming\.html$ /docs/$ver/reference/stages_and_images.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/registry/publish\.html$ /docs/$ver/reference/publish_process.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/registry/push\.html$ /docs/$ver/reference/publish_process.html redirect; -rewrite ^/docs/(?v1\.1(?:\.\d+(?:[^/]+)?)?|latest)/reference/registry/tag\.html$ /docs/$ver/reference/publish_process.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/quickstart\.html$ /docs/$ver/guides/getting_started.html redirect; + +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/how_to/?$ /docs/$ver/guides/ redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/how_to/mounts\.html$ /docs/$ver/guides/advanced_build/mounts.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/how_to/multi_images\.html$ /docs/$ver/guides/advanced_build/multi_images.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/how_to/artifacts\.html$ /docs/$ver/guides/advanced_build/artifacts.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/how_to/(?.+) /docs/$ver/guides/$tail redirect; + +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/guides/guides/unsupported_ci_cd_integration\.html$ /docs/$ver/guides/generic_ci_cd_integration.html redirect; + +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/cli/?$ /docs/$ver/reference/cli/ redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/cli/management/helm/get_release\.html$ /docs/$ver/reference/cli/werf_helm_get_release.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/cli/toolbox/meta/get_helm_release\.html$ /docs/$ver/reference/cli/werf_helm_get_release.html redirect; + +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/configuration/stapel_image/assembly_process\.html$ /docs/$ver/configuration/stapel_image/assembly_instructions.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/configuration/stapel_image/image_from_dockerfile\.html$ /docs/$ver/configuration/dockerfile_image.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/configuration/stapel_image/stage_introspection\.html$ /docs/$ver/advanced/development_and_debug/stage_introspection.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/configuration/stapel_image/stages\.html$ /docs/$ver/reference/stages_and_images.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/configuration/stapel_image/stages_and_images\.html$ /docs/$ver/internals/stages_and_storage.html redirect; + +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/cleanup_process\.html$ /docs/$ver/reference/cleaning_process.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/config\.html$ /docs/$ver/configuration/introduction.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/stages_and_images\.html$ /docs/$ver/internals/stages_and_storage.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/build/as_layers\.html$ /docs/$ver/reference/development_and_debug/as_layers.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/build/stage_introspection\.html$ /docs/$ver/reference/development_and_debug/stage_introspection.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/build/(?.+) /docs/$ver/configuration/stapel_image/$tail redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/deploy/chart_configuration\.html$ /docs/$ver/reference/deploy_process/deploy_into_kubernetes.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/deploy/deploy_to_kubernetes\.html$ /docs/$ver/reference/deploy_process/deploy_into_kubernetes.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/deploy/minikube\.html$ /docs/$ver/reference/development_and_debug/setup_minikube.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/deploy/secrets\.html$ /docs/$ver/reference/deploy_process/working_with_secrets.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/deploy/track_kubernetes_resources\.html$ /docs/$ver/reference/deploy_process/differences_with_helm.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/development_and_debug/stage_introspection\.html$ /docs/$ver/advanced/development_and_debug/stage_introspection.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/local_development/as_layers\.html$ /docs/$ver/reference/development_and_debug/as_layers.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/local_development/installing_minikube\.html$ /docs/$ver/reference/development_and_debug/setup_minikube.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/local_development/lint_and_render_chart\.html$ /docs/$ver/reference/development_and_debug/lint_and_render_chart.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/local_development/setup_minikube\.html$ /docs/$ver/reference/development_and_debug/setup_minikube.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/local_development/stage_introspection\.html$ /docs/$ver/reference/development_and_debug/stage_introspection.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/registry/authorization\.html$ /docs/$ver/reference/registry_authorization.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/registry/cleaning\.html$ /docs/$ver/reference/cleaning_process.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/registry/image_naming\.html$ /docs/$ver/reference/stages_and_images.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/registry/publish\.html$ /docs/$ver/reference/publish_process.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/registry/push\.html$ /docs/$ver/reference/publish_process.html redirect; +rewrite ^/docs/(?{{ $docsV11VersionPattern }})/reference/registry/tag\.html$ /docs/$ver/reference/publish_process.html redirect; {{- end }} diff --git a/.helm/values.yaml b/.helm/values.yaml index d5eb4fed9..6290fc2b9 100644 --- a/.helm/values.yaml +++ b/.helm/values.yaml @@ -1,6 +1,16 @@ global: targetCluster: "" +docsRouting: + currentMajor: + _default: v2 + supportedRoots: + _default: + - v2 + - v1 + latestAliasEnabled: + _default: auto + imagePullSecrets: - github-werfio diff --git a/.werf/nginx-dev.conf b/.werf/nginx-dev.conf index 6aba30f0f..5e592f413 100644 --- a/.werf/nginx-dev.conf +++ b/.werf/nginx-dev.conf @@ -56,6 +56,7 @@ http { root /site/$lang; index index.html; + set $docs_latest_alias_enabled "${DOCS_LATEST_ALIAS_ENABLED}"; set_real_ip_from 0.0.0.0/0; access_log /dev/stdout json_combined; @@ -85,8 +86,42 @@ http { proxy_pass http://website-$lang; } + # Active docs major routing + location = /docs { + return 302 /docs/${CURRENT_DOCS_MAJOR}/; + } + + location = /docs/latest { + if ($docs_latest_alias_enabled = "true") { + return 302 /docs/${CURRENT_DOCS_MAJOR}/; + } + + return 404; + } + + location ~ ^/docs/latest/(?.*)$ { + if ($docs_latest_alias_enabled = "true") { + return 302 /docs/${CURRENT_DOCS_MAJOR}/$tail; + } + + return 404; + } + + # Compatibility aliases -> fixed major roots + location ~ ^/docs/(?v[0-9]+)-(?:alpha|beta|ea|stable|rock-solid)(?/.*)?$ { + return 302 /docs/$major$suffix; + } + + location ~ ^/docs/(?v[0-9]+)(?:\.[^/]+)+(?/.*)?$ { + return 302 /docs/$major$suffix; + } + + location ~ ^/docs/(?!(?:${DOCS_SUPPORTED_ROOTS_REGEX}|pr-[0-9]+)(?:/|$))(?.+)$ { + return 302 /docs/${CURRENT_DOCS_MAJOR}/; + } + location /docs/ { - rewrite ^/docs/(?v\d+(?:\.\d+(?:\.\d+(?:[^/]+)?)?)?|latest)/(?.*) /$tail break; + rewrite ^/docs/(?${DOCS_SUPPORTED_ROOTS_REGEX}|pr-[0-9]+)/(?.*) /$tail break; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; diff --git a/.werf/render-docs-nginx.sh b/.werf/render-docs-nginx.sh new file mode 100644 index 000000000..7c37ad233 --- /dev/null +++ b/.werf/render-docs-nginx.sh @@ -0,0 +1,105 @@ +#!/bin/sh +set -eu + +normalize_major() { + root=$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]') + root=${root#/docs/} + root=${root#/} + root=${root%/} + + case "$root" in + v[0-9]*) + suffix=${root#v} + case "$suffix" in + ''|*[!0-9]*) return 1 ;; + esac + printf 'v%s' "$suffix" + return 0 + ;; + [0-9]*) + case "$root" in + ''|*[!0-9]*) return 1 ;; + esac + printf 'v%s' "$root" + return 0 + ;; + esac + + return 1 +} + +normalize_bool() { + value=$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]') + + case "$value" in + 1|true|yes|on) + printf 'true' + return 0 + ;; + 0|false|no|off) + printf 'false' + return 0 + ;; + esac + + return 1 +} + +append_root() { + root="$1" + case ",${supported_docs_roots_csv}," in + *,${root},*) ;; + *) + if [ -n "$supported_docs_roots_csv" ]; then + supported_docs_roots_csv="${supported_docs_roots_csv},${root}" + else + supported_docs_roots_csv="$root" + fi + ;; + esac +} + +current_docs_major="$(normalize_major "${CURRENT_DOCS_MAJOR:-}" || true)" +supported_docs_roots_csv="" + +if [ -n "$current_docs_major" ]; then + append_root "$current_docs_major" +fi + +for raw_root in $(printf '%s' "${SUPPORTED_DOCS_MAJOR_VERSIONS:-}" | tr ',;[:space:]' '\n'); do + normalized_root="$(normalize_major "$raw_root" || true)" + if [ -n "$normalized_root" ]; then + append_root "$normalized_root" + fi +done + +if [ -z "$current_docs_major" ] && [ -n "$supported_docs_roots_csv" ]; then + current_docs_major=${supported_docs_roots_csv%%,*} +fi + +if [ -z "$current_docs_major" ]; then + current_docs_major="v1" + append_root "$current_docs_major" +fi + +docs_supported_roots_regex=$(printf '%s' "$supported_docs_roots_csv" | tr ',' '|') +docs_latest_alias_enabled="$(normalize_bool "${DOCS_LATEST_ALIAS_ENABLED:-}" || true)" + +if [ -z "$docs_latest_alias_enabled" ]; then + if [ "$current_docs_major" = "v1" ] && [ "$supported_docs_roots_csv" = "v1" ]; then + docs_latest_alias_enabled="false" + else + docs_latest_alias_enabled="true" + fi +fi + +export CURRENT_DOCS_MAJOR="$current_docs_major" +export DOCS_SUPPORTED_ROOTS_REGEX="$docs_supported_roots_regex" +export DOCS_LATEST_ALIAS_ENABLED="$docs_latest_alias_enabled" +envsubst '$CURRENT_DOCS_MAJOR $DOCS_SUPPORTED_ROOTS_REGEX $DOCS_LATEST_ALIAS_ENABLED' \ + < /etc/nginx/templates/nginx.conf.template \ + > /etc/nginx/nginx.conf + + + + diff --git a/Taskfile.yaml b/Taskfile.yaml index b9bce26b3..da0cb31db 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -123,7 +123,7 @@ tasks: WERF_JEKYLL_BASE_DOCKER_IMAGE_NAME=nginx:latest \ WERF_BACKEND_DOCKER_IMAGE_NAME=nginx:latest \ werf compose down - docker network delete werfio-dev + docker network rm werfio-dev || true - | for d in $(ls -1d ./_site* ./.jekyll-cache* ./.jekyll-metadata 2>/dev/null) ; do echo "Remove dir $d ..." diff --git a/_includes/_common/channel-menu-v2.html b/_includes/_common/channel-menu-v2.html index e716829c5..d85ee4ff7 100644 --- a/_includes/_common/channel-menu-v2.html +++ b/_includes/_common/channel-menu-v2.html @@ -8,20 +8,12 @@ diff --git a/_includes/_common/channel-menu.html b/_includes/_common/channel-menu.html index c0aa2a2ec..d91aa4cf5 100644 --- a/_includes/_common/channel-menu.html +++ b/_includes/_common/channel-menu.html @@ -3,22 +3,12 @@ {{ $CurrentPageURLRelative := .CurrentPageURLRelative }} diff --git a/_includes/_common/group-menu-v2.html b/_includes/_common/group-menu-v2.html index a18949f7e..fac39a91b 100644 --- a/_includes/_common/group-menu-v2.html +++ b/_includes/_common/group-menu-v2.html @@ -2,5 +2,5 @@ {{ $CurrentPageURL := .CurrentPageURL }} {{ $CurrentPageURLRelative := .CurrentPageURLRelative }} {{- $first := index .VersionItems 0 }} - + {% endraw %} diff --git a/_includes/_common/group-menu.html b/_includes/_common/group-menu.html index 477f16c8f..0b0c20372 100644 --- a/_includes/_common/group-menu.html +++ b/_includes/_common/group-menu.html @@ -3,17 +3,15 @@ {{ $CurrentPageURLRelative := .CurrentPageURLRelative }}