|
|
|
gendoc: &gendoc
|
|
|
|
name: Generate the docs
|
|
|
|
command: |
|
|
|
|
source /env/bin/activate
|
|
|
|
scripts/gendoc.py
|
|
|
|
|
|
|
|
genswagger: &genswagger
|
|
|
|
name: Generate the swagger
|
|
|
|
command: |
|
|
|
|
source /env/bin/activate
|
|
|
|
scripts/dump-swagger.py
|
|
|
|
|
|
|
|
buildswaggerui: &buildswaggerui
|
|
|
|
name: Build Swagger UI
|
|
|
|
command: |
|
|
|
|
ls scripts/
|
|
|
|
mkdir -p api/client-server
|
|
|
|
git clone https://github.com/matrix-org/swagger-ui swagger-ui
|
|
|
|
cp -r swagger-ui/dist/* api/client-server/
|
|
|
|
mkdir -p api/client-server/json
|
|
|
|
cp scripts/swagger/api-docs.json api/client-server/json/
|
|
|
|
wget https://raw.githubusercontent.com/matrix-org/matrix.org/master/content/swagger.css -O api/client-server/swagger.css
|
|
|
|
wget https://raw.githubusercontent.com/matrix-org/matrix.org/master/scripts/swagger-ui.patch
|
|
|
|
patch api/client-server/index.html swagger-ui.patch
|
|
|
|
|
|
|
|
checkexamples: &checkexamples
|
|
|
|
name: Check Event Examples
|
|
|
|
command: |
|
|
|
|
source /env/bin/activate
|
|
|
|
cd event-schemas
|
|
|
|
./check_examples.py
|
|
|
|
cd ../api
|
|
|
|
./check_examples.py
|
|
|
|
|
|
|
|
genmatrixassets: &genmatrixassets
|
|
|
|
name: Generate/Verify matrix.org assets
|
|
|
|
command: |
|
|
|
|
source /env/bin/activate
|
|
|
|
./scripts/generate-matrix-org-assets
|
|
|
|
|
|
|
|
|
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
check-docs:
|
|
|
|
docker:
|
|
|
|
- image: uhoreg/matrix-doc-build
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: *checkexamples
|
|
|
|
- run: *genmatrixassets # We don't actually use the assets, but we do want to make sure they build
|
|
|
|
build-docs:
|
|
|
|
docker:
|
|
|
|
- image: uhoreg/matrix-doc-build
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: *gendoc
|
|
|
|
- store_artifacts:
|
|
|
|
path: scripts/gen
|
|
|
|
- run:
|
|
|
|
name: "Doc build is available at:"
|
|
|
|
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/scripts/gen/index.html"; echo $DOCS_URL
|
|
|
|
|
|
|
|
build-swagger:
|
|
|
|
docker:
|
|
|
|
- image: uhoreg/matrix-doc-build
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: *genswagger
|
|
|
|
- run: *buildswaggerui
|
|
|
|
- store_artifacts:
|
|
|
|
path: api/client-server/
|
|
|
|
- run:
|
|
|
|
name: "Swagger UI is available at:"
|
|
|
|
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/api/client-server/index.html"; echo $DOCS_URL
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
|
|
|
|
build-spec:
|
|
|
|
jobs:
|
|
|
|
- build-docs
|
|
|
|
- build-swagger
|
|
|
|
- check-docs
|
|
|
|
|
|
|
|
notify:
|
|
|
|
webhooks:
|
|
|
|
- url: https://giles.cadair.com/circleci
|