| #!/bin/bash |
| set -e |
| |
| function usage() { |
| echo "Updates dokka prebuilts" |
| echo "Usage: update_dokka.sh <build-id>" |
| echo |
| echo "<build-id> should be a number chosen from ab/aosp-dokka-master-dev" |
| exit 1 |
| } |
| |
| |
| buildId="$1" |
| if [ "$buildId" == "" ]; then |
| usage |
| fi |
| |
| tempDir=/tmp |
| destDir="$(cd $(dirname $0) && pwd)" |
| |
| function downloadArtifact() { |
| cd "$tempDir" |
| echo "Downloading dokka from build $buildId" |
| /google/data/ro/projects/android/fetch_artifact --bid "$buildId" --target dokka 'maven.zip' |
| rm -fr dokka-maven |
| unzip maven.zip -d dokka-maven |
| } |
| downloadArtifact |
| |
| function copyNewPrebuilts() { |
| cp -r dokka-maven/* "${destDir}" |
| } |
| copyNewPrebuilts |
| |
| function gitCommit() { |
| cd "${destDir}" |
| git add . |
| git commit -m "Import dokka from build ${buildId}" |
| } |
| gitCommit |