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
966f6de31a
commit
c4cac2cef7
|
@ -1,4 +1,4 @@
|
||||||
library 'status-react-jenkins@v1.2.4'
|
library 'status-react-jenkins@v1.2.5'
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'linux' }
|
agent { label 'linux' }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
library 'status-react-jenkins@v1.2.4'
|
library 'status-react-jenkins@v1.2.5'
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'linux' }
|
agent { label 'linux' }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
library 'status-react-jenkins@v1.2.4'
|
library 'status-react-jenkins@v1.2.5'
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'macos-xcode-11.5' }
|
agent { label 'macos-xcode-11.5' }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
library 'status-react-jenkins@v1.2.4'
|
library 'status-react-jenkins@v1.2.5'
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label params.AGENT_LABEL }
|
agent { label params.AGENT_LABEL }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
library 'status-react-jenkins@v1.2.4'
|
library 'status-react-jenkins@v1.2.5'
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'macos' }
|
agent { label 'macos' }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
library 'status-react-jenkins@v1.2.4'
|
library 'status-react-jenkins@v1.2.5'
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'linux' }
|
agent { label 'linux' }
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
{ stdenv, lib, deps, pkgs }:
|
{ stdenv, lib, deps, pkgs }:
|
||||||
|
|
||||||
|
# Path to the file containing secret environment variables
|
||||||
|
{ secretsFile ? "" }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "status-react-build-jsbundle-android";
|
name = "status-react-build-jsbundle-android";
|
||||||
src =
|
src =
|
||||||
|
@ -36,8 +39,18 @@ stdenv.mkDerivation {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
buildInputs = with pkgs; [ clojure nodejs bash git openjdk];
|
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
|
# Patching shadow-cljs.edn so it uses the local maven repo of dependencies provided by Nix
|
||||||
patchPhase =
|
patchPhase =
|
||||||
let anchor = ''{:source-paths ["src" "test/cljs"]'';
|
let anchor = ''{:source-paths ["src" "test/cljs"]'';
|
||||||
|
|
|
@ -19,6 +19,9 @@ let
|
||||||
toLower optionalString stringLength assertMsg
|
toLower optionalString stringLength assertMsg
|
||||||
getConfig makeLibraryPath assertEnvVarSet elem;
|
getConfig makeLibraryPath assertEnvVarSet elem;
|
||||||
|
|
||||||
|
# Pass secretsFile for INFURA_TOKEN to jsbundle build
|
||||||
|
builtJsBundle = jsbundle { inherit secretsFile; };
|
||||||
|
|
||||||
buildType = getConfig "build-type" "release";
|
buildType = getConfig "build-type" "release";
|
||||||
buildNumber = getConfig "build-number" 9999;
|
buildNumber = getConfig "build-number" 9999;
|
||||||
gradleOpts = getConfig "android.gradle-opts" null;
|
gradleOpts = getConfig "android.gradle-opts" null;
|
||||||
|
@ -98,7 +101,7 @@ in stdenv.mkDerivation rec {
|
||||||
cp -bf ./${envFileName} ./.env
|
cp -bf ./${envFileName} ./.env
|
||||||
|
|
||||||
# Copy index.js and app/ input files
|
# Copy index.js and app/ input files
|
||||||
cp -ra --no-preserve=ownership ${jsbundle}/* ./
|
cp -ra --no-preserve=ownership ${builtJsBundle}/* ./
|
||||||
|
|
||||||
# Copy android/ directory
|
# Copy android/ directory
|
||||||
mkdir -p ./android/build
|
mkdir -p ./android/build
|
||||||
|
|
Loading…
Reference in New Issue