Skip to content

WIP: Replace Meilisearch with Typesense #4403

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
8 changes: 4 additions & 4 deletions .github/workflows/pr-check-links.yaml
Original file line number Diff line number Diff line change
@@ -29,10 +29,10 @@ jobs:
cd sites/${{ matrix.site }}
npm ci
- name: Build search script
run: |
cd sites/${{ matrix.site }}
npm run build:search
# - name: Build search script
# run: |
# cd sites/${{ matrix.site }}
# npm run build:search

- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
12 changes: 0 additions & 12 deletions .platform/applications.yaml
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@
./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}"
@@ -61,11 +60,6 @@
Content-Type: "text/plain; charset=UTF-8"
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.
@@ -100,7 +94,6 @@
./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}"
@@ -130,9 +123,4 @@

disk: 1024

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

size: S
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -168,7 +168,7 @@ To ensure the docs work smoothly, a few checks run on each pull request:
npm install
# Generate necessary files
npm run dev
npm run build:search
# npm run build:search
# Build HTML pages to check
hugo
# Run the check
2 changes: 1 addition & 1 deletion build_local.sh
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ clean_dir resources
cp ../../themes/psh-docs/postcss.config.js .
npm install
npm run build
npm run build:search
# npm run build:search
hugo

clear
288 changes: 144 additions & 144 deletions cypress/e2e/search.cy.js
Original file line number Diff line number Diff line change
@@ -1,144 +1,144 @@
//Both should return results for "opensearch"
//Only Upsun should return a match for "vertical scaling"
//Only platform should return a match for "24.55 gb"
describe("Searches",()=>{
beforeEach(()=>{
if('local' == Cypress.env('environment')) {
cy.intercept("/indexes/*_docs/search*", { "hits":[] })
}

//cy.visit("/")
})

context("Search tests",()=>{
it("Searches for something that should match in both", () => {
cy.visit("/")
if('local' == Cypress.env('environment')) {
cy.intercept({
pathname: '/indexes/*_docs/search',
query: {
q: 'opensearch'
}
},{ fixture: "opensearchresults" }).as("searchresultsopensearch")
}

cy.wait(1000)
cy.get("#searchwicon-header").type("opensearch")

if ('local' == Cypress.env('environment')) {
cy.wait('@searchresultsopensearch')
}

cy.get("#xssroot").find("h2").as("searchresultsheader")
cy.get("@searchresultsheader").should("exist")
cy.get("@searchresultsheader").contains("Documentation")
cy.get("#xssroot").find("li").contains("OpenSearch").should("exist")

cy.get("#searchwicon-header").type("{enter}")
cy.location("pathname").should(
"eq",
"/search.html"
)

cy.get("#xssSearchPage").find("h2").as("searchpageresults")
cy.get("@searchpageresults").should("exist")
cy.get("@searchpageresults").contains("Documentation")

cy.get("#xssSearchPage").find("li").contains("OpenSearch").should("exist")

})

it("Searches for something that should not match on Platformsh, but should on Upsun", ()=>{
const searchDetails = {
search: 'vertical scaling',
header: 'No results',
body: 'No documentation matched'
}

if ('upsun' == Cypress.env('site')) {
searchDetails.header = 'Documentation'
searchDetails.body = searchDetails.search
}

cy.visit("/")
cy.wait(1000)
cy.get("#searchwicon-header").type(searchDetails.search)
cy.get("#xssroot").find("h2").as("searchresultsheader")
cy.get("@searchresultsheader").should("exist")
cy.get("@searchresultsheader").contains(searchDetails.header)
cy.get("#xssroot").find("p").contains(searchDetails.body)

cy.get("#searchwicon-header").type("{enter}")
cy.location("pathname").should(
"eq",
"/search.html"
)

cy.get("#xssSearchPage").find("h2").as("searchpageresults")
cy.get("@searchpageresults").should("exist")
if ('upsun' == Cypress.env('site')) {
cy.get("#xssSearchPage").find("li").contains(searchDetails.body).should("exist")
} else {
cy.get("#xssSearchPage").contains(searchDetails.header)
}

})

it("Searches for something that should ONLY match on platformsh, but not on Upsun", () => {
const searchDetails = {
search: 'DG3',
header: 'No results',
body: 'No documentation matched'
}

console.log('Current site is ' + Cypress.env('site'))

if ('platformsh' == Cypress.env('site')) {
searchDetails.header = 'Documentation'
searchDetails.body = searchDetails.search
}

cy.visit("/")
if('local' == Cypress.env('environment')) {
cy.intercept({
pathname: '/indexes/*_docs/search',
query: {
q: 'opensearch'
}
},{ fixture: "searchosresults" }).as("searchresultsopensearch")
}

//console.log('Pausing before starting')
cy.wait(1000)
//console.log('finished pausing')

cy.get("#searchwicon-header").clear().type(searchDetails.search)

if ('local' == Cypress.env('environment')) {
cy.wait('@searchresultsopensearch')
}

cy.get("#xssroot").find("h2").as("searchresultsheader")
cy.get("@searchresultsheader").should("exist")
cy.get("@searchresultsheader").contains(searchDetails.header)
cy.get('#xssroot').find('p').contains(searchDetails.body)

cy.get("#searchwicon-header").type("{enter}")
cy.location("pathname").should(
"eq",
"/search.html"
)

cy.get("#xssSearchPage").find("h2").as("searchpageresults")
cy.get("@searchpageresults").should("exist")
cy.get("@searchpageresults").contains(searchDetails.header)

if ('platformsh' == Cypress.env('site')) {
cy.get("#xssSearchPage").find("li").contains(searchDetails.body).should("exist")
} else {
cy.get("#xssSearchPage").contains(searchDetails.body)
}

})
})
})
// //Both should return results for "opensearch"
// //Only Upsun should return a match for "vertical scaling"
// //Only platform should return a match for "24.55 gb"
// describe("Searches",()=>{
// beforeEach(()=>{
// if('local' == Cypress.env('environment')) {
// cy.intercept("/indexes/*_docs/search*", { "hits":[] })
// }

