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
0deedc3b
Commit
0deedc3b
authored
Mar 31, 2026
by
Ivan Mazhukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clenup after test
parent
707e5780
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
README.md
README.md
+2
-0
epm-docker-test.sh
epm-docker-test.sh
+38
-2
No files found.
README.md
View file @
0deedc3b
...
...
@@ -123,6 +123,7 @@ bin/eepm
1.
На удалённой стороне проверяется типовой путь
`/srv/<user>/Projects/eepm`
.
2.
Если он найден, используется он.
3.
Если он не найден, локальное дерево
`eepm`
синхронизируется на удалённую сторону через
`rsync`
.
4.
После завершения теста синхронизированная временная копия удаляется.
Если выбран
`--eepm-source builder64`
, скрипт ожидает, что удалённое дерево уже существует в
`/srv/...`
.
...
...
@@ -219,4 +220,5 @@ ${TMPDIR:-/tmp}/epm-docker-test
-
поддерживается только
`epm play`
-
для синхронизации локального дерева на удалённую сторону используется
`rsync`
-
синхронизированная временная копия на удалённой стороне удаляется после завершения теста
-
источник
`local`
ожидает либо запуска скрипта из корня
`eepm`
, либо передачи
`--eepm-dir`
epm-docker-test.sh
View file @
0deedc3b
...
...
@@ -24,6 +24,8 @@ INTERNAL_LOCAL_RUN=0
LOG_ROOT
=
"
$DEFAULT_LOG_ROOT
"
LOG_FILE
=
""
REMOTE_ARGS
=()
REMOTE_SYNC_DIR
=
""
RUN_TOKEN
=
"
$(
date
+%Y%m%d-%H%M%S
)
-
$$
"
usage
()
{
cat
<<
'
EOF
'
...
...
@@ -233,7 +235,10 @@ remote_sync_dir_for_source() {
local_user
=
"
$(
id
-un
)
"
base_name
=
"
$(
basename
"
$source_dir
"
)
"
printf
'/tmp/epm-docker-test-sync/%s-%s\n'
"
$(
slugify
"
$local_user
"
)
"
"
$(
slugify
"
$base_name
"
)
"
printf
'/tmp/epm-docker-test-sync/%s-%s-%s\n'
\
"
$(
slugify
"
$local_user
"
)
"
\
"
$(
slugify
"
$base_name
"
)
"
\
"
$(
slugify
"
$RUN_TOKEN
"
)
"
}
sync_local_source_to_remote
()
{
...
...
@@ -254,6 +259,21 @@ sync_local_source_to_remote() {
printf
'%s\n'
"
$remote_dir
"
}
cleanup_remote_sync_dir
()
{
local
target
=
"
$1
"
local
remote_dir
=
"
$2
"
[[
-n
"
$remote_dir
"
]]
||
return
0
[[
"
$remote_dir
"
==
/tmp/epm-docker-test-sync/
*
]]
||
{
warn
"Skipping cleanup for unexpected remote path:
$remote_dir
"
return
0
}
build_ssh_base_args
info
"Cleaning up remote sync dir:
$target
:
$remote_dir
"
ssh
"
${
SSH_BASE_ARGS
[@]
}
"
"
$target
"
rm
-rf
"
$remote_dir
"
}
create_log_file
()
{
local
safe_app safe_system run_dir timestamp
...
...
@@ -398,6 +418,7 @@ build_remote_args() {
local
target
REMOTE_ARGS
=(
--internal-local-run
--mode
local
)
REMOTE_SYNC_DIR
=
""
target
=
"
$(
remote_target
)
"
if
[[
"
$SOURCE_KIND
"
==
"local"
]]
;
then
...
...
@@ -407,6 +428,7 @@ build_remote_args() {
info
"Remote eepm tree found at:
$remote_source
"
else
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
...
...
@@ -416,6 +438,7 @@ build_remote_args() {
info
"Remote eepm tree found at:
$remote_source
"
else
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
"
)
else
...
...
@@ -430,6 +453,7 @@ build_remote_args() {
run_container_via_ssh
()
{
local
target
local
-a
ssh_args
local
status
require_command ssh
...
...
@@ -446,7 +470,19 @@ run_container_via_ssh() {
bash
-s
--
)
ssh
"
${
ssh_args
[@]
}
"
"
${
REMOTE_ARGS
[@]
}
"
<
"
$SCRIPT_PATH
"
if
ssh
"
${
ssh_args
[@]
}
"
"
${
REMOTE_ARGS
[@]
}
"
<
"
$SCRIPT_PATH
"
;
then
status
=
0
else
status
=
$?
fi
if
[[
-n
"
$REMOTE_SYNC_DIR
"
]]
;
then
if
!
cleanup_remote_sync_dir
"
$target
"
"
$REMOTE_SYNC_DIR
"
;
then
warn
"Failed to clean up remote sync dir:
$REMOTE_SYNC_DIR
"
fi
fi
return
"
$status
"
}
run_once
()
{
...
...
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