Commit 4ebca1ae authored by Tulio Ruiz's avatar Tulio Ruiz
Browse files

[FIX] Replace INSTALL var with MAIN_APP.

The INSTALL env var is now used by pyasn [here](https://github.com/pyca/pynacl/blob/master/src/libsodium/Makefile.in\#L307) and this is showing an error, since it is not used by any other tools we decided to replace it with MAIN_APP.

This change is backward compatible, but will show a deprecation warning during the build process telling the user that must change the env var for the appropiate value instead of showing an error
parent 4bce1266
Pipeline #23655 failed with stage
in 23 seconds
# coding: utf-8
from deployv_addon_gitlab_tools.common import check_env_vars
from deployv_addon_gitlab_tools.common import check_env_vars, get_main_app
from deployv_addon_gitlab_tools.commands.check_keys import check_credentials, is_docker_login
from deployv.helpers import utils
from docker import errors, APIClient as Client
......@@ -120,7 +120,7 @@ def start_instance():
def install_module():
module = environ['INSTALL']
module = get_main_app()
extra = ''
if environ.get('LANGUAGE'):
extra += ' --load-language={lang}'.format(lang=environ.get('LANGUAGE'))
......@@ -320,8 +320,8 @@ def notify_orchest(tag, customer, is_latest=False):
help=("Env var: ODOO_BRANCH."))
@click.option('--version', default=environ.get('VERSION'),
help=("Env var: VERSION."))
@click.option('--install', default=environ.get('INSTALL'),
help=("Env var: INSTALL."))
@click.option('--install', default=get_main_app(),
help=("Env var: MAIN_APP."))
@click.option('--ci_job_id', default=environ.get('CI_JOB_ID'),
help=("The unique id of the current job that GitLab CI uses internally."
" Env var: CI_JOB_ID."))
......
# coding: utf-8
import logging
from os import environ
_logger = logging.getLogger('deployv.' + __name__)
def check_env_vars(*args, **kwargs):
missing = []
not_required = ['psql_image', 'push_image']
......@@ -20,3 +23,9 @@ def check_env_vars(*args, **kwargs):
keys=", ".join(missing)
))
def get_main_app():
if environ.get('INSTALL', False):
_logger.warning('Deprecation warning: you should not use INSTALL env var, replace it with MAIN_APP instead')
return environ.get('INSTALL')
return environ.get('MAIN_APP', False)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment