diff --git a/doc/Makefile b/doc/Makefile index d289fc66..fe3b0013 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -14,6 +14,9 @@ help: .PHONY: help Makefile +dist: html + @cd $(BUILDDIR)/html/ && zip -r9 ../../html.zip * + # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile diff --git a/taskcluster/.shared.yml b/taskcluster/.shared.yml index d9d59707..8d480b8c 100644 --- a/taskcluster/.shared.yml +++ b/taskcluster/.shared.yml @@ -6,6 +6,8 @@ python: brew: setup: 'install_local_homebrew "python-ds-test" && install_pkg_local_homebrew "sox" && install_pkg_local_homebrew "readline" && install_pkg_local_homebrew "openssl" && install_pkg_local_homebrew "pkg-config"' env: 'export EXTRA_ENV="PATH=$TASKCLUSTER_TASK_DIR/python-ds-test.brew/bin/:$PATH"' + packages_docs_bionic: + apt: 'python3 python3-pip zip doxygen' electronjs: packages_xenial: apt: 'libatk1.0-0 libatk-bridge2.0-0 libcairo2 libcups2 libdbus-1-3 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 xvfb' @@ -25,6 +27,10 @@ nodejs: prep_10: 'echo "deb http://deb.nodesource.com/node_10.x xenial main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' prep_11: 'echo "deb http://deb.nodesource.com/node_11.x xenial main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' prep_12: 'echo "deb http://deb.nodesource.com/node_12.x xenial main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' + packages_docs_bionic: + apt: 'nodejs' + apt_pinning: '(echo "Package: nodejs" && echo "Pin: origin deb.nodesource.com" && echo "Pin-Priority: 999") > /etc/apt/preferences' + prep_12: 'echo "deb http://deb.nodesource.com/node_12.x bionic main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' packages_buster: apt: 'nodejs sox' apt_pinning: '(echo "Package: nodejs" && echo "Pin: origin deb.nodesource.com" && echo "Pin-Priority: 999") > /etc/apt/preferences' diff --git a/taskcluster/docs-build.sh b/taskcluster/docs-build.sh new file mode 100644 index 00000000..c6331f0f --- /dev/null +++ b/taskcluster/docs-build.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -xe + +THIS=$(dirname "$0") + +pushd ${THIS}/../ + export PATH=$HOME/.local/bin:${THIS}/../doc/node_modules/.bin/:$PATH + make -C doc/ html dist +popd diff --git a/taskcluster/docs-package.sh b/taskcluster/docs-package.sh new file mode 100644 index 00000000..af87a9c1 --- /dev/null +++ b/taskcluster/docs-package.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -xe + +source $(dirname "$0")/tc-tests-utils.sh + +mkdir -p ${TASKCLUSTER_ARTIFACTS} || true + +cp ${DS_DSDIR}/doc/html.zip ${TASKCLUSTER_ARTIFACTS}/doc-html.zip diff --git a/taskcluster/docs-requirements.txt b/taskcluster/docs-requirements.txt new file mode 100644 index 00000000..8ca245ff --- /dev/null +++ b/taskcluster/docs-requirements.txt @@ -0,0 +1,5 @@ +breathe==4.13.1 +semver==2.8.1 +sphinx==2.2.0 +sphinx-js==2.8 +sphinx-rtd-theme==0.4.3 diff --git a/taskcluster/docs.tyml b/taskcluster/docs.tyml new file mode 100644 index 00000000..f015c396 --- /dev/null +++ b/taskcluster/docs.tyml @@ -0,0 +1,64 @@ +$if: 'event.event in build.allowed' +then: + taskId: ${taskcluster.taskId} + provisionerId: ${taskcluster.docker.provisionerId} + workerType: ${taskcluster.docker.workerType} + taskGroupId: ${taskcluster.taskGroupId} + schedulerId: ${taskcluster.schedulerId} + dependencies: + $map: { $eval: build.dependencies } + each(b): + $eval: as_slugid(b) + created: { $fromNow: '0 sec' } + deadline: { $fromNow: '1 day' } + expires: + $if: '(event.event == "push") || (event.event == "tag")' + then: { $fromNow: '6 months' } + else: { $fromNow: '7 days' } + + extra: + nc_asset_name: { $eval: build.nc_asset_name } + github: + $if: '(event.event == "push") || (event.event == "tag")' + then: { $eval: taskcluster.github_events.merge } + else: { $eval: taskcluster.github_events.pull_request } + + routes: + $if: '(event.event == "push") || (event.event == "tag")' + then: + { $eval: build.routes } + + payload: + maxRunTime: { $eval: to_int(build.maxRunTime) } + image: "ubuntu:18.04" + + command: + - "/bin/bash" + - "--login" + - "-cxe" + - $let: + extraSystemSetup: { $eval: strip(str(build.system_setup)) } + extraSystemConfig: { $eval: strip(str(build.system_config)) } + in: > + apt-get -qq update && apt-get -qq -y install git wget gnupg sudo && ${extraSystemSetup} && + adduser --system --home ${system.homedir.linux} ${system.username} && + cd ${system.homedir.linux}/ && + echo -e "#!/bin/bash\nset -xe\n env && id && git clone --quiet ${event.head.repo.url} ~/DeepSpeech/ds/ && cd ~/DeepSpeech/ds && git checkout --quiet ${event.head.sha}" > /tmp/clone.sh && chmod +x /tmp/clone.sh && + sudo -H -u ${system.username} /bin/bash /tmp/clone.sh && ${extraSystemConfig} && + sudo -H -u ${system.username} --preserve-env /bin/bash ${system.homedir.linux}/DeepSpeech/ds/${build.scripts.build} && + sudo -H -u ${system.username} /bin/bash ${system.homedir.linux}/DeepSpeech/ds/${build.scripts.package} + + artifacts: + "public": + type: "directory" + path: "/tmp/artifacts/" + expires: + $if: '(event.event == "push") || (event.event == "tag")' + then: { $fromNow: '6 months' } + else: { $fromNow: '7 days' } + + metadata: + name: ${build.metadata.name} + description: ${build.metadata.description} + owner: ${event.head.user.email} + source: ${event.head.repo.url} diff --git a/taskcluster/docs.yml b/taskcluster/docs.yml new file mode 100644 index 00000000..d02e2844 --- /dev/null +++ b/taskcluster/docs.yml @@ -0,0 +1,18 @@ +build: + template_file: docs.tyml + routes: + - "index.project.deepspeech.deepspeech.native_client.${event.head.branchortag}.docs" + - "index.project.deepspeech.deepspeech.native_client.${event.head.branchortag}.${event.head.sha}.docs" + - "index.project.deepspeech.deepspeech.native_client.docs.${event.head.sha}" + - "notify.irc-channel.${notifications.irc}.on-exception" + - "notify.irc-channel.${notifications.irc}.on-failed" + system_setup: + > + ${nodejs.packages_docs_bionic.prep_12} && ${nodejs.packages_docs_bionic.apt_pinning} + && apt-get -qq update && apt-get -qq -y install ${nodejs.packages_docs_bionic.apt} ${python.packages_docs_bionic.apt} + scripts: + build: "taskcluster/docs-build.sh" + package: "taskcluster/docs-package.sh" + metadata: + name: "DeepSpeech API Documentation" + description: "Building DeepSpeech API Documentation"