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
spbro
OpenXG-RAN
Commits
551d35bf
Commit
551d35bf
authored
Oct 10, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cls_containerize.CreateWorkspace(): make blobless clone to speedup
parent
aae5b3f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+15
-14
No files found.
ci-scripts/cls_containerize.py
View file @
551d35bf
...
...
@@ -53,33 +53,34 @@ import constants as CONST
# (e.g., cls_cluster.py)
#-----------------------------------------------------------
def
CreateWorkspace
(
sshSession
,
sourcePath
,
ranRepository
,
ranCommitID
,
ranTargetBranch
,
ranAllowMerge
):
# on RedHat/CentOS .git extension is mandatory
result
=
re
.
search
(
'([a-zA-Z0-9\:\-\.\/])+\.git'
,
ranRepository
)
if
result
is
not
None
:
full_ran_repo_name
=
ranRepository
.
replace
(
'git/'
,
'git'
)
else
:
full_ran_repo_name
=
ranRepository
+
'.git'
if
ranCommitID
==
''
:
logging
.
error
(
'need ranCommitID in CreateWorkspace()'
)
sys
.
exit
(
'Insufficient Parameter in CreateWorkspace()'
)
sshSession
.
command
(
f'rm -rf
{
sourcePath
}
'
,
'\$'
,
10
)
sshSession
.
command
(
'mkdir -p '
+
sourcePath
,
'\$'
,
5
)
sshSession
.
command
(
'cd '
+
sourcePath
,
'\$'
,
5
)
sshSession
.
command
(
'if [ ! -e .git ]; then stdbuf -o0 git clone '
+
full_ran_repo_name
+
' .; else stdbuf -o0 git fetch --prune; fi'
,
'\$'
,
60
0
)
sshSession
.
command
(
f'git clone --filter=blob:none -n -b develop
{
full_ran_repo_name
}
.'
,
'\$'
,
6
0
)
if
sshSession
.
getBefore
().
count
(
'done.'
)
==
0
:
logging
.
warning
(
'did not find
\'
done.
\'
in git output while cloning/fetching, was not successful?'
)
sshSession
.
command
(
'git config user.email "jenkins@openairinterface.org"'
,
'\$'
,
5
)
sshSession
.
command
(
'git config user.name "OAI Jenkins"'
,
'\$'
,
5
)
sshSession
.
command
(
'git clean -x -d -ff'
,
'\$'
,
30
)
sshSession
.
command
(
'mkdir -p cmake_targets/log'
,
'\$'
,
5
)
# if the commit ID is provided use it to point to it
if
ranCommitID
!=
''
:
sshSession
.
command
(
'git checkout -f '
+
ranCommitID
,
'\$'
,
30
)
sshSession
.
command
(
f'git checkout -f
{
ranCommitID
}
'
,
'\$'
,
30
)
if
sshSession
.
getBefore
().
count
(
f'HEAD is now at
{
ranCommitID
[:
6
]
}
'
)
!=
1
:
sshSession
.
command
(
'git log --oneline | head -n5'
,
'\$'
,
5
)
logging
.
warning
(
f'problems during checkout, is at:
{
sshSession
.
getBefore
()
}
'
)
else
:
logging
.
debug
(
'successful checkout'
)
# if the branch is not develop, then it is a merge request and we need to do
# the potential merge. Note that merge conflicts should already been checked earlier
if
ranAllowMerge
:
if
ranTargetBranch
==
''
:
sshSession
.
command
(
'git merge --ff origin/develop -m "Temporary merge for CI"'
,
'\$'
,
5
)
else
:
logging
.
debug
(
'Merging with the target branch: '
+
ranTargetBranch
)
sshSession
.
command
(
'git merge --ff origin/'
+
ranTargetBranch
+
' -m "Temporary merge for CI"'
,
'\$'
,
5
)
ranTargetBranch
=
'develop'
logging
.
debug
(
f'Merging with the target branch:
{
ranTargetBranch
}
'
)
sshSession
.
command
(
f'git merge --ff origin/
{
ranTargetBranch
}
-m "Temporary merge for CI"'
,
'\$'
,
5
)
def
CopyLogsToExecutor
(
sshSession
,
sourcePath
,
log_name
,
scpIp
,
scpUser
,
scpPw
):
sshSession
.
command
(
f'cd
{
sourcePath
}
/cmake_targets'
,
'\$'
,
5
)
...
...
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