Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
wangwenhui
OpenXG-RAN
Commits
966b3a05
Commit
966b3a05
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
aed7cdf1
08b2d4f9
Changes
5
Hide 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 @
966b3a05
...
...
@@ -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") {
...
...
ci-scripts/buildOnVM.sh
View file @
966b3a05
...
...
@@ -69,6 +69,7 @@ VM_TEMPLATE=ci-
JOB_NAME
=
XX
BUILD_ID
=
XX
VM_NAME
=
ci-enb-usrp
VM_MEMORY
=
2048
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel14.txt
NB_PATTERN_FILES
=
4
...
...
@@ -130,6 +131,7 @@ case $key in
;;
-v4
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
ARCHIVES_LOC
=
cppcheck
LOG_PATTERN
=
cppcheck.xml
NB_PATTERN_FILES
=
1
...
...
@@ -194,6 +196,7 @@ case $key in
;;
cppcheck
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
ARCHIVES_LOC
=
cppcheck
LOG_PATTERN
=
cppcheck.xml
NB_PATTERN_FILES
=
1
...
...
@@ -281,7 +284,7 @@ then
echo
"############################################################"
echo
"Creating VM (
$VM_NAME
) on Ubuntu Cloud Image base"
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
echo
"Waiting for VM to be started"
...
...
@@ -307,7 +310,8 @@ then
echo
"sudo apt-get --yes install zip cppcheck >> zip-install.txt 2>&1"
>>
$VM_CMDS
else
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
echo
"mkdir tmp"
>>
$VM_CMDS
echo
"cd tmp"
>>
$VM_CMDS
...
...
ci-scripts/createVM.sh
View file @
966b3a05
...
...
@@ -60,6 +60,7 @@ then
fi
VM_TEMPLATE
=
ci-
VM_MEMORY
=
2048
JOB_NAME
=
XX
BUILD_ID
=
XX
VM_NAME
=
ci-enb-usrp
...
...
@@ -98,6 +99,7 @@ case $key in
;;
-v4
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
shift
;;
-v5
)
...
...
@@ -130,6 +132,7 @@ case $key in
;;
cppcheck
)
VM_NAME
=
ci-cppcheck
VM_MEMORY
=
8192
;;
gnb-usrp
)
VM_NAME
=
ci-gnb-usrp
...
...
@@ -176,7 +179,7 @@ echo "VM_NAME = $VM_NAME"
echo
"############################################################"
echo
"Creating VM (
$VM_NAME
) on Ubuntu Cloud Image base"
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"
uvt-kvm
wait
$VM_NAME
--insecure
...
...
ci-scripts/doGitLabMerge.sh
View file @
966b3a05
...
...
@@ -104,6 +104,10 @@ git checkout -f $SOURCE_COMMIT_ID
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 @
aed7cdf1
// 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