Commit ad17204e authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/docker-no-cache-option' into integration_2021_w14

parents 3b187925 b263ff15
...@@ -27,6 +27,9 @@ def nodeExecutor = params.nodeExecutor ...@@ -27,6 +27,9 @@ def nodeExecutor = params.nodeExecutor
def doMandatoryTests = false def doMandatoryTests = false
def doFullTestsuite = false def doFullTestsuite = false
//
def gitCommitAuthorEmailAddr
pipeline { pipeline {
agent { agent {
label nodeExecutor label nodeExecutor
...@@ -177,15 +180,15 @@ pipeline { ...@@ -177,15 +180,15 @@ pipeline {
post { post {
always { always {
script { script {
def eSubject = JOB_NAME + ' - Build # ' + BUILD_ID + ' - ' + currentBuild.result + '!'
def eBody = "Hi,\n\n"
eBody += "Here are attached HTML report files for " + JOB_NAME + " - Build # " + BUILD_ID + " - " + currentBuild.result + "!\n\n"
eBody += "Regards,\n"
eBody += "OAI CI Team"
emailext attachmentsPattern: '*results*.html', emailext attachmentsPattern: '*results*.html',
body: '''Hi, body: eBody,
Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!
Regards,
OAI CI Team''',
replyTo: 'no-reply@openairinterface.org', replyTo: 'no-reply@openairinterface.org',
subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', subject: eSubject,
to: gitCommitAuthorEmailAddr to: gitCommitAuthorEmailAddr
if (fileExists('.git/CI_COMMIT_MSG')) { if (fileExists('.git/CI_COMMIT_MSG')) {
......
...@@ -83,6 +83,7 @@ class Containerize(): ...@@ -83,6 +83,7 @@ class Containerize():
self.flexranCtrlDeployed = False self.flexranCtrlDeployed = False
self.flexranCtrlIpAddress = '' self.flexranCtrlIpAddress = ''
self.cli = '' self.cli = ''
self.cliBuildOptions = ''
self.dockerfileprefix = '' self.dockerfileprefix = ''
self.host = '' self.host = ''
self.allImagesSize = {} self.allImagesSize = {}
...@@ -124,9 +125,11 @@ class Containerize(): ...@@ -124,9 +125,11 @@ class Containerize():
if self.host == 'Ubuntu': if self.host == 'Ubuntu':
self.cli = 'docker' self.cli = 'docker'
self.dockerfileprefix = '.ubuntu18' self.dockerfileprefix = '.ubuntu18'
self.cliBuildOptions = '--no-cache'
elif self.host == 'Red Hat': elif self.host == 'Red Hat':
self.cli = 'sudo podman' self.cli = 'sudo podman'
self.dockerfileprefix = '.rhel8.2' self.dockerfileprefix = '.rhel8.2'
self.cliBuildOptions = '--no-cache --disable-compression'
imageNames = [] imageNames = []
result = re.search('eNB', self.imageKind) result = re.search('eNB', self.imageKind)
...@@ -201,7 +204,7 @@ class Containerize(): ...@@ -201,7 +204,7 @@ class Containerize():
# Build the shared image only on Push Events (not on Merge Requests) # Build the shared image only on Push Events (not on Merge Requests)
if (not self.ranAllowMerge): if (not self.ranAllowMerge):
mySSH.command(self.cli + ' build --target ' + sharedimage + ' --tag ' + sharedimage + ':' + sharedTag + ' --file docker/Dockerfile.ran' + self.dockerfileprefix + ' --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > cmake_targets/log/ran-build.log 2>&1', '\$', 1600) mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --target ' + sharedimage + ' --tag ' + sharedimage + ':' + sharedTag + ' --file docker/Dockerfile.ran' + self.dockerfileprefix + ' --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > cmake_targets/log/ran-build.log 2>&1', '\$', 1600)
# First verify if the shared image was properly created. # First verify if the shared image was properly created.
status = True status = True
mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + sharedimage + ':' + sharedTag, '\$', 5) mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + sharedimage + ':' + sharedTag, '\$', 5)
...@@ -249,7 +252,7 @@ class Containerize(): ...@@ -249,7 +252,7 @@ class Containerize():
# the archived Dockerfiles have "ran-build:latest" as base image # the archived Dockerfiles have "ran-build:latest" as base image
# we need to update them with proper tag # we need to update them with proper tag
mySSH.command('sed -i -e "s#' + sharedimage + ':latest#' + sharedimage + ':' + sharedTag + '#" docker/Dockerfile.' + pattern + self.dockerfileprefix, '\$', 5) mySSH.command('sed -i -e "s#' + sharedimage + ':latest#' + sharedimage + ':' + sharedTag + '#" docker/Dockerfile.' + pattern + self.dockerfileprefix, '\$', 5)
mySSH.command(self.cli + ' build --target ' + image + ' --tag ' + image + ':' + imageTag + ' --file docker/Dockerfile.' + pattern + self.dockerfileprefix + ' . > cmake_targets/log/' + image + '.log 2>&1', '\$', 1200) mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --target ' + image + ' --tag ' + image + ':' + imageTag + ' --file docker/Dockerfile.' + pattern + self.dockerfileprefix + ' . > cmake_targets/log/' + image + '.log 2>&1', '\$', 1200)
# split the log # split the log
mySSH.command('mkdir -p cmake_targets/log/' + image, '\$', 5) mySSH.command('mkdir -p cmake_targets/log/' + image, '\$', 5)
mySSH.command('python3 ci-scripts/docker_log_split.py --logfilename=cmake_targets/log/' + image + '.log', '\$', 5) mySSH.command('python3 ci-scripts/docker_log_split.py --logfilename=cmake_targets/log/' + image + '.log', '\$', 5)
......
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