// //cy.visit("/")
// })

// context("Search tests",()=>{
// it("Searches for something that should match in both", () => {
// cy.visit("/")
// if('local' == Cypress.env('environment')) {
// cy.intercept({
// pathname: '/indexes/*_docs/search',
// query: {
// q: 'opensearch'
// }
// },{ fixture: "opensearchresults" }).as("searchresultsopensearch")
// }

// cy.wait(1000)
// cy.get("#searchwicon-header").type("opensearch")

// if ('local' == Cypress.env('environment')) {
// cy.wait('@searchresultsopensearch')
// }

// cy.get("#xssroot").find("h2").as("searchresultsheader")
// cy.get("@searchresultsheader").should("exist")
// cy.get("@searchresultsheader").contains("Documentation")
// cy.get("#xssroot").find("li").contains("OpenSearch").should("exist")

// cy.get("#searchwicon-header").type("{enter}")
// cy.location("pathname").should(
// "eq",
// "/search.html"
// )

// cy.get("#xssSearchPage").find("h2").as("searchpageresults")
// cy.get("@searchpageresults").should("exist")
// cy.get("@searchpageresults").contains("Documentation")

// cy.get("#xssSearchPage").find("li").contains("OpenSearch").should("exist")

// })

// it("Searches for something that should not match on Platformsh, but should on Upsun", ()=>{
// const searchDetails = {
// search: 'vertical scaling',
// header: 'No results',
// body: 'No documentation matched'
// }

// if ('upsun' == Cypress.env('site')) {
// searchDetails.header = 'Documentation'
// searchDetails.body = searchDetails.search
// }

// cy.visit("/")
// cy.wait(1000)
// cy.get("#searchwicon-header").type(searchDetails.search)
// cy.get("#xssroot").find("h2").as("searchresultsheader")
// cy.get("@searchresultsheader").should("exist")
// cy.get("@searchresultsheader").contains(searchDetails.header)
// cy.get("#xssroot").find("p").contains(searchDetails.body)

// cy.get("#searchwicon-header").type("{enter}")
// cy.location("pathname").should(
// "eq",
// "/search.html"
// )

// cy.get("#xssSearchPage").find("h2").as("searchpageresults")
// cy.get("@searchpageresults").should("exist")
// if ('upsun' == Cypress.env('site')) {
// cy.get("#xssSearchPage").find("li").contains(searchDetails.body).should("exist")
// } else {
// cy.get("#xssSearchPage").contains(searchDetails.header)
// }

