Commit 78b39c24 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: fix pipeline in MR case

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 701f1d20
......@@ -130,7 +130,7 @@ pipeline {
if ("MERGE".equals(env.gitlabActionType)) {
// Building a temporary image
myShCmd('docker image prune --force', new_host_flag, new_host_user, new_host)
myShCmd('docker build --target oai-smf --tag oai-smf:ci-temp --file ci-scripts/Dockerfile.private.ubuntu18.04 --build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" --build-arg GITLAB_USERNAME="' + git_username + '" --build-arg GITLAB_PASSWORD="' + git_password + '" --build-arg BUILD_FOR_CI="True" --build-arg CI_SRC_BRANCH="' + env.ghprbSourceBranch + '" --build-arg CI_SRC_COMMIT="' + env.ghprbActualCommit + '" --build-arg CI_DEST_BRANCH="develop" . > archives/smf_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
myShCmd('docker build --target oai-smf --tag oai-smf:ci-temp --file ci-scripts/Dockerfile.private.ubuntu18.04 --build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" --build-arg GITLAB_USERNAME="' + git_username + '" --build-arg GITLAB_PASSWORD="' + git_password + '" --build-arg BUILD_FOR_CI="True" --build-arg CI_SRC_BRANCH="' + env.gitlabSourceBranch + '" --build-arg CI_SRC_COMMIT="' + env.gitlabMergeRequestLastCommit + '" --build-arg CI_DEST_BRANCH="' + env.gitlabTargetBranch + '" . > archives/smf_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
} else {
// Currently this pipeline only runs for pushes to `develop` branch
// First clean image registry
......@@ -213,7 +213,7 @@ pipeline {
// We install a dedicated version (installed on our CI server).
myShCmd('docker cp /opt/clang-format/9.0.0/bin/clang-format ci-cn-clang-formatter:/usr/local/bin', new_host_flag, new_host_user, new_host)
if ("MERGE".equals(env.gitlabActionType)) {
myShCmd('docker exec -it ci-cn-clang-formatter /bin/bash -c "cd /home && ./ci-scripts/checkCodingFormattingRules.sh --src-branch ' + env.ghprbSourceBranch +' --target-branch ' + env.ghprbTargetBranch + '"', new_host_flag, new_host_user, new_host)
myShCmd('docker exec -it ci-cn-clang-formatter /bin/bash -c "cd /home && ./ci-scripts/checkCodingFormattingRules.sh --src-branch ' + env.gitlabSourceBranch +' --target-branch ' + env.gitlabTargetBranch + '"', new_host_flag, new_host_user, new_host)
} else {
myShCmd('docker exec -it ci-cn-clang-formatter /bin/bash -c "cd /home && ./ci-scripts/checkCodingFormattingRules.sh"', new_host_flag, new_host_user, new_host)
}
......@@ -242,6 +242,24 @@ pipeline {
}
}
post {
success {
script {
if ("MERGE".equals(env.gitlabActionType)) {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ")"
echo "This is a MERGE event"
addGitLabMRComment comment: message
}
}
}
unsuccessful {
script {
if ("MERGE".equals(env.gitlabActionType)) {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")"
echo "This is a MERGE event"
addGitLabMRComment comment: message
}
}
}
cleanup {
script {
// Removing temporary / intermediate images
......@@ -302,7 +320,6 @@ def copyTo2ndServer(filename, flag, user, host) {
sh "ssh ${user}@${host} 'cd /tmp/CI-CN-SMF && tar -xjf ${filename}'"
sh "ssh ${user}@${host} 'mkdir -p /tmp/CI-CN-SMF/archives'"
sh "ssh ${user}@${host} 'mkdir -p /tmp/CI-CN-SMF/archives/oai-smf-cfg'"
sh "ssh ${user}@${host} 'mkdir -p /tmp/CI-CN-SMF/archives/oai-mme-cfg'"
}
}
}
......
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