Commit fc17d335 authored by Mohammed Ismail's avatar Mohammed Ismail

updated

parent dcdd8bd1
...@@ -115,17 +115,18 @@ class Containerize(): ...@@ -115,17 +115,18 @@ class Containerize():
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
# Checking the hostname to get adapted on cli and dockerfileprefixes # Checking the hostname to get adapted on cli and dockerfileprefixes
mySSH.command('hostname', '\$', 5) mySSH.command('hostnamectl', '\$', 5)
self.host = re.search('obelix|asterix', mySSH.getBefore()) result = re.search('Ubuntu|Red Hat', mySSH.getBefore())
if self.host == 'obelix': self.host = result.group(0)
if self.host == 'Ubuntu':
self.cli = 'docker' self.cli = 'docker'
self.dockerfileprefix = '.ubuntu18' self.dockerfileprefix = '.ubuntu18'
elif self.host == 'asterix': elif self.host == 'Red Hat':
self.cli = 'sudo podman' self.cli = 'sudo podman'
self.dockerfileprefix = '.rhel8.2' self.dockerfileprefix = '.rhel8.2'
imageNames = [] imageNames = []
if self.host == 'obelix': 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:
...@@ -143,7 +144,7 @@ class Containerize(): ...@@ -143,7 +144,7 @@ class Containerize():
imageNames.append(('oai-nr-ue', 'nrUE')) imageNames.append(('oai-nr-ue', 'nrUE'))
if len(imageNames) == 0: if len(imageNames) == 0:
imageNames.append(('oai-enb', 'eNB')) imageNames.append(('oai-enb', 'eNB'))
elif self.host == 'asterix': elif self.host == 'Red Hat':
result = re.search('eNB', self.imageKind) result = re.search('eNB', self.imageKind)
# Creating a tupple with the imageName and the DockerFile prefix pattern on asterix # Creating a tupple with the imageName and the DockerFile prefix pattern on asterix
if result is not None: if result is not None:
...@@ -211,9 +212,9 @@ class Containerize(): ...@@ -211,9 +212,9 @@ class Containerize():
# Build the shared image # Build the shared image
sharedimage = '' sharedimage = ''
if self.host == 'obelix': if self.host == 'Ubuntu':
sharedimage = 'ran-build' sharedimage = 'ran-build'
elif self.host == 'asterix': elif self.host == 'Red Hat':
sharedimage = 'localhost/ran-build' sharedimage = 'localhost/ran-build'
mySSH.command(self.cli + ' build --target ' + sharedimage + ' --tag '+ sharedimage + ':' + imageTag + ' --file docker/Dockerfile.ran' + self.dockerfileprefix + ' --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > cmake_targets/log/ran-build.log 2>&1', '\$', 800) mySSH.command(self.cli + ' build --target ' + sharedimage + ' --tag '+ sharedimage + ':' + imageTag + ' --file docker/Dockerfile.ran' + self.dockerfileprefix + ' --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > cmake_targets/log/ran-build.log 2>&1', '\$', 800)
# Build the target image(s) # Build the target image(s)
......
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