matrix-doc/.circleci/config.yml

65 lines
1.8 KiB
YAML
Raw Permalink Normal View History

2018-07-06 03:29:12 +00:00
gendoc: &gendoc
name: Generate the docs
command: |
source /env/bin/activate
scripts/gendoc.py
genswagger: &genswagger
2018-07-06 03:39:45 +00:00
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
2018-07-06 03:18:28 +00:00
version: 2
jobs:
build-docs:
docker:
2018-07-06 03:29:12 +00:00
- image: uhoreg/matrix-doc-build
2018-07-06 03:18:28 +00:00
steps:
- checkout
2018-07-06 03:29:12 +00:00
- run: *gendoc
2018-07-06 03:31:57 +00:00
- 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
2018-07-06 03:18:28 +00:00
2018-07-06 03:39:45 +00:00
build-swagger:
docker:
- image: uhoreg/matrix-doc-build
steps:
- checkout
- run: *genswagger
- run: *buildswaggerui
2018-07-06 03:39:45 +00:00
- store_artifacts:
path: api/client-server/
2018-07-06 03:39:45 +00:00
- 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
2018-07-06 03:39:45 +00:00
2018-07-06 03:18:28 +00:00
workflows:
version: 2
2018-07-06 03:39:45 +00:00
build-spec:
2018-07-06 03:18:28 +00:00
jobs:
- build-docs
2018-07-06 03:39:45 +00:00
- build-swagger
2018-07-06 03:18:28 +00:00
notify:
webhooks:
- url: https://giles.cadair.com/circleci