Files
GitJournal/scripts/install_latest_artifact.sh
Vishesh Handa 36bd074d84 install_latest_artifact: Make it work again
We now have 2 artifacts the aab and apk
2019-10-04 04:18:24 +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 .[1] | jq -r .url`
APK_LOCATION="/tmp/gitjournal.apk"
echo "Downloading $URL"
curl "$URL" -o "$APK_LOCATION"
adb uninstall io.gitjournal.gitjournal || true
adb install -r "$APK_LOCATION"