Commit c77e144a authored by Mohammed Ismail's avatar Mohammed Ismail

updated

parent b52f1181
...@@ -126,42 +126,23 @@ class Containerize(): ...@@ -126,42 +126,23 @@ class Containerize():
self.dockerfileprefix = '.rhel8.2' self.dockerfileprefix = '.rhel8.2'
imageNames = [] imageNames = []
if self.host == 'Ubuntu': result = re.search('eNB', self.imageKind)
result = re.search('eNB', self.imageKind) # Creating a tupple with the imageName and the DockerFile prefix pattern on obelix
# Creating a tupple with the imageName and the DockerFile prefix pattern on obelix if result is not None:
if result is not None: imageNames.append(('oai-enb', 'eNB'))
imageNames.append(('oai-enb', 'eNB')) else:
else: result = re.search('gNB', self.imageKind)
result = re.search('gNB', self.imageKind)
if result is not None:
imageNames.append(('oai-gnb', 'gNB'))
else:
result = re.search('all', self.imageKind)
if result is not None:
imageNames.append(('oai-enb', 'eNB'))
imageNames.append(('oai-gnb', 'gNB'))
imageNames.append(('oai-lte-ue', 'lteUE'))
imageNames.append(('oai-nr-ue', 'nrUE'))
if len(imageNames) == 0:
imageNames.append(('oai-enb', 'eNB'))
elif self.host == 'Red Hat':
result = re.search('eNB', self.imageKind)
# Creating a tupple with the imageName and the DockerFile prefix pattern on asterix
if result is not None: if result is not None:
imageNames.append(('oai-enb', 'eNB')) imageNames.append(('oai-gnb', 'gNB'))
else: else:
result = re.search('gNB', self.imageKind) result = re.search('all', self.imageKind)
if result is not None: if result is not None:
imageNames.append(('oai-gnb', 'gNB')) imageNames.append(('oai-enb', 'eNB'))
else: #imageNames.append(('oai-gnb', 'gNB'))
result = re.search('all', self.imageKind) #imageNames.append(('oai-lte-ue', 'lteUE'))
if result is not None: #imageNames.append(('oai-nr-ue', 'nrUE'))
imageNames.append(('oai-enb', 'eNB')) if len(imageNames) == 0:
imageNames.append(('oai-gnb', 'gNB')) imageNames.append(('oai-enb', 'eNB'))
imageNames.append(('oai-lte-ue', 'lteUE'))
imageNames.append(('oai-nr-ue', 'nrUE'))
if len(imageNames) == 0:
imageNames.append(('oai-enb', 'eNB'))
# Workaround for some servers, we need to erase completely the workspace # Workaround for some servers, we need to erase completely the workspace
if self.forcedWorkspaceCleanup: if self.forcedWorkspaceCleanup:
...@@ -206,12 +187,7 @@ class Containerize(): ...@@ -206,12 +187,7 @@ class Containerize():
#mySSH.close() #mySSH.close()
#return 0 #return 0
sharedimage = '' sharedimage = 'ran-build'
if self.host == 'Ubuntu':
sharedimage = 'ran-build'
elif self.host == 'Red Hat':
sharedimage = 'ran-build'
# Let's remove any previous run artifacts if still there # Let's remove any previous run artifacts if still there
mySSH.command(self.cli + ' image prune --force', '\$', 5) mySSH.command(self.cli + ' image prune --force', '\$', 5)
mySSH.command(self.cli + ' image rm ' + sharedimage + ':' + imageTag, '\$', 5) mySSH.command(self.cli + ' image rm ' + sharedimage + ':' + imageTag, '\$', 5)
...@@ -242,7 +218,7 @@ class Containerize(): ...@@ -242,7 +218,7 @@ class Containerize():
logging.error('Could not build properly ran-build') logging.error('Could not build properly ran-build')
status = False status = False
else: else:
result = re.search('Size = (?P<size>[0-9\-]+) bytes', mySSH.getBefore()) result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', mySSH.getBefore())
if result is not None: if result is not None:
imageSize = float(result.group('size')) imageSize = float(result.group('size'))
imageSize = imageSize / 1000 imageSize = imageSize / 1000
...@@ -263,7 +239,7 @@ class Containerize(): ...@@ -263,7 +239,7 @@ class Containerize():
logging.error('Could not build properly ' + image) logging.error('Could not build properly ' + image)
status = False status = False
else: else:
result = re.search('Size = (?P<size>[0-9\-]+) bytes', mySSH.getBefore()) result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', mySSH.getBefore())
if result is not None: if result is not None:
imageSize = float(result.group('size')) imageSize = float(result.group('size'))
imageSize = imageSize / 1000 imageSize = imageSize / 1000
......
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