Skip to content

Commit 17ad76a

Browse files
authored
add sunset version prompt (#994)
1 parent aa4d63d commit 17ad76a

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

.github/prompts/eol-branch.prompt.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!-- Download and configure Github CLI before running -->
2+
3+
Complete the following tasks:
4+
5+
1. Open the `snooty.toml` file and make the following changes:
6+
7+
- Add `eol = true` to line 3.
8+
- Add the following code where other banners are located in the file.
9+
10+
```
11+
[[banners]]
12+
targets = ["*"]
13+
variant = "info"
14+
value = """\
15+
This version of the documentation is archived and no longer supported. View the `current documentation <https://www.mongodb.com/docs/atlas/cli/current/>`__ to learn how to `upgrade your version of the Atlas CLI <https://www.mongodb.com/docs/atlas/cli/current/install-atlas-cli/>`__.\
16+
"""
17+
```
18+
19+
2. Create a new file named `NoindexEntireSource.sh` that contains the following code:
20+
21+
```
22+
#!/bin/sh
23+
while getopts p: flag
24+
do
25+
case "${flag}" in
26+
p) project=${OPTARG};;
27+
esac
28+
done
29+
echo "Adding noindex to all files in $project..."
30+
# Use find to recursively search for .txt files in the source directory and noindex them
31+
find ~/"$project"/source -type f -name "*.txt" | while read -r file; do
32+
sed -i '' "1s%^%.. meta::\n :robots: noindex, nosnippet \n\n%" "$file"
33+
done
34+
```
35+
36+
4. Run the following command in the terminal: `sh <path-to-bash-script>/NoindexEntireSource.sh -p docs-atlas-cli`, replacing `<path-to-bash-script>` with the path to `NoindexEntireSource.sh`.
37+
38+
For example: `sh ~/Projects/NoindexEntireSource.sh -p Projects/docs-atlas-cli`
39+
40+
This script should add the following code to the top of every file in the repo:
41+
42+
```
43+
.. meta::
44+
:robots: noindex, nosnippet
45+
```
46+
47+
5. Then, create a PR with these changes by performing the following actions:
48+
49+
- Run `git status`
50+
- Run `git add -- :!submodules/mongodb-atlas-cli`. This is to add all files to the commit except for the submodules files.
51+
- Generate a short PR description like "Sunset v1.20" and run `gcmsg "<PR description>"` in the terminal.
52+
- Generate a descriptive PR title like "Sunset Atlas CLI v1.20" and Run `gh pr create --title "(<current-branch>): <title>" --base <target-base-branch-name>`. Replace the placeholders with appropriate values. The version number is the versioned upstream branch. Ask me if you need clarification.
53+
- Run `ggp` in the terminal. The user might need to enter their SSH key passphrase. If the push is rejected, walk through the errors with me.
54+
- Return the link to the PR. It should look like: https://github.com/<github-username>/cloud-docs/pull/new/<current-branch>

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
.vscode/settings.json
3-
settings.json
3+
settings.json
4+
NoindexEntireSource.sh

0 commit comments

Comments
 (0)