62 lines
2.0 KiB
YAML
62 lines
2.0 KiB
YAML
x-yaml-aliases:
|
|
commands:
|
|
- &hugo_build_environment_setup |
|
|
# Install package dependencies
|
|
apk add nodejs npm git hugo
|
|
# Install the node dependencies necessary to build the spec
|
|
npm i
|
|
# Pull all git submodules, required for the hugo theme
|
|
git submodule update --init --recursive
|
|
# Pull current proposal information
|
|
npm run get-proposals
|
|
|
|
steps:
|
|
- label: ":snake: Build swagger definitions for matrix.org"
|
|
command:
|
|
# Install the python dependencies necessary to build the spec
|
|
- python3 -m venv env && . env/bin/activate
|
|
- pip install -r scripts/requirements.txt
|
|
# Build the spec
|
|
- scripts/generate-matrix-org-assets
|
|
artifact_paths:
|
|
- assets.tar.gz
|
|
plugins:
|
|
- docker#v3.7.0:
|
|
image: python:3.9
|
|
|
|
- label: "rebuild matrix.org"
|
|
trigger: "matrix-dot-org"
|
|
async: true
|
|
branches: "master"
|
|
|
|
- label: ":books: Build the spec"
|
|
command:
|
|
- *hugo_build_environment_setup
|
|
# Build the spec, will build to './spec'
|
|
# Set the baseURL as we're deploying to https://spec.matrix.org/unstable
|
|
- hugo --baseURL "/unstable" -d "spec"
|
|
# Compress the result and make it available as an artifact
|
|
- tar -czf spec.tar.gz spec
|
|
artifact_paths:
|
|
- spec.tar.gz
|
|
plugins:
|
|
- docker#v3.7.0:
|
|
image: alpine
|
|
|
|
- label: ":rocket: Release the spec"
|
|
# Only execute this step on tags matching "vX.Y"
|
|
if: build.tag =~ /^v\d+\.\d+$$/
|
|
command:
|
|
- *hugo_build_environment_setup
|
|
# Generate a stable version of the spec
|
|
- scripts/prepare-spec-release.sh "$BUILDKITE_TAG" spec
|
|
# Package the build as an artifact, which will be downloaded by:
|
|
# https://github.com/matrix-org/buildkite-webhook-listener
|
|
- tar -czf spec-release.tar.gz spec
|
|
artifact_paths:
|
|
- spec-release.tar.gz
|
|
plugins:
|
|
- docker#v3.7.0:
|
|
image: alpine
|
|
mount-buildkite-agent: false
|
|
propogate-environment: true |