changeset 9bf05280ebdf in modules/account_dunning:default
details: 
https://hg.tryton.org/modules/account_dunning?cmd=changeset;node=9bf05280ebdf
description:
        Do not set local_version when no CI and pass CI env to tox

        issue9928
diffstat:

 .drone.yml |  2 +-
 setup.py   |  6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 88faf294d9fc -r 9bf05280ebdf .drone.yml
--- a/.drone.yml        Thu Dec 10 23:05:55 2020 +0100
+++ b/.drone.yml        Fri Dec 11 12:21:15 2020 +0100
@@ -12,7 +12,7 @@
         environment:
             - CFLAGS=-O0
             - DB_CACHE=/cache
-            - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE
+            - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER 
CI_JOB_NUMBER CI_JOB_ID
             - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/
         commands:
             - echo "[extensions]" >> /root/.hgrc
diff -r 88faf294d9fc -r 9bf05280ebdf setup.py
--- a/setup.py  Thu Dec 10 23:05:55 2020 +0100
+++ b/setup.py  Fri Dec 11 12:21:15 2020 +0100
@@ -49,7 +49,11 @@
     local_version.append(os.environ['CI_JOB_ID'])
 else:
     for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']:
-        local_version.append(os.environ.get(build, ''))
+        if os.environ.get(build):
+            local_version.append(os.environ[build])
+        else:
+            local_version = []
+            break
 if local_version:
     version += '+' + '.'.join(local_version)
 

Reply via email to