diff options
| author | Albin <albin@mullvad.net> | 2022-12-02 13:19:01 +0100 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2022-12-08 14:46:36 +0100 |
| commit | 4ca7e82110b37ff8d9b97a6dbeacc5c6cf5859e9 (patch) | |
| tree | 413487f452d23ae98e5fdffc528bad7dd75affdf | |
| parent | d3a46886fde75500f62f68bca69e83347071c334 (diff) | |
| download | mullvadvpn-4ca7e82110b37ff8d9b97a6dbeacc5c6cf5859e9.tar.xz mullvadvpn-4ca7e82110b37ff8d9b97a6dbeacc5c6cf5859e9.zip | |
Add optional env var to enabled containerized signing
This commit adds an optional environment variable that can be set to
enable signing in containerized builds when using the containerized
build script.
| -rwxr-xr-x | building/containerized-build.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/building/containerized-build.sh b/building/containerized-build.sh index d2386473cb..32b75df116 100755 --- a/building/containerized-build.sh +++ b/building/containerized-build.sh @@ -12,6 +12,7 @@ REPO_MOUNT_TARGET="/build" CARGO_TARGET_VOLUME_NAME=${CARGO_TARGET_VOLUME_NAME:-"cargo-target"} CARGO_REGISTRY_VOLUME_NAME=${CARGO_REGISTRY_VOLUME_NAME:-"cargo-registry"} GRADLE_CACHE_VOLUME_NAME=${GRADLE_CACHE_VOLUME_NAME:-"gradle-cache"} +ANDROID_CREDENTIALS_DIR=${ANDROID_CREDENTIALS_DIR:-""} CONTAINER_RUNNER=${CONTAINER_RUNNER:-"podman"} SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -30,6 +31,11 @@ case ${1-:""} in container_image_name=$(cat "$SCRIPT_DIR/android-container-image.txt") build_command=("$REPO_MOUNT_TARGET/build-apk.sh" "--no-docker") optional_gradle_cache_volume=(-v "$GRADLE_CACHE_VOLUME_NAME:/root/.gradle:Z") + + if [ -n "$ANDROID_CREDENTIALS_DIR" ]; then + optional_android_credentials_volume=(-v "$ANDROID_CREDENTIALS_DIR:$REPO_MOUNT_TARGET/android/credentials:Z") + fi + shift 1 ;; *) @@ -43,5 +49,6 @@ exec "$CONTAINER_RUNNER" run --rm -it \ -v "$CARGO_TARGET_VOLUME_NAME:/root/.cargo/target:Z" \ -v "$CARGO_REGISTRY_VOLUME_NAME:/root/.cargo/registry:Z" \ "${optional_gradle_cache_volume[@]}" \ + "${optional_android_credentials_volume[@]}" \ "$container_image_name" \ "${build_command[@]}" "$@" |
