From 5d1cf79fc64b3099e0fa6907639f8024fe4ed055 Mon Sep 17 00:00:00 2001
From: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Date: Thu, 12 Oct 2023 11:39:09 -0400
Subject: [PATCH] chore(docs): redirect docs pages to new docs (#646)
* chore(docs): redirect docs pages to new docs
Signed-off-by: CI <350466+crenshaw-dev@users.noreply.github.com>
* fixes
Signed-off-by: CI <350466+crenshaw-dev@users.noreply.github.com>
---------
Signed-off-by: CI <350466+crenshaw-dev@users.noreply.github.com>
---
docs/Application-Deletion.md | 5 +++
docs/Argo-CD-Integration.md | 5 +++
docs/Controlling-Resource-Modification.md | 5 +++
docs/Development.md | 5 +++
docs/E2E-Tests.md | 5 +++
docs/Generators-Cluster-Decision-Resource.md | 5 +++
docs/Generators-Cluster.md | 5 +++
docs/Generators-Git.md | 5 +++
docs/Generators-List.md | 5 +++
docs/Generators-Matrix.md | 5 +++
docs/Generators-Merge.md | 5 +++
docs/Generators-Pull-Request.md | 5 +++
docs/Generators-SCM-Provider.md | 5 +++
docs/Generators.md | 5 +++
docs/Geting-Started.md | 5 +++
docs/Getting-Started.md | 5 +++
docs/Release-Checklist-Template.md | 5 +++
docs/Releasing.md | 5 +++
docs/Template.md | 5 +++
docs/Use-Cases.md | 5 +++
docs/index.md | 5 +++
docs/upgrading/v0.2.0-to-v0.3.0.md | 5 +++
hack/set-docs-redirects.sh | 41 ++++++++++++++++++++
23 files changed, 151 insertions(+)
create mode 100755 hack/set-docs-redirects.sh
diff --git a/docs/Application-Deletion.md b/docs/Application-Deletion.md
index e9d58bfa..91abbbb3 100644
--- a/docs/Application-Deletion.md
+++ b/docs/Application-Deletion.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Application-Deletion//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Application-Deletion//). Redirecting to the new page.
+
# Application Pruning & Resource Deletion
All `Application` resources created by the ApplicationSet controller (from an ApplicationSet) will contain:
diff --git a/docs/Argo-CD-Integration.md b/docs/Argo-CD-Integration.md
index b553afd3..3181356c 100644
--- a/docs/Argo-CD-Integration.md
+++ b/docs/Argo-CD-Integration.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Argo-CD-Integration//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Argo-CD-Integration//). Redirecting to the new page.
+
# How ApplicationSet controller interacts with Argo CD
When you create, update, or delete an `ApplicationSet` resource, the ApplicationSet controller responds by creating, updating, or deleting one or more corresponding Argo CD `Application` resources.
diff --git a/docs/Controlling-Resource-Modification.md b/docs/Controlling-Resource-Modification.md
index 6c0adbe3..ae80952c 100644
--- a/docs/Controlling-Resource-Modification.md
+++ b/docs/Controlling-Resource-Modification.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Controlling-Resource-Modification//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Controlling-Resource-Modification//). Redirecting to the new page.
+
# Controlling if/when the ApplicationSet controller modifies `Application` resources
The ApplicationSet controller supports a number of settings that limit the ability of the controller to make changes to generated Applications, for example, preventing the controller from deleting child Applications.
diff --git a/docs/Development.md b/docs/Development.md
index d9d4b96d..46bd8b40 100644
--- a/docs/Development.md
+++ b/docs/Development.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/). Redirecting to the new page.
+
# Development
## Running the ApplicationSet controller as an image within Kubernetes
diff --git a/docs/E2E-Tests.md b/docs/E2E-Tests.md
index 1088647d..17337e72 100644
--- a/docs/E2E-Tests.md
+++ b/docs/E2E-Tests.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/). Redirecting to the new page.
+
# Running Application Set E2E tests
The E2E tests will run automatically on each PR/commit as part of a GitHub action. You may also run these tests locally to verify the functionality, as described below.
diff --git a/docs/Generators-Cluster-Decision-Resource.md b/docs/Generators-Cluster-Decision-Resource.md
index 0eec6fac..4860bf23 100644
--- a/docs/Generators-Cluster-Decision-Resource.md
+++ b/docs/Generators-Cluster-Decision-Resource.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Cluster-Decision-Resource//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Cluster-Decision-Resource//). Redirecting to the new page.
+
# Cluster Decision Resource Generator
The cluster decision resource generates a list of Argo CD clusters. This is done using [duck-typing](https://pkg.go.dev/knative.dev/pkg/apis/duck), which does not require knowledge of the full shape of the referenced kubernetes resource. The following is an example of a cluster-decision-resource-based ApplicationSet generator:
diff --git a/docs/Generators-Cluster.md b/docs/Generators-Cluster.md
index 1b3e0b9a..fb72ca06 100644
--- a/docs/Generators-Cluster.md
+++ b/docs/Generators-Cluster.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Cluster//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Cluster//). Redirecting to the new page.
+
# Cluster Generator
In Argo CD, managed clusters [are stored within Secrets](https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#clusters) in the Argo CD namespace. The ApplicationSet controller uses those same Secrets to generate parameters to identify and target available clusters.
diff --git a/docs/Generators-Git.md b/docs/Generators-Git.md
index c0ffe5e7..c8a12246 100644
--- a/docs/Generators-Git.md
+++ b/docs/Generators-Git.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Git//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Git//). Redirecting to the new page.
+
# Git Generator
The Git generator contains two subtypes: the Git directory generator, and Git file generator.
diff --git a/docs/Generators-List.md b/docs/Generators-List.md
index 967b80bd..73f47d81 100644
--- a/docs/Generators-List.md
+++ b/docs/Generators-List.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-List//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-List//). Redirecting to the new page.
+
# List Generator
The List generator generates parameters based on an arbitrary list of key/value pairs (as long as the values are string values). In this example, we're targeting a local cluster named `engineering-dev`:
diff --git a/docs/Generators-Matrix.md b/docs/Generators-Matrix.md
index bd969834..16641567 100644
--- a/docs/Generators-Matrix.md
+++ b/docs/Generators-Matrix.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Matrix//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Matrix//). Redirecting to the new page.
+
# Matrix Generator
The Matrix generator combines the parameters generated by two child generators, iterating through every combination of each generator's generated parameters.
diff --git a/docs/Generators-Merge.md b/docs/Generators-Merge.md
index 705b5614..f18b36f5 100644
--- a/docs/Generators-Merge.md
+++ b/docs/Generators-Merge.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Merge//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Merge//). Redirecting to the new page.
+
# Merge Generator
The Merge generator combines parameters produced by the base (first) generator with matching parameter sets produced by subsequent generators. A _matching_ parameter set has the same values for the configured _merge keys_. _Non-matching_ parameter sets are discarded. Override precedence is bottom-to-top: the values from a matching parameter set produced by generator 3 will take precedence over the values from the corresponding parameter set produced by generator 2.
diff --git a/docs/Generators-Pull-Request.md b/docs/Generators-Pull-Request.md
index 6cad00ff..a9f3dbc8 100644
--- a/docs/Generators-Pull-Request.md
+++ b/docs/Generators-Pull-Request.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Pull-Request//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Pull-Request//). Redirecting to the new page.
+
# Pull Request Generator
The Pull Request generator uses the API of an SCMaaS provider (eg GitHub/GitLab) to automatically discover open pull requests within an repository. This fits well with the style of building a test environment when you create a pull request.
diff --git a/docs/Generators-SCM-Provider.md b/docs/Generators-SCM-Provider.md
index 8d0fedee..0f3e5dcf 100644
--- a/docs/Generators-SCM-Provider.md
+++ b/docs/Generators-SCM-Provider.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-SCM-Provider//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-SCM-Provider//). Redirecting to the new page.
+
# SCM Provider Generator
The SCM Provider generator uses the API of an SCMaaS provider (eg GitHub) to automatically discover repositories within an organization. This fits well with GitOps layout patterns that split microservices across many repositories.
diff --git a/docs/Generators.md b/docs/Generators.md
index 12e64408..0096d75f 100644
--- a/docs/Generators.md
+++ b/docs/Generators.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators//). Redirecting to the new page.
+
# Generators
Generators are responsible for generating *parameters*, which are then rendered into the `template:` fields of the ApplicationSet resource. See the [Introduction](index.md) for an example of how generators work with templates, to create Argo CD Applications.
diff --git a/docs/Geting-Started.md b/docs/Geting-Started.md
index 1c505a6c..e5037d4a 100644
--- a/docs/Geting-Started.md
+++ b/docs/Geting-Started.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/). Redirecting to the new page.
+
# Getting Started
The Getting Started document has moved [here](Getting-Started.md).
diff --git a/docs/Getting-Started.md b/docs/Getting-Started.md
index d4575534..420059cf 100644
--- a/docs/Getting-Started.md
+++ b/docs/Getting-Started.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Getting-Started//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Getting-Started//). Redirecting to the new page.
+
# Getting Started
This guide assumes you are familiar with Argo CD and its basic concepts. See the [Argo CD documentation](https://argo-cd.readthedocs.io/en/stable/core_concepts/) for more information.
diff --git a/docs/Release-Checklist-Template.md b/docs/Release-Checklist-Template.md
index 8ae3347d..90fc705a 100644
--- a/docs/Release-Checklist-Template.md
+++ b/docs/Release-Checklist-Template.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/). Redirecting to the new page.
+
# Release Checklist Template
diff --git a/docs/Releasing.md b/docs/Releasing.md
index e3882c63..602ddc1f 100644
--- a/docs/Releasing.md
+++ b/docs/Releasing.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/). Redirecting to the new page.
+
# Releasing an ApplicationSet release
The ApplicationSet controller release process and scripts are based on the process/scripts used by the [Argo CD Image Updater](https://github.com/argoproj-labs/argocd-image-updater), a sibling project in the Argo organization.
diff --git a/docs/Template.md b/docs/Template.md
index 1eae3e11..7c1b30d6 100644
--- a/docs/Template.md
+++ b/docs/Template.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Template//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Template//). Redirecting to the new page.
+
# Templates
The template fields of the ApplicationSet `spec` are used to generate Argo CD `Application` resources.
diff --git a/docs/Use-Cases.md b/docs/Use-Cases.md
index 87d023ea..62e34671 100644
--- a/docs/Use-Cases.md
+++ b/docs/Use-Cases.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Use-Cases//](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Use-Cases//). Redirecting to the new page.
+
# Use cases supported by the ApplicationSet controller
With the concept of generators, the ApplicationSet controller provides a powerful set of tools to automate the templating and modification of Argo CD Applications. Generators produce template parameter data from a variety of sources, including Argo CD clusters and Git repositories, supporting and enabling new use cases.
diff --git a/docs/index.md b/docs/index.md
index fa392bcd..8d789177 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/). Redirecting to the new page.
+
# Introduction to ApplicationSet controller
## Introduction
diff --git a/docs/upgrading/v0.2.0-to-v0.3.0.md b/docs/upgrading/v0.2.0-to-v0.3.0.md
index 15d980bd..2e97ac97 100644
--- a/docs/upgrading/v0.2.0-to-v0.3.0.md
+++ b/docs/upgrading/v0.2.0-to-v0.3.0.md
@@ -1,3 +1,8 @@
+
+
+!!! important "This page has moved"
+ This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/). Redirecting to the new page.
+
# Upgrading from ApplicationSet controller v0.2.0 to v0.3.0.
When moving from ApplicationSet v0.2.0 to v0.3.0, there are a couple of behaviour changes to be aware of.
diff --git a/hack/set-docs-redirects.sh b/hack/set-docs-redirects.sh
new file mode 100755
index 00000000..96fc5a71
--- /dev/null
+++ b/hack/set-docs-redirects.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+# ApplicationSet docs now live at https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/
+# This script adds redirects to the top of each ApplicationSet doc to redirect to the new location.
+
+set -e pipefail
+
+new_docs_base_path="https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/"
+new_docs_base_path_regex=$(echo "$new_docs_base_path" | sed 's/\//\\\//g')
+
+# Loop over files in the docs directory recursively. For each file, use sed to add the following redirect to the top:
+#
+# FILE_PATH should be the path to the file relative to the docs directory, stripped of the .md extension.
+
+files=$(find docs -type f -name '*.md')
+for file in $files; do
+ file_path=$(echo "$file" | sed 's/^docs\///' | sed 's/\.md$/\//')
+ echo "Adding redirect to $file_path"
+ # If a redirect is already present at the top of the file, remove it.
+ sed '1s/ "$file.tmp"
+ mv "$file.tmp" "$file"
+
+ # Add the new redirect.
+ # Default to an empty path.
+ file_path_plain=""
+ file_path_regex=""
+ if curl -s -o /dev/null -w "%{http_code}" "$new_docs_base_path$file_path" | grep -q 200; then
+ # If the destination path exists, use it.
+ file_path_plain="$file_path/"
+ file_path_regex=$(echo "$file_path" | sed 's/\//\\\//g')
+ else
+ echo "WARNING: $new_docs_base_path$file_path does not exist. Using empty path."
+ fi
+
+ notice="!!! important \"This page has moved\"\n This page has moved to [$new_docs_base_path$file_path_plain]($new_docs_base_path$file_path_plain). Redirecting to the new page.\n"
+
+ notice_regex=$(echo "$notice" | sed 's/\//\\\//g')
+
+ sed "1s/^/\\n\\n$notice_regex\\n/" "$file" > "$file.tmp"
+ mv "$file.tmp" "$file"
+done