Commit 9be1e53d authored by Sebastian Kaspari's avatar Sebastian Kaspari
Browse files

Issue #1995: Add script for generating API docs on taskcluster.

parent 2483e824
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at
# If a command fails then do not proceed and fail this script too.
set -ex
# TODO: This script should only run if there's no PR open already.
# Setup git
git config --global ""
git config --global "MickeyMoz"
# Generate docs and copy to destination
./gradlew clean assemble docs
rm -rf docs/api
mkdir docs/api
cp -R build/javadoc/android-components/ docs/api
# Timestamp used in branch name and commit
TIMESTAMP=`date "+%Y%m%d-%H%M%S"`
# Create a branch and commit local changes
git checkout -b $BRANCH
git add docs/api
git commit -m \
"Update docs ($TIMESTAMP)" \
--author="MickeyMoz <>" \
|| { echo "No changes to commit"; exit 0; }
# Get token for using GitHub
python automation/taskcluster/helper/ \
-s project/mobile/github \
-k botAccountToken \
-f .github_token \
# From here on we do not want to print the commands since they contain tokens
set +x
TOKEN=`cat .github_token`
echo "token=$TOKEN" >
echo "Pushing branch to GitHub"
git push --no-verify --quiet $URL $BRANCH
echo "Done ($?)"
echo "Opening pull request"
./gradlew openPR -Ptitle="Docs update ($TIMESTAMP)" -Pbranch="$BRANCH" -PtokenFile=""
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment