From 41b80db911c825b639d15db126d8156703519ef9 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sun, 14 Jul 2019 10:04:11 +0200 Subject: keep build logs on failure in CI --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 69ae4ca5..6eb5f6ce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -105,6 +105,8 @@ build: - app/build/outputs/ - build_deps.log - build.log + when: always + expire_in: 3 days build_release: image: "0xacab.org:4567/leap/bitmask_android/android-ndk:latest" @@ -120,6 +122,8 @@ build_release: - productionRelease.log - productionBeta.log - build_deps.log + when: always + expire_in: 1 week when: manual build_custom_release: @@ -136,4 +140,6 @@ build_custom_release: - productionRelease.log - productionBeta.log - build_deps.log + when: always + expire_in: 1 week when: manual -- cgit v1.2.3 From 51f372eb071b2ce0cb8078bb327d5138af1ea62c Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sun, 14 Jul 2019 13:50:54 +0200 Subject: update build script for building and signing stable and beta releases of Bitmask and custom branded apps --- prepareForDistribution.sh | 89 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 70 insertions(+), 19 deletions(-) diff --git a/prepareForDistribution.sh b/prepareForDistribution.sh index 73f51186..51b03025 100755 --- a/prepareForDistribution.sh +++ b/prepareForDistribution.sh @@ -23,6 +23,9 @@ function cleanUp { DO_BUILD=false DO_SIGN=false BETA=false +APP_NAME="Bitmask" +FLAVOR="Normal" +FLAVOR_LOWERCASE="normal" # check global vars @@ -79,21 +82,57 @@ do elif [[ ${!i} = "-b" || ${!i} = "-beta" ]]; then BETA=true - + elif [[ ${!i} = "-c" || ${!i} = "-custom" ]] + then + ((i++)) + APP_NAME=${!i} + FLAVOR="Custom" + FLAVOR_LOWERCASE="custom" elif [[ ${!i} = "-h" || ${!i} = "-help" ]]; then - echo -e "example Usages: \n - jarsign only: - ------------- - ./prepareForDistribution.sh sign -f app/build/outputs/apk/app-production-beta.apk -ks ~/path/to/bitmask-android.keystore -b -v 0.9.7RC2 \n - jarsign and gpg sign only: - -------------------------- - ./prepareForDistribution.sh sign -f app/build/outputs/apk/app-production-beta.apk -ks ~/path/to/bitmask-android.keystore -u GPG_USER -b -v 0.9.7RC2 \n - build and sign beta: - -------------------- - ./prepareForDistribution.sh build sign -ks ~/path/to/bitmask-android.keystore -u GPG_USER -b -v 0.9.7RC2 \n + echo -e " + sign [-ks, -f, -b, -c] ---- sign a given apk + -b / -beta ---------------- add 'Beta' to filename of resulting apk (optional) + -c / -custom [appName] ---- mark build as custom branded Bitmask client and add + custom app name to resulting apk (required for custom + branded builds) + -ks / -keystore [path] ---- define path to keystore for signing (required) + -f / -file [inputfile] ---- define path to apk going to be signed (required if + sign command is not used in conjuction with build) + -v / -version [gittag] ---- define app version as part of the resulting apk file + name (required) + + build [-v, -c, -b] + -v / -version [gittag] ---- define the git version tag that needs to be checked out + for building. It's also part of the resulting apk file + name. (required) + -c / -custom -------------- build custom Bitmask client instead of main Bitmask client + (optional) + -b / -beta ---------------- add 'Beta' to filename (optional) + + + -h / -help print out this help + + + example Usages: + --------------- + + * jarsign only: + ./prepareForDistribution.sh sign -f app/build/outputs/apk/app-production-beta.apk -ks ~/path/to/bitmask-android.keystore -v 0.9.7 \n + + * jarsign and gpg sign only: + ./prepareForDistribution.sh sign -f app/build/outputs/apk/app-production-beta.apk -ks ~/path/to/bitmask-android.keystore -u GPG_USER -v 0.9.7 \n + + build custom stable + ./prepareForDistribution.sh build -v 0.9.7 -c RiseupVPN \n + + build and sign custom stable: + ./prepareForDistribution.sh build sign -ks ~/path/to/bitmask-android.keystore -u GPG_USER -v 0.9.7 -c RiseupVPN \n + + build and sign custom beta: + ./prepareForDistribution.sh build sign -ks ~/path/to/bitmask-android.keystore -u GPG_USER -b -v 0.9.7RC2 -c RiseupVPN \n + build and sign stable: - ---------------------- ./prepareForDistribution.sh build sign -ks ~/path/to/bitmask-android.keystore -u GPG_USER -v 0.9.7" exit @@ -123,11 +162,14 @@ then git checkout ${VERSION_NAME} || quit fi + ./cleanProject.sh || quit + ./build_deps.sh || quit + if [[ ${BETA} == true ]] then - ./gradlew clean assembleProductionBeta --stacktrace || quit + ./gradlew clean assemble${FLAVOR}ProductionBeta --stacktrace || quit else - ./gradlew clean assembleProductionRelease --stacktrace || quit + ./gradlew clean assemble${FLAVOR}ProductionRelease --stacktrace || quit fi fi @@ -151,13 +193,22 @@ then #---- OPT: SELECT APK FROM LAST BUILD ---- if [[ ${DO_BUILD} == true ]] then - FILE_DIR="$(pwd)/app/build/outputs/apk/" + BASE_FILE_DIR="$(pwd)/app/build/outputs/apk" if [[ ${BETA} == true ]] then - FILE_NAME="app-production-beta.apk" + FILE_NAME="app-${FLAVOR_LOWERCASE}-production-beta.apk" + BUILD_TYPE_DIR="beta" + else + FILE_NAME="app-${FLAVOR_LOWERCASE}-production-release.apk" + BUILD_TYPE_DIR="release" + fi + if [[ ${FLAVOR_LOWERCASE} == "normal" ]] + then + FLAVOR_DIR="normalProduction" else - FILE_NAME="app-production-release.apk" + FLAVOR_DIR="customProduction" fi + FILE_DIR="${BASE_FILE_DIR}/${FLAVOR_DIR}/${BUILD_TYPE_DIR}" fi #---- ALIGN AND JARSIGN APK ----- @@ -185,9 +236,9 @@ then then if [[ ${BETA} == true ]] then - FINAL_FILE_NAME="Bitmask-Android-Beta-${VERSION_NAME}.apk" + FINAL_FILE_NAME="${APP_NAME}-Android-Beta-${VERSION_NAME}.apk" else - FINAL_FILE_NAME="Bitmask-Android-${VERSION_NAME}.apk" + FINAL_FILE_NAME="${APP_NAME}-Android-${VERSION_NAME}.apk" fi FINAL_APK="${FILE_DIR}/${FINAL_FILE_NAME}" cp ${ALIGNED_SIGNED_APK} ${FINAL_APK} || quit -- cgit v1.2.3 From 4af8a54fb235e90372c94489a71ffd756047c1cc Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sun, 14 Jul 2019 14:06:03 +0200 Subject: add a script to install an apk on all running emulators at the same time --- installOnAllEmulators.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 installOnAllEmulators.sh diff --git a/installOnAllEmulators.sh b/installOnAllEmulators.sh new file mode 100755 index 00000000..e0ed4c6a --- /dev/null +++ b/installOnAllEmulators.sh @@ -0,0 +1,2 @@ +#!/bin/bash +adb devices | grep emulator | cut --output-delimiter ' ' -f1 | xargs -I{} adb -s {} install -r $1 -- cgit v1.2.3