diff --git a/ci/Jenkinsfile.android b/ci/Jenkinsfile.android index fcde35985e..77ee67f42b 100644 --- a/ci/Jenkinsfile.android +++ b/ci/Jenkinsfile.android @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.2.4' +library 'status-react-jenkins@v1.2.5' pipeline { agent { label 'linux' } diff --git a/ci/Jenkinsfile.combined b/ci/Jenkinsfile.combined index 5287cdd063..59be5cf573 100644 --- a/ci/Jenkinsfile.combined +++ b/ci/Jenkinsfile.combined @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.2.4' +library 'status-react-jenkins@v1.2.5' pipeline { agent { label 'linux' } diff --git a/ci/Jenkinsfile.ios b/ci/Jenkinsfile.ios index 600b100627..2d354ac1f7 100644 --- a/ci/Jenkinsfile.ios +++ b/ci/Jenkinsfile.ios @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.2.4' +library 'status-react-jenkins@v1.2.5' pipeline { agent { label 'macos-xcode-11.5' } diff --git a/ci/Jenkinsfile.nix-cache b/ci/Jenkinsfile.nix-cache index 3e61dbca02..62b442bc8e 100644 --- a/ci/Jenkinsfile.nix-cache +++ b/ci/Jenkinsfile.nix-cache @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.2.4' +library 'status-react-jenkins@v1.2.5' pipeline { agent { label params.AGENT_LABEL } diff --git a/ci/tools/Jenkinsfile.fastlane-clean b/ci/tools/Jenkinsfile.fastlane-clean index 1a7265f4df..7dad559c7e 100644 --- a/ci/tools/Jenkinsfile.fastlane-clean +++ b/ci/tools/Jenkinsfile.fastlane-clean @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.2.4' +library 'status-react-jenkins@v1.2.5' pipeline { agent { label 'macos' } diff --git a/ci/tools/Jenkinsfile.playstore-meta b/ci/tools/Jenkinsfile.playstore-meta index ae6388cf92..a3ca213ceb 100644 --- a/ci/tools/Jenkinsfile.playstore-meta +++ b/ci/tools/Jenkinsfile.playstore-meta @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.2.4' +library 'status-react-jenkins@v1.2.5' pipeline { agent { label 'linux' } diff --git a/nix/mobile/android/jsbundle/default.nix b/nix/mobile/android/jsbundle/default.nix index 59d690c992..8aaec0a160 100644 --- a/nix/mobile/android/jsbundle/default.nix +++ b/nix/mobile/android/jsbundle/default.nix @@ -4,6 +4,9 @@ { stdenv, lib, deps, pkgs }: +# Path to the file containing secret environment variables +{ secretsFile ? "" }: + stdenv.mkDerivation { name = "status-react-build-jsbundle-android"; src = @@ -36,8 +39,18 @@ stdenv.mkDerivation { }; }; buildInputs = with pkgs; [ clojure nodejs bash git openjdk]; + phases = [ + "unpackPhase" "secretsPhase" "patchPhase" + "configurePhase" "buildPhase" "installPhase" + ]; + + # For optional INFURA_TOKEN variable + secretsPhase = if (secretsFile != "") then '' + source "${secretsFile}" + '' else '' + echo "No secrets provided!" + ''; - phases = [ "unpackPhase" "patchPhase" "configurePhase" "buildPhase" "installPhase" ]; # Patching shadow-cljs.edn so it uses the local maven repo of dependencies provided by Nix patchPhase = let anchor = ''{:source-paths ["src" "test/cljs"]''; diff --git a/nix/mobile/android/release.nix b/nix/mobile/android/release.nix index 25ea23a9fd..cd8cb48d0e 100644 --- a/nix/mobile/android/release.nix +++ b/nix/mobile/android/release.nix @@ -19,6 +19,9 @@ let toLower optionalString stringLength assertMsg getConfig makeLibraryPath assertEnvVarSet elem; + # Pass secretsFile for INFURA_TOKEN to jsbundle build + builtJsBundle = jsbundle { inherit secretsFile; }; + buildType = getConfig "build-type" "release"; buildNumber = getConfig "build-number" 9999; gradleOpts = getConfig "android.gradle-opts" null; @@ -98,7 +101,7 @@ in stdenv.mkDerivation rec { cp -bf ./${envFileName} ./.env # Copy index.js and app/ input files - cp -ra --no-preserve=ownership ${jsbundle}/* ./ + cp -ra --no-preserve=ownership ${builtJsBundle}/* ./ # Copy android/ directory mkdir -p ./android/build