// })

// it("Searches for something that should ONLY match on platformsh, but not on Upsun", () => {
// const searchDetails = {
// search: '24.55',
// header: 'No results',
// body: 'No documentation matched'
// }

// console.log('Current site is ' + Cypress.env('site'))

// if ('platformsh' == Cypress.env('site')) {
// searchDetails.header = 'Documentation'
// searchDetails.body = searchDetails.search
// }

// cy.visit("/")
// if('local' == Cypress.env('environment')) {
// cy.intercept({
// pathname: '/indexes/*_docs/search',
// query: {
// q: 'opensearch'
// }
// },{ fixture: "searchosresults" }).as("searchresultsopensearch")
// }

// //console.log('Pausing before starting')
// cy.wait(1000)
// //console.log('finished pausing')

// cy.get("#searchwicon-header").clear().type(searchDetails.search)

// if ('local' == Cypress.env('environment')) {
// cy.wait('@searchresultsopensearch')
// }

// cy.get("#xssroot").find("h2").as("searchresultsheader")
// cy.get("@searchresultsheader").should("exist")
// cy.get("@searchresultsheader").contains(searchDetails.header)
// cy.get('#xssroot').find('p').contains(searchDetails.body)

// cy.get("#searchwicon-header").type("{enter}")
// cy.location("pathname").should(
// "eq",
// "/search.html"
// )

// cy.get("#xssSearchPage").find("h2").as("searchpageresults")
// cy.get("@searchpageresults").should("exist")
// cy.get("@searchpageresults").contains(searchDetails.header)

// if ('platformsh' == Cypress.env('site')) {
// cy.get("#xssSearchPage").find("li").contains(searchDetails.body).should("exist")
// } else {
// cy.get("#xssSearchPage").contains(searchDetails.body)
// }

// })
// })
// })
2 changes: 1 addition & 1 deletion sites/platform/build_docs.sh
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
set -e

# Build Interface app for search/autocomplete
npm run build:search
# npm run build:search

# Copy templates index so it will be served for search to grab
mkdir static/files/indexes && cp ../../shared/data/templates.yaml static/files/indexes/templates.yaml
36 changes: 0 additions & 36 deletions sites/platform/deploy.sh

This file was deleted.

