changeset 9e0f52550aba in proteus:default
details: https://hg.tryton.org/proteus?cmd=changeset;node=9e0f52550aba
description:
        Add support for local_version on trydevpi.tryton.org

        issue9928
diffstat:

 setup.py |  8 +++++---
 tox.ini  |  2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r 4606283e6e37 -r 9e0f52550aba setup.py
--- a/setup.py  Sun Nov 15 19:16:42 2020 +0100
+++ b/setup.py  Thu Dec 10 23:05:58 2020 +0100
@@ -41,9 +41,11 @@
     download_url = 'hg+http://hg.tryton.org/%s#egg=%s-%s' % (
         name, name, version)
 local_version = []
-for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER', 'CI_JOB_ID']:
-    if os.environ.get(build):
-        local_version.append(os.environ[build])
+if os.environ.get('CI_JOB_ID'):
+    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 local_version:
     version += '+' + '.'.join(local_version)
 
diff -r 4606283e6e37 -r 9e0f52550aba tox.ini
--- a/tox.ini   Sun Nov 15 19:16:42 2020 +0100
+++ b/tox.ini   Thu Dec 10 23:05:58 2020 +0100
@@ -7,4 +7,4 @@
 setenv =
     TRYTOND_DATABASE_URI={env:TRYTOND_DATBASE_URI:sqlite://}
     DB_NAME={env:DB_NAME::memory:}
-install_command = pip install --pre --find-links https://trydevpi.tryton.org/ 
{opts} {packages}
+install_command = pip install --pre --find-links 
https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}}
 {opts} {packages}

Reply via email to