Commit af217bfd authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'ci-try-outs' into 'develop'

MR nb 5

See merge request !5
parents 5079a12a d77fec29
Pipeline #8511 passed with stage
in 0 seconds
......@@ -5,12 +5,14 @@ pipeline {
label 'bellatrix'
}
options {
gitLabConnection('OAI GitLab')
disableConcurrentBuilds()
timestamps()
gitlabBuilds(builds: ["Build", "Test"])
}
stages {
stage ('Verify Parameters') {
stage ("Verify Parameters") {
steps {
echo 'Verify Parameters'
echo "Base URL is ${JENKINS_URL}"
......@@ -26,24 +28,25 @@ pipeline {
// Doing it manually --> it may have merge conflicts
sh "git merge --ff origin/${env.gitlabTargetBranch}"
sh "git log -n1"
} else {
def message = "OAI build #" + BUILD_ID
updateGitlabCommitStatus name: message, state: 'pending'
}
}
}
}
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"
stage ("Build") {
steps {
gitlabCommitStatus(name: "Build") {
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") {
steps {
gitlabCommitStatus(name: "Test") {
sh "./bin/test1"
sh "./bin/test2"
}
}
}
}
......@@ -65,11 +68,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 +77,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