fix availability of INFURA_TOKEN for Android build
The env variable `INFURA_TOKEN` is used at build time of JS bundle, not the final APK file. We never passed the `secretsFile` to the derivation for JS bundle so it never saw the `INFURA_TOKEN`. Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
e1cbd3936f
commit
2a21b6c142
|
@ -1,4 +1,4 @@
|
|||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos-xcode-11.5' }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label params.AGENT_LABEL }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos' }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
library 'status-react-jenkins@v1.2.3'
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
|
|
@ -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"]'';
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue