-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: ci | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Configure Git Credentials | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- run: pip install mkdocs-material | ||
- run: mkdocs gh-deploy --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Deployment | ||
|
||
## Clone the repositories | ||
|
||
First, we need to clone `brick-server-minimal`, `brick-server-playground`, `brick-server-frontend`, and `genie-brickified` repos into a same directory. | ||
|
||
```bash | ||
mkdir brick | ||
git clone https://github.com/BrickSchema/brick-example-server | ||
git clone https://github.com/BrickSchema/playground | ||
git clone | ||
``` | ||
|
||
## Configuration | ||
|
||
Create a `.env` file in the playground directory. The file can be used to configure the playground server. | ||
The detailed configurable items can be found [here](config.md). | ||
|
||
```bash | ||
cd playground | ||
touch .env | ||
|
||
``` | ||
|
||
## Deploy the server | ||
|
||
=== "Docker (recommended)" | ||
|
||
In the playground directory, run | ||
|
||
```bash | ||
docker-compose up --build -d # (1)! | ||
``` | ||
|
||
1. make sure the context is correct if not using `docker-compose` but `docker build` | ||
and make sure the `docker-compose` version is at least `v2` | ||
|
||
=== "Direct" | ||
|
||
(Not yet completed) | ||
|
||
Then, open `http://localhost:9000/brickapi/v1/docs`. If the swagger API page is shown, congratulations! | ||
Now you can move to the [next step](init.md) in initialize playground. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Initialization | ||
|
||
## Register admin user | ||
|
||
=== "Username / Password" | ||
|
||
|
||
|
||
=== "Google OAuth2" | ||
|
||
Before using this, ensure that you have setup [Google OAuth2](config.md) in the configuration. | ||
|
||
Use the API `/brickapi/v1/auth/cookie/google/authorize` and the API will return a json response in the format | ||
|
||
```json | ||
{ | ||
"authorization_url": "https://accounts.google.com/o/oauth2/v2/auth?foo=bar" | ||
} | ||
``` | ||
|
||
Open `authorization_url` in the browser and continue with your google account. | ||
The page will be redirected back to the `FRONTEND_URL` entry in configuration. | ||
By default, it is the url of the Swagger API if you didn't set it. | ||
|
||
!!! note | ||
|
||
You can also register the admin user in the frontend. | ||
We recommand to do it in the Swagger API for convenience of debugging the setup. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
theme: | ||
name: material | ||
features: | ||
- content.code.copy | ||
- content.code.annotate | ||
site_name: Brick Server Playground | ||
docs_dir: docs | ||
markdown_extensions: | ||
- admonition | ||
- pymdownx.details | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
use_pygments: true | ||
pygments_lang_class: true | ||
# auto_title: true | ||
# linenums: true | ||
- pymdownx.inlinehilite | ||
- pymdownx.superfences | ||
- pymdownx.tabbed: | ||
alternate_style: true |