Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
epm-docker-test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
epm-docker-test
Commits
d259f1f6
Commit
d259f1f6
authored
Apr 01, 2026
by
Ivan Mazhukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix path detections; fix syncing
parent
c7d01824
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
16 deletions
+66
-16
epm-docker-test.sh
epm-docker-test.sh
+66
-16
No files found.
epm-docker-test.sh
View file @
d259f1f6
...
...
@@ -174,21 +174,40 @@ resolve_explicit_source_path() {
printf
'%s\n'
"
$candidate
"
}
default_builder_source_
path
()
{
default_builder_source_
user
()
{
local
current_user source_user
current_user
=
"
$(
id
-un
)
"
source_user
=
"
${
BUILDER_USER
:-
$current_user
}
"
printf
'%s\n'
"
$source_user
"
}
builder_source_candidates
()
{
local
source_user
source_user
=
"
$(
default_builder_source_user
)
"
printf
'/srv/%s/Projects/eepm\n'
"
$source_user
"
}
resolve_builder_source_path
()
{
local
candidate
candidate
=
"
${
BUILDER_PATH
:-$(
default_builder_source_path
)}
"
candidate
=
"
$(
realpath
"
$candidate
"
2>/dev/null
||
printf
'%s\n'
"
$candidate
"
)
"
verify_eepm_tree
"
$candidate
"
printf
'%s\n'
"
$candidate
"
if
[[
-n
"
$BUILDER_PATH
"
]]
;
then
candidate
=
"
$(
realpath
"
$BUILDER_PATH
"
2>/dev/null
||
printf
'%s\n'
"
$BUILDER_PATH
"
)
"
verify_eepm_tree
"
$candidate
"
printf
'%s\n'
"
$candidate
"
return
0
fi
while
IFS
=
read
-r
candidate
;
do
candidate
=
"
$(
realpath
"
$candidate
"
2>/dev/null
||
printf
'%s\n'
"
$candidate
"
)
"
if
[[
-d
"
$candidate
"
&&
-f
"
$candidate
/bin/eepm"
&&
-r
"
$candidate
/bin/eepm"
]]
;
then
printf
'%s\n'
"
$candidate
"
return
0
fi
done
< <
(
builder_source_candidates
)
fatal
"Could not find builder64 eepm tree under /srv/
$(
default_builder_source_user
)
/Projects/eepm"
}
resolve_source_path
()
{
...
...
@@ -225,9 +244,32 @@ remote_eepm_tree_exists() {
local
tree
=
"
$2
"
build_ssh_base_args
ssh
"
${
SSH_BASE_ARGS
[@]
}
"
"
$target
"
\
bash
-lc
'test -d "$1" && test -f "$1/bin/eepm" && test -r "$1/bin/eepm"'
\
bash
"
$tree
"
>
/dev/null 2>&1
ssh
"
${
SSH_BASE_ARGS
[@]
}
"
"
$target
"
bash
-s
--
"
$tree
"
>
/dev/null 2>&1
<<
'
EOF
'
tree="
$1
"
test -d "
$tree
" && test -f "
$tree
/bin/eepm" && test -r "
$tree
/bin/eepm"
EOF
}
find_remote_builder_source_path
()
{
local
target
=
"
$1
"
local
candidate
if
[[
-n
"
$BUILDER_PATH
"
]]
;
then
if
remote_eepm_tree_exists
"
$target
"
"
$BUILDER_PATH
"
;
then
printf
'%s\n'
"
$BUILDER_PATH
"
return
0
fi
return
1
fi
while
IFS
=
read
-r
candidate
;
do
if
remote_eepm_tree_exists
"
$target
"
"
$candidate
"
;
then
printf
'%s\n'
"
$candidate
"
return
0
fi
done
< <
(
builder_source_candidates
)
return
1
}
remote_sync_dir_for_source
()
{
...
...
@@ -254,7 +296,10 @@ sync_local_source_to_remote() {
info
"Remote eepm tree not found in /srv; syncing local tree to
$target
:
$remote_dir
"
ssh
"
${
SSH_BASE_ARGS
[@]
}
"
"
$target
"
mkdir
-p
"
$remote_dir
"
ssh
"
${
SSH_BASE_ARGS
[@]
}
"
"
$target
"
bash
-s
--
"
$remote_dir
"
<<
'
EOF
'
remote_dir="
$1
"
mkdir -p "
$remote_dir
"
EOF
rsync
-a
--delete
-e
"ssh
${
SSH_BASE_ARGS
[*]
}
"
"
$source_dir
"
/
"
$target
:
$remote_dir
/"
printf
'%s\n'
"
$remote_dir
"
...
...
@@ -272,7 +317,10 @@ cleanup_remote_sync_dir() {
build_ssh_base_args
info
"Cleaning up remote sync dir:
$target
:
$remote_dir
"
ssh
"
${
SSH_BASE_ARGS
[@]
}
"
"
$target
"
rm
-rf
"
$remote_dir
"
ssh
"
${
SSH_BASE_ARGS
[@]
}
"
"
$target
"
bash
-s
--
"
$remote_dir
"
<<
'
EOF
'
remote_dir="
$1
"
rm -rf "
$remote_dir
"
EOF
}
create_log_file
()
{
...
...
@@ -421,21 +469,23 @@ build_remote_args() {
target
=
"
$(
remote_target
)
"
if
[[
"
$SOURCE_KIND
"
==
"local"
]]
;
then
explicit_source
=
"
$(
resolve_local_source_path
)
"
remote_source
=
"
$(
default_builder_source_path
)
"
if
remote_eepm_tree_exists
"
$target
"
"
$remote_source
"
;
then
if
remote_source
=
"
$(
find_remote_builder_source_path
"
$target
"
)
"
;
then
info
"Remote eepm tree found at:
$remote_source
"
else
explicit_source
=
"
${
SOURCE_PATH
:-$(
pwd
-P
)}
"
explicit_source
=
"
$(
realpath
"
$explicit_source
"
)
"
verify_eepm_tree
"
$explicit_source
"
remote_source
=
"
$(
sync_local_source_to_remote
"
$explicit_source
"
"
$target
"
)
"
REMOTE_SYNC_DIR
=
"
$remote_source
"
fi
REMOTE_ARGS+
=(
--eepm-source
explicit
--eepm-dir
"
$remote_source
"
)
elif
[[
"
$SOURCE_KIND
"
==
"explicit"
]]
;
then
explicit_source
=
"
$(
resolve_explicit_source_path
"
$SOURCE_PATH
"
)
"
remote_source
=
"
$(
default_builder_source_path
)
"
if
remote_eepm_tree_exists
"
$target
"
"
$remote_source
"
;
then
if
remote_source
=
"
$(
find_remote_builder_source_path
"
$target
"
)
"
;
then
info
"Remote eepm tree found at:
$remote_source
"
else
[[
-n
"
$SOURCE_PATH
"
]]
||
fatal
"Explicit source path is empty"
explicit_source
=
"
$(
realpath
"
$SOURCE_PATH
"
2>/dev/null
||
printf
'%s\n'
"
$SOURCE_PATH
"
)
"
verify_eepm_tree
"
$explicit_source
"
remote_source
=
"
$(
sync_local_source_to_remote
"
$explicit_source
"
"
$target
"
)
"
REMOTE_SYNC_DIR
=
"
$remote_source
"
fi
...
...
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