From 50612fdcc2cd8adc4fa308bc4c85aa8f00dcd377 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 26 Apr 2022 10:40:45 +0200 Subject: [PATCH] fix(ci): when deploy CN5G, health detection fixed to display the image tag/date in HTML report Signed-off-by: Raphael Defosseux --- ci-scripts/epc.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index 0fc37d4ead..52583bb6d1 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -255,16 +255,19 @@ class EPCManagement(): mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('cd /opt/oai-cn5g-fed-v1.3/docker-compose', '\$', 5) mySSH.command('python3 ./core-network.py '+self.cfgDeploy, '\$', 60) - time.sleep(2) - mySSH.command('docker-compose -p 5gcn ps -a', '\$', 60) + if re.search('start-mini-as-ue', self.cfgDeploy): + dFile = 'docker-compose-mini-nrf-asue.yaml' + else: + dFile = 'docker-compose-mini-nrf.yaml' + mySSH.command('docker-compose -p 5gcn -f ' + dFile + ' ps -a', '\$', 60) if mySSH.getBefore().count('Up (healthy)') != 6: logging.error('Not all container healthy') else: - logging.debug('OK') - mySSH.command('docker-compose config | grep --colour=never image', '\$', 10) + logging.debug('OK --> all containers are healthy') + mySSH.command('docker-compose -p 5gcn -f ' + dFile + ' config | grep --colour=never image', '\$', 10) listOfImages = mySSH.getBefore() for imageLine in listOfImages.split('\\r\\n'): - res1 = re.search('image: (?P[a-zA-Z0-9\-]+):(?P[a-zA-Z0-9\-]+)', str(imageLine)) + res1 = re.search('image: (?P[a-zA-Z0-9\-/]+):(?P[a-zA-Z0-9\-]+)', str(imageLine)) res2 = re.search('mysql', str(imageLine)) if res1 is not None and res2 is None: html_cell += res1.group('name') + ':' + res1.group('tag') + ' '