Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
353 changes: 177 additions & 176 deletions .platform/applications.yaml
Original file line number Diff line number Diff line change
@@ -1,181 +1,182 @@
- # The name of this application, which must be unique within a project.
name: 'docs'

# The type key specifies the language and version for your application.
type: 'nodejs:20'

# Specify the Hugo version as an env variable.
variables:
env:
HUGOVERSION: 0.139.4
SITE_DIR: 'sites/platform'

build:
flavor: none

source:
root: "/"

relationships:
search: "search:http"

# The hooks that will be triggered when the package is deployed.
hooks:
# Build hooks can modify the application files on disk but not access any services like databases.
build: |
set -e
#copy API docs into correct location
# @todo once api docs are fully moved we can alter the template.hbs file so style.css can be in /api
mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles"
if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then
cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/"
mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html"
cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css"
else
echo "<p>Currently under maintenance. Please check back later.</p>" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html"
fi

cd $SITE_DIR
cp ../../themes/psh-docs/postcss.config.js .
npm install
npm run build
./build_docs.sh



deploy: |
cd $SITE_DIR
./deploy.sh
bash ./marker.sh "deployed" "${SITE_DIR}"
post_deploy:
cd $SITE_DIR && bash ./marker.sh "post_deploy" "${SITE_DIR}"

# The configuration of the application when it is exposed to the web.
web:
commands:
# Run (404) error
start: cd $SITE_DIR && node index.js
locations:
'/':
# The public directory of the application relative to its root.
root: 'sites/platform/public'
passthru: true
index: ['index.html']
scripts: false
allow: true
expires: 24h
rules:
\.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|cast|mp4|json|yaml|ico|svg?|cast|mp4|json|yaml|svg?|ttf)$:
expires: 4w
\.md$:
headers:
Content-Type: "text/markdown; charset=UTF-8"
\.txt$:
headers:
Content-Type: "text/plain; charset=UTF-8"
'/api':
root: 'sites/platform/public/api'
index: [ 'index.html' ]
expires: 24h
disk: 1024

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

size: S
name: 'docs'

# The type key specifies the language and version for your application.
type: 'nodejs:20'

# Specify the Hugo version as an env variable.
variables:
env:
HUGOVERSION: 0.139.4
SITE_DIR: 'sites/platform'

build:
flavor: none

source:
root: "/"

relationships:
search: "search:http"

# The hooks that will be triggered when the package is deployed.
hooks:
# Build hooks can modify the application files on disk but not access any services like databases.
build: |
set -e
#copy API docs into correct location
# @todo once api docs are fully moved we can alter the template.hbs file so style.css can be in /api
mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles"
if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then
cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/"
mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html"
cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css"
else
echo "<p>Currently under maintenance. Please check back later.</p>" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html"
fi

cd $SITE_DIR
cp ../../themes/psh-docs/postcss.config.js .
npm install
npm run build
./build_docs.sh



deploy: |
cd $SITE_DIR
./deploy.sh
bash ./marker.sh "deployed" "${SITE_DIR}"
post_deploy:
cd $SITE_DIR && bash ./marker.sh "post_deploy" "${SITE_DIR}"

# The configuration of the application when it is exposed to the web.
web:
commands:
# Run (404) error
start: cd $SITE_DIR && node index.js
locations:
'/':
# The public directory of the application relative to its root.
root: 'sites/platform/public'
passthru: true
index: [ 'index.html' ]
scripts: false
allow: true
expires: 24h
rules:
\.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|cast|mp4|json|yaml|ico|svg?|cast|mp4|json|yaml|svg?|ttf)$:
expires: 4w
\.md$:
headers:
Content-Type: "text/markdown; charset=UTF-8"
\.txt$:
headers:
Content-Type: "text/plain; charset=UTF-8"
'/api':
root: 'sites/platform/public/api'
index: [ 'index.html' ]
expires: 24h
disk: 1024

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

size: S

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

# The type key specifies the language and version for your application.
type: 'nodejs:20'

# Specify the Hugo version as an env variable.
variables:
env:
HUGOVERSION: 0.139.4
SITE_DIR: 'sites/upsun'

build:
flavor: none

source:
root: "/"

relationships:
search: "search:http"

# The hooks that will be triggered when the package is deployed.
hooks:
# Build hooks can modify the application files on disk but not access any services like databases.
build: |
set -e
#copy API docs into correct location
# @todo once api docs are fully moved we can alter the template.hbs file so style.css can be in /api
mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles"
if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then
cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/"
mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html"
cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css"
else
echo "<p>Currently under maintenance. Please check back later.</p>" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html"
fi
cd $SITE_DIR
cp ../../themes/psh-docs/postcss.config.js .
npm install
npm run build
./build_docs.sh
# temporary generation of json version of public regions + ip addresses
# if this is still here after 20250621 ping @gilzow and ask why
cat "${PLATFORM_APP_DIR}/shared/data/regions.yaml" | python3 -c 'import sys,yaml,json; print(json.dumps(yaml.safe_load(str(sys.stdin.read()))))' | jq '[.. | objects | .outbound_ips? // empty] | add' > "${PLATFORM_APP_DIR}/${SITE_DIR}/public/outbound_ips.json"

deploy: |
cd $SITE_DIR
./deploy.sh
bash ./marker.sh "deployed" "${SITE_DIR}"
post_deploy:
cd $SITE_DIR && bash ./marker.sh "post_deploy" "${SITE_DIR}"
# The configuration of the application when it is exposed to the web.
web:
commands:
# Run (404) error
start: cd $SITE_DIR && node index.js
locations:
'/':
# The public directory of the application relative to its root.
root: 'sites/upsun/public'
passthru: true
index: [ 'index.html' ]
scripts: false
allow: true
expires: 24h
rules:
\.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|cast|mp4|json|yaml|ico|svg?|cast|mp4|json|yaml|svg?|ttf)$:
expires: 4w
\.md$:
headers:
Content-Type: "text/markdown; charset=UTF-8"
\.txt$:
headers:
Content-Type: "text/plain; charset=UTF-8"
'^/favicon.ico$':
allow: true
passthru: '/images/favicon.ico'
'/api':
root: 'sites/upsun/public/api'
index: [ 'index.html' ]
expires: 24h

disk: 1024

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

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

# The type key specifies the language and version for your application.
type: 'nodejs:20'

# Specify the Hugo version as an env variable.
variables:
env:
HUGOVERSION: 0.139.4
SITE_DIR: 'sites/upsun'

build:
flavor: none

source:
root: "/"

relationships:
search: "search:http"

# The hooks that will be triggered when the package is deployed.
hooks:
# Build hooks can modify the application files on disk but not access any services like databases.
build: |
#copy API docs into correct location
# @todo once api docs are fully moved we can alter the template.hbs file so style.css can be in /api
mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles"
if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then
cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/"
mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html"
cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css"
else
echo "<p>Currently under maintenance. Please check back later.</p>" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html"
fi
cd $SITE_DIR
cp ../../themes/psh-docs/postcss.config.js .
npm install
npm run build
./build_docs.sh
# temporary generation of json version of public regions + ip addresses
# if this is still here after 20250621 ping @gilzow and ask why
cat "${PLATFORM_APP_DIR}/shared/data/regions.yaml" | python3 -c 'import sys,yaml,json; print(json.dumps(yaml.safe_load(str(sys.stdin.read()))))' | jq '[.. | objects | .outbound_ips? // empty] | add' > "${PLATFORM_APP_DIR}/${SITE_DIR}/public/outbound_ips.json"

deploy: |
cd $SITE_DIR
./deploy.sh
bash ./marker.sh "deployed" "${SITE_DIR}"
post_deploy:
cd $SITE_DIR && bash ./marker.sh "post_deploy" "${SITE_DIR}"
# The configuration of the application when it is exposed to the web.
web:
commands:
# Run (404) error
start: cd $SITE_DIR && node index.js
locations:
'/':
# The public directory of the application relative to its root.
root: 'sites/upsun/public'
passthru: true
index: ['index.html']
scripts: false
allow: true
expires: 24h
rules:
\.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|cast|mp4|json|yaml|ico|svg?|cast|mp4|json|yaml|svg?|ttf)$:
expires: 4w
\.md$:
headers:
Content-Type: "text/markdown; charset=UTF-8"
\.txt$:
headers:
Content-Type: "text/plain; charset=UTF-8"
'^/favicon.ico$':
allow: true
passthru: '/images/favicon.ico'
'/api':
root: 'sites/upsun/public/api'
index: [ 'index.html' ]
expires: 24h

disk: 1024

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

size: S
-
name: redirectionio-upsun
source:
root: upsun-redirectionio
Expand Down Expand Up @@ -209,7 +210,7 @@
source: local
source_path: log

-
- # The name of this application, which must be unique within a project.
name: redirectionio-psh
source:
root: psh-redirectionio
Expand Down
4 changes: 2 additions & 2 deletions .platform/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
https://{default}/:
type: upstream
upstream: redirectionio-psh:http
upstream: docs:http
id: platformsh
primary: true
cache:
Expand Down Expand Up @@ -291,7 +291,7 @@ https://{default}/:

https://docs.upsun.com/:
type: upstream
upstream: 'redirectionio-upsun:http'
upstream: 'upsun:http'
id: upsun
cache:
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion search/scrape.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"api.platform.sh"
],
"start_urls": [
"https://api.platform.sh/docs/"
"https://docs.platform.sh/api/"
]
}
}
Expand Down
Loading
Loading