Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
oai-cn5g-smf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
oai
cn5g
oai-cn5g-smf
Commits
78b39c24
Commit
78b39c24
authored
4 years ago
by
Raphael Defosseux
Browse files
Options
Downloads
Patches
Plain Diff
CI: fix pipeline in MR case
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
701f1d20
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci-scripts/Jenkinsfile-GitLab-Docker
+20
-3
20 additions, 3 deletions
ci-scripts/Jenkinsfile-GitLab-Docker
with
20 additions
and
3 deletions
ci-scripts/Jenkinsfile-GitLab-Docker
+
20
−
3
View file @
78b39c24
...
@@ -130,7 +130,7 @@ pipeline {
...
@@ -130,7 +130,7 @@ pipeline {
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
// Building a temporary image
// Building a temporary image
myShCmd
(
'docker image prune --force'
,
new_host_flag
,
new_host_user
,
new_host
)
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
.
g
hpr
bSourceBranch
+
'" --build-arg CI_SRC_COMMIT="'
+
env
.
g
hprbActual
Commit
+
'" --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
.
g
itla
bSourceBranch
+
'" --build-arg CI_SRC_COMMIT="'
+
env
.
g
itlabMergeRequestLast
Commit
+
'" --build-arg CI_DEST_BRANCH="
'
+
env
.
gitlabTargetBranch
+
'
" . > archives/smf_docker_image_build.log 2>&1'
,
new_host_flag
,
new_host_user
,
new_host
)
}
else
{
}
else
{
// Currently this pipeline only runs for pushes to `develop` branch
// Currently this pipeline only runs for pushes to `develop` branch
// First clean image registry
// First clean image registry
...
@@ -213,7 +213,7 @@ pipeline {
...
@@ -213,7 +213,7 @@ pipeline {
// We install a dedicated version (installed on our CI server).
// 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
)
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
))
{
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
.
g
hpr
bSourceBranch
+
' --target-branch '
+
env
.
g
hpr
bTargetBranch
+
'"'
,
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
.
g
itla
bSourceBranch
+
' --target-branch '
+
env
.
g
itla
bTargetBranch
+
'"'
,
new_host_flag
,
new_host_user
,
new_host
)
}
else
{
}
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
)
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 {
...
@@ -242,6 +242,24 @@ pipeline {
}
}
}
}
post
{
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
{
cleanup
{
script
{
script
{
// Removing temporary / intermediate images
// Removing temporary / intermediate images
...
@@ -302,7 +320,6 @@ def copyTo2ndServer(filename, flag, user, host) {
...
@@ -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} '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'"
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-smf-cfg'"
sh
"ssh ${user}@${host} 'mkdir -p /tmp/CI-CN-SMF/archives/oai-mme-cfg'"
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment