don't go into android dir, copy results if not linking
Signed-off-by: Jakub Sokołowski <jakub@status.im> Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
b0dc2dd4f5
commit
17407b3680
|
@ -20,7 +20,6 @@ def bundle() {
|
|||
}
|
||||
|
||||
// The Nix script cannot access the user home directory, so best to copy the file to the Nix store and pass that to the Nix script
|
||||
dir('android') {
|
||||
withCredentials([
|
||||
string(
|
||||
credentialsId: 'android-keystore-pass',
|
||||
|
@ -50,12 +49,12 @@ def bundle() {
|
|||
sbox: [
|
||||
env.STATUS_RELEASE_STORE_FILE
|
||||
],
|
||||
attr: "targets.mobile.android.release"
|
||||
attr: 'targets.mobile.android.release',
|
||||
link: false
|
||||
)
|
||||
}
|
||||
}
|
||||
/* because nix-build was run in `android` dir that's where `result` is */
|
||||
def outApk = "android/result/app.apk"
|
||||
def outApk = "result/app.apk"
|
||||
def pkg = utils.pkgFilename(btype, 'apk')
|
||||
/* rename for upload */
|
||||
sh "cp ${outApk} ${pkg}"
|
||||
|
|
|
@ -59,7 +59,7 @@ def build(Map opts = [:]) {
|
|||
opts.args = defaults.args + opts.args
|
||||
opts.keep = (opts.keep + defaults.keep).unique()
|
||||
|
||||
return sh(
|
||||
def resultPath = sh(
|
||||
returnStdout: true,
|
||||
script: """
|
||||
set +x
|
||||
|
@ -68,6 +68,10 @@ def build(Map opts = [:]) {
|
|||
nix-build ${_getNixCommandArgs(opts, false)}
|
||||
"""
|
||||
).trim()
|
||||
if (!opts.link) { /* if not linking, copy results */
|
||||
sh "cp ${resultPath}/* ${env.WORKSPACE}/result/"
|
||||
}
|
||||
return resultPath
|
||||
}
|
||||
|
||||
private makeNixBuildEnvFile(Map opts = [:]) {
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
set -e
|
||||
|
||||
gitRoot=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
||||
resultPath="${gitRoot}/result/"
|
||||
|
||||
# cleanup for artifacts created during builds
|
||||
function cleanup() {
|
||||
# clear trapped signals
|
||||
|
@ -24,9 +27,9 @@ trap cleanup EXIT ERR INT QUIT
|
|||
function extractResults() {
|
||||
local nixResultPath="$1"
|
||||
echo "Saving build result: ${nixResultPath}"
|
||||
mkdir -p result
|
||||
cp -vfr ${nixResultPath}/* result/
|
||||
chmod u+w -R result/
|
||||
mkdir -p "${resultPath}"
|
||||
cp -vfr ${nixResultPath}/* "${resultPath}"
|
||||
chmod u+w -R "${resultPath}"
|
||||
}
|
||||
|
||||
# Load Nix profile
|
||||
|
|
Loading…
Reference in New Issue