1 change: 0 additions & 1 deletion sites/platform/package.json
Original file line number Diff line number Diff line change
@@ -53,7 +53,6 @@
"tailwindcss": "^3.2.6"
},
"workspaces": [
"static/scripts/xss",
"../themes/psh-docs"
],
"remarkConfig": {
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ hooks:
# The configuration of the application when it is exposed to the web.
web:
commands:
# Run (404) error handler
# Run (404) error handler
start: node 404.js
locations:
'/':
@@ -45,9 +45,4 @@ web:

disk: 1024

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

size: S
8 changes: 0 additions & 8 deletions sites/platform/static/scripts/xss/.babelrc

This file was deleted.

40 changes: 0 additions & 40 deletions sites/platform/static/scripts/xss/.eslintrc.json

This file was deleted.

4 changes: 0 additions & 4 deletions sites/platform/static/scripts/xss/.gitignore

This file was deleted.

Empty file.
32 changes: 0 additions & 32 deletions sites/platform/static/scripts/xss/README.md

This file was deleted.

Empty file.
Empty file.
46 changes: 0 additions & 46 deletions sites/platform/static/scripts/xss/package.json

This file was deleted.

19 changes: 0 additions & 19 deletions sites/platform/static/scripts/xss/src/App.js

This file was deleted.

39 changes: 0 additions & 39 deletions sites/platform/static/scripts/xss/src/components/Suggestions.js

This file was deleted.

This file was deleted.

184 changes: 0 additions & 184 deletions sites/platform/static/scripts/xss/src/containers/Search.js

This file was deleted.

22 changes: 0 additions & 22 deletions sites/platform/static/scripts/xss/src/index.js

This file was deleted.

45 changes: 0 additions & 45 deletions sites/platform/static/scripts/xss/webpack.common.js

This file was deleted.

33 changes: 0 additions & 33 deletions sites/platform/static/scripts/xss/webpack.dev.js

This file was deleted.

6 changes: 0 additions & 6 deletions sites/platform/static/scripts/xss/webpack.prod.js

This file was deleted.

2 changes: 1 addition & 1 deletion sites/upsun/build_docs.sh
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
set -e

# Build Interface app for search/autocomplete
npm run build:search
# npm run build:search

# Copy templates index so it will be served for search to grab
mkdir static/files/indexes && cp ../../shared/data/templates.yaml static/files/indexes/templates.yaml
36 changes: 0 additions & 36 deletions sites/upsun/deploy.sh

This file was deleted.

8 changes: 2 additions & 6 deletions sites/upsun/local_docs.sh
Original file line number Diff line number Diff line change
@@ -7,12 +7,8 @@ pwd
cd docs
npm install
npm run dev
npm run build:search
hugo

# Export master key again in this process.
export MEILI_MASTER_KEY=test
./deploy.sh
# npm run build:search
hugo

# 2. Update the Meilisearch server.

1 change: 0 additions & 1 deletion sites/upsun/package.json
Original file line number Diff line number Diff line change
@@ -51,7 +51,6 @@
"tailwindcss": "^3.2.6"
},
"workspaces": [
"static/scripts/xss",
"../themes/psh-docs"
],
"remarkConfig": {
8 changes: 0 additions & 8 deletions sites/upsun/static/scripts/xss/.babelrc

This file was deleted.

40 changes: 0 additions & 40 deletions sites/upsun/static/scripts/xss/.eslintrc.json

This file was deleted.

4 changes: 0 additions & 4 deletions sites/upsun/static/scripts/xss/.gitignore

This file was deleted.

Empty file.
32 changes: 0 additions & 32 deletions sites/upsun/static/scripts/xss/README.md

This file was deleted.

Empty file.
Empty file.
46 changes: 0 additions & 46 deletions sites/upsun/static/scripts/xss/package.json

This file was deleted.

19 changes: 0 additions & 19 deletions sites/upsun/static/scripts/xss/src/App.js

This file was deleted.

39 changes: 0 additions & 39 deletions sites/upsun/static/scripts/xss/src/components/Suggestions.js

This file was deleted.

This file was deleted.

178 changes: 0 additions & 178 deletions sites/upsun/static/scripts/xss/src/containers/Search.js

This file was deleted.

22 changes: 0 additions & 22 deletions sites/upsun/static/scripts/xss/src/index.js

This file was deleted.

45 changes: 0 additions & 45 deletions sites/upsun/static/scripts/xss/webpack.common.js

This file was deleted.

33 changes: 0 additions & 33 deletions sites/upsun/static/scripts/xss/webpack.dev.js

This file was deleted.

6 changes: 0 additions & 6 deletions sites/upsun/static/scripts/xss/webpack.prod.js

This file was deleted.

2 changes: 1 addition & 1 deletion tests.sh
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ pwd
npm ci

# 2. Build search script
npm run build:search
# npm run build:search

# 3. Build Hugo site
hugo
13 changes: 5 additions & 8 deletions themes/psh-docs/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -10,12 +10,12 @@
{{ partial "header/header" . }}

<!--If in the Get started section, define context and methods. -->
<div class="grid md:grid-cols-10 divide-x-4 mt-24 print:mt-4 print:block print:mx-2"
<div class="grid md:grid-cols-10 divide-x-4 print:mt-4 print:block print:mx-2"
{{ if eq .Section "get-started" }}
{{ if eq $.Site.Params.vendor.name "Platform.sh" }}
x-data="{
x-data="{
stack: new URLSearchParams(location.search).get('stack') || 'php',
switchStack(targetStack) {
switchStack(targetStack) {
this.stack = targetStack
const url = new URL(window.location.href);
@@ -28,7 +28,7 @@
history.pushState(null, document.title, url.toString());
},
frametech: 'default',
switchFrametech(targetFrametech) {
switchFrametech(targetFrametech) {
this.frametech = targetFrametech;
}
}"
@@ -40,15 +40,12 @@

<!-- Main content block -->
<main class="md:col-span-8 xl:max-w-[120ch] xl:text-lg px-4 md:pr-0 md:pl-8 pt-4 pb-12 print:border-none print:max-w-full xl:print:max-w-full print:text-sm xl:print:text-sm">

{{- block "main" . }}{{- end }}
</main>

</div>

<!-- XSS bundle -->
<script src="{{printf "/scripts/xss/dist/bundle.js?version=%s" .Site.Params.version | relURL}}"></script>

{{ if .Page.Store.Get "hasMermaid" }}
<!-- MermaidJS support -->
<script async src="{{ printf "/mermaid/mermaid.min.js?version=%s" $.Site.Params.version }}"></script>
2 changes: 1 addition & 1 deletion themes/psh-docs/layouts/partials/header/search.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Header search -->

{{ if eq ( index .Site.Params.theme "use_vendor") true }}
<div id="xssroot" class="basis-3/4 md:basis-7/12 pl-8 pr-4"></div>
<div id="xssroot" class="basis-3/4 md:basis-7/12 pl-8 pr-4 bg-red-500"></div>
{{ else }}
<div id="xssroot" class="basis-3/4 md:basis-4/6 pl-8 pr-4"></div>
{{ end }}
1 change: 0 additions & 1 deletion themes/psh-docs/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ module.exports = {
"./content/**/*.{html,md}",
"../../themes/**/layouts/**/*.html",
"../../themes/**/content/**/*.{html,md}",
"./static/scripts/xss/**/*.js"
],
safelist: ['-rotate-90','bg-pink-light'],
theme: {

Unchanged files with check annotations Beta

conceptual guides to help you understand the ins and outs of {{% vendor/name
%}}.
- [**What is {{% vendor/name %}}?**](/learn/overview/_index.md)

Check warning on line 40 in sites/platform/src/_index.md

GitHub Actions / Lint markdown (platform)

Incorrect list-item indent: add 2 spaces
With this guide, find out which problem {{% vendor/name %}} is trying to
solve. Learn how {{% vendor/name %}}'s configuration, build and deploy
pipelines, and the structure of environments play into the broader
philosophy behind reliably deploying applications.
- [**Tutorials**](/learn/tutorials/_index.md)

Check warning on line 47 in sites/platform/src/_index.md

GitHub Actions / Lint markdown (platform)

Incorrect list-item indent: add 2 spaces
Once you're familiar with {{% vendor/name %}}, its basic rules and
philosophy, you may be curious about how you can replicate common workflows
backups to exporting data, the [**Tutorials**](/learn/tutorials/_index.md)
provide all the information you need.
- [**Best practices**](/learn/bestpractices/_index.md)

Check warning on line 55 in sites/platform/src/_index.md

GitHub Actions / Lint markdown (platform)

Incorrect list-item indent: add 2 spaces
{{% vendor/name %}} makes deploying and managing infrastructure no
different than working with Git. As your work becomes more experimental,
| Language | Frameworks |
| :---------------- | :------ |
| [Python](/languages/python/_index.md) | [Django](/guides/django/_index.md) |

Check warning on line 74 in sites/platform/src/_index.md

GitHub Actions / Lint markdown (platform)

Misaligned table fence

Check warning on line 74 in sites/platform/src/_index.md

GitHub Actions / Lint markdown (platform)

Misaligned table fence
| [PHP](/languages/php/_index.md) | [Drupal](/guides/drupal/_index.md)<br/>[Ibexa](/guides/ibexa/_index.md)<br/>[Laravel](/guides/laravel/_index.md)<br/>[Symfony](/guides/symfony/_index.md)<br/>[TYPO3](/guides/typo3/_index.md)<br/>[WordPress](/guides/wordpress/_index.md) |

Check warning on line 75 in sites/platform/src/_index.md

GitHub Actions / Lint markdown (platform)

Misaligned table fence

Check warning on line 75 in sites/platform/src/_index.md

GitHub Actions / Lint markdown (platform)

Cell should be padded with 1 space, not 3

Check warning on line 75 in sites/platform/src/_index.md

GitHub Actions / Lint markdown (platform)

Cell should be padded with 1 space, not 3

Check warning on line 75 in sites/platform/src/_index.md

GitHub Actions / Lint markdown (platform)

Misaligned table fence
| [Javascript/Node.js](/languages/nodejs/_index.md) | [Gatsby](/guides/gatsby/_index.md)<br/>[Next.js](/guides/nextjs/_index.md)<br/>[Strapi](/guides/strapi/_index.md) |

Check warning on line 76 in sites/platform/src/_index.md

GitHub Actions / Lint markdown (platform)

Cell should be padded with 1 space, not 5
| [Java](/languages/java/_index.md) | [Hibernate](/guides/hibernate/_index.md)<br/>[Jakarta](/guides/jakarta/_index.md)<br/>[Micronaut](/guides/micronaut/_index.md)<br/>[Quarkus](/guides/quarkus/_index.md)<br/>[Spring](/guides/spring/_index.md) |
### Reference
conceptual guides to help you understand the ins and outs of {{% vendor/name
%}}.
- [**What is {{% vendor/name %}}?**](/learn/overview/_index.md)

Check warning on line 40 in sites/upsun/src/_index.md

GitHub Actions / Lint markdown (upsun)

Incorrect list-item indent: add 2 spaces
With this guide, find out which problem {{% vendor/name %}} is trying to
solve. Learn how {{% vendor/name %}}'s configuration, build and deploy
pipelines, and the structure of environments play into the broader
philosophy behind reliably deploying applications.
- [**Tutorials**](/learn/tutorials/_index.md)

Check warning on line 47 in sites/upsun/src/_index.md

GitHub Actions / Lint markdown (upsun)

Incorrect list-item indent: add 2 spaces
Once you're familiar with {{% vendor/name %}}, its basic rules and
philosophy, you may be curious about how you can replicate common workflows
backups to exporting data, the [**Tutorials**](/learn/tutorials/_index.md)
provide all the information you need.
- [**Best practices**](/learn/bestpractices/_index.md)

Check warning on line 55 in sites/upsun/src/_index.md

GitHub Actions / Lint markdown (upsun)

Incorrect list-item indent: add 2 spaces
{{% vendor/name %}} makes deploying and managing infrastructure no
different than working with Git. As your work becomes more experimental,
### Get support
If you're experiencing issues with your projects, don't hesitate to open a
[support ticket](/learn/overview/get-support.md).

Check warning on line 117 in sites/upsun/src/_index.md

GitHub Actions / Lint markdown (upsun)

Remove 1 line after node
Because the services are included in your project, you can manage them through Git
and they're backed up together with the rest of your project.
Your project defines the services configuration from a top-level key called `services`, which is placed in a unified configuration file like `{{< vendor/configfile "services" >}}`.

Check warning on line 14 in sites/upsun/src/add-services/_index.md

GitHub Actions / Lint markdown (upsun)

Line must be at most 140 characters
If you don't need any services (such as for a static website), you don't need to include this configuration. Read on to see how to add services.

Check warning on line 16 in sites/upsun/src/add-services/_index.md

GitHub Actions / Lint markdown (upsun)

Line must be at most 140 characters
## Add a service
This YAML file contains a dictionary defining all of the services you want to use.
The top-level key `services` defines an object of all of the services to be provisioned for the project.
Below that, come custom service names ({{<variable "SERVICE_NAME" >}}; in the example, `mariadb` and `postgresql`), which you use to identify the service in step 2.

Check warning on line 50 in sites/upsun/src/add-services/_index.md

GitHub Actions / Lint markdown (upsun)

Line must be at most 140 characters
You can give it any name you want with lowercase alphanumeric characters, hyphens, and underscores.
| Name | Type | Required | Description |
| --------------- | ---------- | ----------------- | ----------- |
| `type` | `string` | Yes | One of the [available services](#available-services) in the format `type:version`. |

Check warning on line 68 in sites/upsun/src/add-services/_index.md

GitHub Actions / Lint markdown (upsun)

Misaligned table fence
| `configuration` | dictionary | For some services | Some services have additional specific configuration options that can be defined here, such as specific endpoints. See the given service page for more details. |

Check warning on line 69 in sites/upsun/src/add-services/_index.md

GitHub Actions / Lint markdown (upsun)

Misaligned table fence
| `relationships` | dictionary | For some services | Some services require a relationship to your app. The content of the dictionary has the same type as the `relationships` dictionary for [app configuration](/create-apps/app-reference/single-runtime-image.md#relationships). The `endpoint_name` for apps is always `http`. |

Check warning on line 70 in sites/upsun/src/add-services/_index.md

GitHub Actions / Lint markdown (upsun)

Misaligned table fence
##### Resources (CPU, RAM, disk)