From 1182e0714c49c46dcd213e9de37e15d683a4d442 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Sat, 9 Mar 2019 04:40:20 +0100
Subject: [PATCH] [scripts][build] Prepare script to be used at ci.nightlies

---
 bob/devtools/scripts/build.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/bob/devtools/scripts/build.py b/bob/devtools/scripts/build.py
index 059aae25..de9c6668 100644
--- a/bob/devtools/scripts/build.py
+++ b/bob/devtools/scripts/build.py
@@ -139,9 +139,7 @@ def build(recipe_dir, python, condarc, config, no_test, append_file,
 
     # pre-renders the recipe - figures out the destination
     metadata = get_rendered_metadata(d, conda_config)
-
     rendered_recipe = get_parsed_recipe(metadata)
-
     path = get_output_path(metadata, conda_config)
 
     # checks if we should actually build this recipe
@@ -159,10 +157,15 @@ def build(recipe_dir, python, condarc, config, no_test, append_file,
     # already resolved the "wrong" build number.  We'll have to reparse after
     # setting the environment variable BOB_BUILD_NUMBER.
     set_environment('BOB_BUILD_NUMBER', str(build_number))
+    metadata = get_rendered_metadata(d, conda_config)
+    path = get_output_path(metadata, conda_config)
 
     logger.info('Building %s-%s-py%s (build: %d) for %s',
         rendered_recipe['package']['name'],
         rendered_recipe['package']['version'], python.replace('.',''),
         build_number, arch)
     if not dry_run:
-      conda_build.api.build(d, config=conda_config, notest=no_test)
+      conda_build.api.build(metadata[0][0], config=conda_config, notest=no_test)
+      # if you get to this point, the package was successfully rebuilt
+      # set environment to signal caller we can upload it
+      os.environ['BDT_BUILD'] = path
-- 
GitLab