Skip to content

Update secondary vendor site name #3841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/generate-cli-commands-page.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
BRANCH_TITLE: cli-commands-doc-page
DEFAULT_BRANCH: "main"
PLATFORMSH_CLI_DOC_PATH: "sites/platform/src/administration/cli/reference.md"
UPSUN_CLI_DOC_PATH: "sites/friday/src/administration/cli/reference.md"
UPSUN_CLI_DOC_PATH: "sites/upsun/src/administration/cli/reference.md"
permissions:
contents: write

Expand Down
10 changes: 5 additions & 5 deletions .platform/applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
size: S

- # The name of this application, which must be unique within a project.
name: 'friday'
name: 'upsun'

# The type key specifies the language and version for your application.
type: 'nodejs:20'
Expand All @@ -75,7 +75,7 @@
variables:
env:
HUGOVERSION: 0.116.0
SITE_DIR: 'sites/friday'
SITE_DIR: 'sites/upsun'

build:
flavor: none
Expand Down Expand Up @@ -111,7 +111,7 @@
locations:
'/':
# The public directory of the application relative to its root.
root: 'sites/friday/public'
root: 'sites/upsun/public'
passthru: true
index: ['index.html']
scripts: false
Expand All @@ -124,8 +124,8 @@
disk: 1024

mounts:
"sites/friday/public/scripts/xss/dist/config":
"sites/upsun/public/scripts/xss/dist/config":
source: local
source_path: "sites/friday/config"
source_path: "sites/upsun/config"

size: S
4 changes: 2 additions & 2 deletions .platform/routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ https://{default}/:

https://docs.upsun.com/:
type: upstream
upstream: friday:http
id: friday
upstream: upsun:http
id: upsun
cache:
enabled: true
ssi:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ but if you don't, the search field doesn't appear in the sidebar.
1. To run the docs alone, clone this repository and install dependencies:

```bash
cd sites/platform # or cd sites/friday
cd sites/platform # or cd sites/upsun
npm install
```

Expand Down Expand Up @@ -161,15 +161,15 @@ When you add a white label documentation, you want vendor-specific values, such

For example, if you add a white label documentation for a product called MyGreatProduct,
you want every instance of `Platform.sh` and `Platform.sh CLI` to be automatically substituted by `MyGreatProduct` and `MyGreatProduct CLI` respectively.
To achieve that result, use the settings placeholders defined in the `sites/friday/config/_default/params.yaml` file:
To achieve that result, use the settings placeholders defined in the `sites/upsun/config/_default/params.yaml` file:

```yaml
# Vendorization
vendor:
name: Deploy Friday
cli: friday
env_prefix: FRIDAY
config_dir: .friday
name: Upsun
cli: upsun
env_prefix: PLATFORM
config_dir: .upsun
```

Each of them can be used in any templates (HTML or MarkDown) using shortcodes:
Expand Down Expand Up @@ -207,7 +207,7 @@ To do so, you could implement the following file structure:

