Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG UE
Commits
69db8ed7
Commit
69db8ed7
authored
Jul 04, 2018
by
Guy De Souza
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop-nr' of
https://gitlab.eurecom.fr/oai/openairinterface5g
into develop-nr
parents
66e9fe97
973112bb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
149 deletions
+25
-149
ci-scripts/Jenkinsfile-gitlab
ci-scripts/Jenkinsfile-gitlab
+8
-0
ci-scripts/buildOnVM.sh
ci-scripts/buildOnVM.sh
+6
-2
ci-scripts/createVM.sh
ci-scripts/createVM.sh
+4
-1
ci-scripts/doGitLabMerge.sh
ci-scripts/doGitLabMerge.sh
+7
-3
tmp/ci-scripts/Jenkinsfile-gitlab
tmp/ci-scripts/Jenkinsfile-gitlab
+0
-143
No files found.
ci-scripts/Jenkinsfile-gitlab
View file @
69db8ed7
...
@@ -45,6 +45,14 @@ pipeline {
...
@@ -45,6 +45,14 @@ pipeline {
}
}
}
}
}
}
post {
failure {
script {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Merge Conflicts -- Cannot perform CI"
addGitLabMRComment comment: message
}
}
}
}
}
stage ("Start VM -- cppcheck") {
stage ("Start VM -- cppcheck") {
...
...
ci-scripts/buildOnVM.sh
View file @
69db8ed7
...
@@ -69,6 +69,7 @@ VM_TEMPLATE=ci-
...
@@ -69,6 +69,7 @@ VM_TEMPLATE=ci-
JOB_NAME
=
XX
JOB_NAME
=
XX
BUILD_ID
=
XX
BUILD_ID
=
XX
VM_NAME
=
ci-enb-usrp
VM_NAME
=
ci-enb-usrp
VM_MEMORY
=
2048
ARCHIVES_LOC
=
enb_usrp
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel14.txt
LOG_PATTERN
=
.Rel14.txt
NB_PATTERN_FILES
=
4
NB_PATTERN_FILES
=
4
...
@@ -130,6 +131,7 @@ case $key in
...
@@ -130,6 +131,7 @@ case $key in
;;
;;
-v4
)
-v4
)
VM_NAME
=
ci-cppcheck
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
ARCHIVES_LOC
=
cppcheck
ARCHIVES_LOC
=
cppcheck
LOG_PATTERN
=
cppcheck.xml
LOG_PATTERN
=
cppcheck.xml
NB_PATTERN_FILES
=
1
NB_PATTERN_FILES
=
1
...
@@ -194,6 +196,7 @@ case $key in
...
@@ -194,6 +196,7 @@ case $key in
;;
;;
cppcheck
)
cppcheck
)
VM_NAME
=
ci-cppcheck
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
ARCHIVES_LOC
=
cppcheck
ARCHIVES_LOC
=
cppcheck
LOG_PATTERN
=
cppcheck.xml
LOG_PATTERN
=
cppcheck.xml
NB_PATTERN_FILES
=
1
NB_PATTERN_FILES
=
1
...
@@ -281,7 +284,7 @@ then
...
@@ -281,7 +284,7 @@ then
echo
"############################################################"
echo
"############################################################"
echo
"Creating VM (
$VM_NAME
) on Ubuntu Cloud Image base"
echo
"Creating VM (
$VM_NAME
) on Ubuntu Cloud Image base"
echo
"############################################################"
echo
"############################################################"
uvt-kvm create
$VM_NAME
release
=
xenial
--memory
2048
--cpu
4
--unsafe-caching
--template
ci-scripts/template-host.xml
uvt-kvm create
$VM_NAME
release
=
xenial
--memory
$VM_MEMORY
--cpu
4
--unsafe-caching
--template
ci-scripts/template-host.xml
fi
fi
echo
"Waiting for VM to be started"
echo
"Waiting for VM to be started"
...
@@ -307,7 +310,8 @@ then
...
@@ -307,7 +310,8 @@ then
echo
"sudo apt-get --yes install zip cppcheck >> zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"sudo apt-get --yes install zip cppcheck >> zip-install.txt 2>&1"
>>
$VM_CMDS
else
else
echo
"echo
\"
sudo apt-get --yes --quiet install zip subversion libboost-dev
\"
"
>>
$VM_CMDS
echo
"echo
\"
sudo apt-get --yes --quiet install zip subversion libboost-dev
\"
"
>>
$VM_CMDS
echo
"sudo apt-get --yes install zip subversion libboost-dev > zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"sudo apt-get update > zip-install.txt 2>&1"
>>
$VM_CMDS
echo
"sudo apt-get --yes install zip subversion libboost-dev >> zip-install.txt 2>&1"
>>
$VM_CMDS
fi
fi
echo
"mkdir tmp"
>>
$VM_CMDS
echo
"mkdir tmp"
>>
$VM_CMDS
echo
"cd tmp"
>>
$VM_CMDS
echo
"cd tmp"
>>
$VM_CMDS
...
...
ci-scripts/createVM.sh
View file @
69db8ed7
...
@@ -60,6 +60,7 @@ then
...
@@ -60,6 +60,7 @@ then
fi
fi
VM_TEMPLATE
=
ci-
VM_TEMPLATE
=
ci-
VM_MEMORY
=
2048
JOB_NAME
=
XX
JOB_NAME
=
XX
BUILD_ID
=
XX
BUILD_ID
=
XX
VM_NAME
=
ci-enb-usrp
VM_NAME
=
ci-enb-usrp
...
@@ -98,6 +99,7 @@ case $key in
...
@@ -98,6 +99,7 @@ case $key in
;;
;;
-v4
)
-v4
)
VM_NAME
=
ci-cppcheck
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
shift
shift
;;
;;
-v5
)
-v5
)
...
@@ -130,6 +132,7 @@ case $key in
...
@@ -130,6 +132,7 @@ case $key in
;;
;;
cppcheck
)
cppcheck
)
VM_NAME
=
ci-cppcheck
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
;;
;;
gnb-usrp
)
gnb-usrp
)
VM_NAME
=
ci-gnb-usrp
VM_NAME
=
ci-gnb-usrp
...
@@ -176,7 +179,7 @@ echo "VM_NAME = $VM_NAME"
...
@@ -176,7 +179,7 @@ echo "VM_NAME = $VM_NAME"
echo
"############################################################"
echo
"############################################################"
echo
"Creating VM (
$VM_NAME
) on Ubuntu Cloud Image base"
echo
"Creating VM (
$VM_NAME
) on Ubuntu Cloud Image base"
echo
"############################################################"
echo
"############################################################"
uvt-kvm create
$VM_NAME
release
=
xenial
--memory
2048
--cpu
4
--unsafe-caching
--template
ci-scripts/template-host.xml
uvt-kvm create
$VM_NAME
release
=
xenial
--memory
$VM_MEMORY
--cpu
4
--unsafe-caching
--template
ci-scripts/template-host.xml
echo
"Waiting for VM to be started"
echo
"Waiting for VM to be started"
uvt-kvm
wait
$VM_NAME
--insecure
uvt-kvm
wait
$VM_NAME
--insecure
...
...
ci-scripts/doGitLabMerge.sh
View file @
69db8ed7
...
@@ -104,6 +104,10 @@ git checkout -f $SOURCE_COMMIT_ID
...
@@ -104,6 +104,10 @@ git checkout -f $SOURCE_COMMIT_ID
git merge
--ff
$TARGET_COMMIT_ID
-m
"Temporary merge for CI"
git merge
--ff
$TARGET_COMMIT_ID
-m
"Temporary merge for CI"
exit
0
STATUS
=
`
git status | egrep
-c
"You have unmerged paths.|fix conflicts"
`
if
[
$STATUS
-ne
0
]
then
echo
"There are merge conflicts.. Cannot perform further build tasks"
STATUS
=
-1
fi
exit
$STATUS
tmp/ci-scripts/Jenkinsfile-gitlab
deleted
100644 → 0
View file @
66e9fe97
// Comments
pipeline {
agent {
label 'bellatrix'
}
options {
disableConcurrentBuilds()
timestamps()
gitLabConnection('OAI GitLab')
gitlabBuilds(builds: ["Build eNb-USRP", "Build basic-sim", "Build phy-sim", "Analysis with cppcheck"])
}
stages {
stage ("Verify Guidelines") {
steps {
echo "Git URL is ${GIT_URL}"
echo "GitLab Act is ${env.gitlabActionType}"
script {
if ("MERGE".equals(env.gitlabActionType)) {
// GitLab-Jenkins plugin integration is lacking to perform the merge by itself
// Doing it manually --> it may have merge conflicts
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
sh "zip -r -qq localZip.zip ."
// Running astyle options on the list of modified files by the merge request
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
sh "./ci-scripts/checkCodingFormattingRules.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
def res=readFile('./oai_rules_result.txt').trim();
if ("0".equals(res)) {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): All Changed files in Merge Request follow OAI Formatting Rules"
addGitLabMRComment comment: message
} else {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some Changed files in Merge Request DO NOT follow OAI Formatting Rules"
addGitLabMRComment comment: message
}
} else {
echo "Git Branch is ${GIT_BRANCH}"
echo "Git Commit is ${GIT_COMMIT}"
sh "zip -r -qq localZip.zip ."
// Running astyle options on all C/H files in the repository
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
sh "./ci-scripts/checkCodingFormattingRules.sh"
}
}
}
}
stage ("Variant Builds") {
parallel {
stage ("Analysis with cppcheck") {
steps {
gitlabCommitStatus(name: "Analysis with cppcheck") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
stage ("Build eNb-USRP") {
steps {
gitlabCommitStatus(name: "Build eNb-USRP") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
stage ("Build basic simulator") {
steps {
gitlabCommitStatus(name: "Build basic-sim") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
stage ("Build physical simulators") {
steps {
gitlabCommitStatus(name: "Build phy-sim") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
}
post {
always {
script {
dir ('archives') {
sh "zip -r vm_build_logs.zip basic_sim enb_usrp phy_sim cppcheck"
}
if(fileExists('archives/vm_build_logs.zip')) {
archiveArtifacts artifacts: 'archives/vm_build_logs.zip'
}
if ("MERGE".equals(env.gitlabActionType)) {
sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
} else {
sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}"
}
if(fileExists('build_results.html')) {
archiveArtifacts artifacts: 'build_results.html'
}
}
}
}
}
stage ("Destroy all Virtual Machines") {
steps {
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
}
post {
always {
script {
// Stage destroy may not be run if error in previous stage
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
success {
script {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ")"
if ("MERGE".equals(env.gitlabActionType)) {
echo "This is a MERGE event"
addGitLabMRComment comment: message
def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
slackSend channel: 'ci-enb', color: 'good', message: message2
} else {
slackSend channel: 'ci-enb', color: 'good', message: message
}
}
}
failure {
script {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")"
if ("MERGE".equals(env.gitlabActionType)) {
echo "This is a MERGE event"
addGitLabMRComment comment: message
def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
slackSend channel: 'ci-enb', color: 'danger', message: message2
} else {
slackSend channel: 'ci-enb', color: 'danger', message: message
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment