Files
GitJournal/scripts/install_latest_artifact.sh
Vishesh Handa 90a6df2239 CI: Store the AAB as an artifact
Instead of the apk which is no longer generated
2019-07-28 03:17:16 +02:00

16 lines
519 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
BUILD_NUM=`curl -s 'https://circleci.com/api/v1.1/project/github/GitJournal/GitJournal?limit=1&offset=0&filter=successful' | jq .[0] | jq -r .build_num`
echo "CircleCI Buld Number: $BUILD_NUM"
URL=`curl -s https://circleci.com/api/v1.1/project/github/GitJournal/GitJournal/$BUILD_NUM/artifacts | jq .[0] | jq -r .url`
APK_LOCATION="/tmp/gitjournal.aab"
echo "Downloading $URL"
curl "$URL" -o "$APK_LOCATION"
adb uninstall io.gitjournal.gitjournal || true
adb install -r "$APK_LOCATION"