```bash
sites
├── friday
├── upsun
│ └── src
│ └── tutorials
│ └── migrating
Expand Down
6 changes: 3 additions & 3 deletions search/index_external_sites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cleanup(){
echo "* CLEANING UP OLD DOCS INDEX"
rm -f output/platform_index.json
rm -f output/friday_index.json
rm -f output/upsun_index.json

}

Expand All @@ -27,9 +27,9 @@ update_index(){
POETRY_LOCATION=/app/.local/bin/poetry
# Update indexes
$POETRY_LOCATION run python createPrimaryIndex.py platform
$POETRY_LOCATION run python createPrimaryIndex.py friday
$POETRY_LOCATION run python createPrimaryIndex.py upsun
$POETRY_LOCATION run python main.py platform
$POETRY_LOCATION run python main.py friday
$POETRY_LOCATION run python main.py upsun
}

# scrape
Expand Down
4 changes: 2 additions & 2 deletions search/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ def update(self):
# Create a new index
create_index_task = client.create_index(uid=self.docs_index, options={'primaryKey': self.primaryKey, 'uid': self.index_name})

timeout = 5000
timeout = 10000
if "friday" == docs_index_name:
timeout = 15000

try:
client.wait_for_task(create_index_task['taskUid'], timeout)
except MeilisearchTimeoutError as merror:
except meilisearch.errors.MeilisearchTimeoutError as merror:
print('Failed waiting {0} milliseconds for Meilisearch to create the index. Error message: {1}'.format(timeout, merror))
return

Expand Down
24 changes: 12 additions & 12 deletions search/post_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
cleanup(){
echo "* CLEANING UP OLD DOCS INDEX"
rm -v output/platform_docs.json && echo "output json for platform deleted" || echo "failed to delete output json for platform"
rm -v output/friday_docs.json && echo "output json for upsun deleted" || echo "failed to delete output json for upsun"
rm -v output/upsun_docs.json && echo "output json for upsun deleted" || echo "failed to delete output json for upsun"
}

getDocsData() {
# Get the frontend URLs
PLATFORM_DOCS_URL=$(echo $PLATFORM_ROUTES | base64 --decode | jq -r 'to_entries[] | select(.value.primary) | .key')
FRIDAY_DOCS_URL=$(echo $PLATFORM_ROUTES | base64 --decode | jq -r 'to_entries[] | select(.value.id=="friday") | .key')
UPSUN_DOCS_URL=$(echo $PLATFORM_ROUTES | base64 --decode | jq -r 'to_entries[] | select(.value.id=="upsun") | .key')

printf "URL for platform docs: %s\n" "${PLATFORM_DOCS_URL}"
printf "URL for upsun docs: %s\n" "${FRIDAY_DOCS_URL}"
printf "URL for upsun docs: %s\n" "${UPSUN_DOCS_URL}"

# Delete docs index in the mount if it exists
rm -v data/platform_index.json && echo "data json for platform deleted" || echo "failed to delete data json for platform"
rm -v data/friday_index.json && echo "data json for upsun deleted" || echo "failed to delete data json for upsun"
rm -v data/upsun_index.json && echo "data json for upsun deleted" || echo "failed to delete data json for upsun"

# remove the previous headers log
if [ -f "data/platform-headers.txt" ]; then
Expand All @@ -34,17 +34,17 @@ getDocsData() {
# curl --user-agent "request-to-upsun-docs" -s -D - -o foobar.json "https://docs.upsun.com/index.json" >> headers.txt
curl --user-agent "request-search-index-for-platform-docs" -s -D - -o data/platform_index.json "${PLATFORM_DOCS_URL}index.json" >> data/platform-headers.txt
#curl -s "${PLATFORM_DOCS_URL}index.json" >> data/platform_index.json && echo "retrieved psh index" || echo "failed to retrieve psh index"
curl --user-agent "request-search-index-for-upsun-docs" -s -D - -o data/friday_index.json "${FRIDAY_DOCS_URL}index.json" >> data/upsun-headers.txt
#curl -s "${FRIDAY_DOCS_URL}index.json" >> data/friday_index.json && echo "retrieved upsun index" || echo "failed to retrieve upsun index"
curl --user-agent "request-search-index-for-upsun-docs" -s -D - -o data/upsun_index.json "${UPSUN_DOCS_URL}index.json" >> data/upsun-headers.txt
#curl -s "${UPSUN_DOCS_URL}index.json" >> data/upsun_index.json && echo "retrieved upsun index" || echo "failed to retrieve upsun index"

# How many times does Platform.sh appear in the platform index? Should be 3815
pshOccurrenceInPsh=$(cat data/platform_index.json | grep -o -i Platform.sh | wc -l)
# How many times does Platform.sh appear in the Upsun index? should be 33
pshOccurrenceInUpsun=$(cat data/friday_index.json | grep -o -i Platform.sh | wc -l)
pshOccurrenceInUpsun=$(cat data/upsun_index.json | grep -o -i Platform.sh | wc -l)
#How many times does Upsun appear in the platform index? Should be 0
upsunOccurrenceInPsh=$(cat data/platform_index.json | grep -o -i Upsun | wc -l)
#how many times does Upsun appear in the upsun index? Should be 4616
upsunOccurrenceInUpsun=$(cat data/friday_index.json | grep -o -i Upsun | wc -l)
upsunOccurrenceInUpsun=$(cat data/upsun_index.json | grep -o -i Upsun | wc -l)

printf "Upsun appears %d times in the platform index.\nUpsun appears %d times in the Upsun index.\n" "${upsunOccurrenceInPsh}" "${upsunOccurrenceInUpsun}"
printf "Platform appears %d times in the platform index.\nPlatform appears %d times in the Upsun index.\n" "${pshOccurrenceInPsh}" "${pshOccurrenceInUpsun}"
Expand All @@ -62,25 +62,25 @@ getDocsData() {

# Delete templates index in the mount if it exists
rm -f data/platform_templates.yaml
rm -f data/friday_templates.yaml
rm -f data/upsun_templates.yaml

# Get the updated index for templates
curl -s "${PLATFORM_DOCS_URL}files/indexes/templates.yaml" >> data/platform_templates.yaml

# @todo: For now, reuse the same index. To be removed entirely.
cp data/platform_templates.yaml data/friday_templates.yaml
cp data/platform_templates.yaml data/upsun_templates.yaml
}

update_index(){
echo "* UPDATING INDEX"
POETRY_LOCATION=/app/.local/bin/poetry
# Create indices for templates and docs
$POETRY_LOCATION run python createPrimaryIndex.py platform
$POETRY_LOCATION run python createPrimaryIndex.py friday
$POETRY_LOCATION run python createPrimaryIndex.py upsun

# Update indexes
$POETRY_LOCATION run python main.py platform
$POETRY_LOCATION run python main.py friday
$POETRY_LOCATION run python main.py upsun
}

save_headers() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sites/friday/build_docs.sh → sites/upsun/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ else
fi

echo "Moving the hugo binary from cache into the application."
cp "${PLATFORM_CACHE_DIR}/hugo_${HUGOVERSION}/hugo" "${PLATFORM_APP_DIR}/sites/friday"
cp "${PLATFORM_CACHE_DIR}/hugo_${HUGOVERSION}/hugo" "${PLATFORM_APP_DIR}/sites/upsun"

# Build the Hugo site
./hugo
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

# Basics
version: "1.1.0"
description: Deploy Friday User Documentation
author: Deploy Friday
version: "1.0.19"
description: UPSUN User Documentation
author: Upsun
title: User documentation
issuerepo: "https://github.com/platformsh/platformsh-docs/"
repo: "https://github.com/platformsh/platformsh-docs/"
folder: "sites/friday"
folder: "sites/upsun"
editPageButton: true

theme:
Expand Down
2 changes: 1 addition & 1 deletion sites/friday/deploy.sh → sites/upsun/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
MEILI_CONFIG_DEST=public/scripts/xss/dist/config/config.json

# The index won't be built until the post_deploy hook, so we hardcode it here.
MEILI_INDEX="friday_docs"
MEILI_INDEX="upsun_docs"

createSearchConfig() {
# Use the shared PLATFORM_PROJECT_ENTROPY var as MEILI_MASTER_KEY to retrieve the public key for our autocomplete app.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading