Commit c790554a authored by Raphael Defosseux's avatar Raphael Defosseux

trying a new gitlab notification API

Signed-off-by: Raphael Defosseux's avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent c1e06c1a
......@@ -33,17 +33,23 @@ pipeline {
}
}
}
stage ('Build') {
steps {
sh "gcc src/test1.c -o bin/test1"
sh "gcc src/test2.c -o bin/test2"
sh "cppcheck --enable=warning --force --xml --xml-version=2 src 2> cppcheck.xml"
gitlabBuilds(builds: ["Build", "Test"]) {
stage ('Build') {
gitlabCommitStatus("Build") {
steps {
sh "gcc src/test1.c -o bin/test1"
sh "gcc src/test2.c -o bin/test2"
sh "cppcheck --enable=warning --force --xml --xml-version=2 src 2> cppcheck.xml"
}
}
}
}
stage ('Test') {
steps {
sh "./bin/test1"
sh "./bin/test2"
stage ('Test') {
gitlabCommitStatus("Test") {
steps {
sh "./bin/test1"
sh "./bin/test2"
}
}
}
}
}
......@@ -65,11 +71,6 @@ pipeline {
def message = "OAI build #" + BUILD_ID + " passed (" + BUILD_URL + ")"
echo "$message"
addGitLabMRComment comment: message
} else {
echo "This is a PUSH event"
def message = "OAI build #" + BUILD_ID
echo "$message"
updateGitlabCommitStatus name: message, state: 'success'
}
}
}
......@@ -79,10 +80,6 @@ pipeline {
echo "This is a MERGE event"
def message = "OAI build #" + BUILD_ID + " failed (" + BUILD_URL + ")"
addGitLabMRComment comment: message
} else {
echo "This is a PUSH event"
def message = "OAI build #" + BUILD_ID
updateGitlabCommitStatus name: message, state: 'failed'
}
}
}
......
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