Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tools for technical analysts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Digital Preservation
tools for technical analysts
Commits
53549e20
Commit
53549e20
authored
1 year ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- added permanent-volume to init
parent
fce12d56
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/SLUB/LZA/TA.pm
+2
-1
2 additions, 1 deletion
lib/SLUB/LZA/TA.pm
lib/SLUB/LZA/TA/Command/init.pm
+11
-1
11 additions, 1 deletion
lib/SLUB/LZA/TA/Command/init.pm
lib/Test/TA.pm
+8
-0
8 additions, 0 deletions
lib/Test/TA.pm
t/02-init.t
+6
-1
6 additions, 1 deletion
t/02-init.t
with
27 additions
and
3 deletions
lib/SLUB/LZA/TA.pm
+
2
−
1
View file @
53549e20
...
...
@@ -51,7 +51,7 @@ BEGIN {
sub
common_global_validate
{
my
(
$self
,
$opt
,
$args
)
=
@_
;
foreach
my
$override
(
qw(elasticsearch_host elasticsearch_port http_only)
)
{
foreach
my
$override
(
qw(elasticsearch_host elasticsearch_port http_only
permanent-volume
)
)
{
if
(
(
exists
$opt
->
{
$override
})
and
(
$config
{
$override
}
ne
$opt
->
{
$override
})
...
...
@@ -77,6 +77,7 @@ sub common_global_opt_spec {
[
"
elasticsearch-host|e=s
"
=>
"
host adress where Archivematica's ElasticSearch runs, overrides config value (command 'init')
"
],
[
"
elasticsearch-port|E=s
"
=>
"
port of Archivematica's ElasticSearch, overrides config value (command 'init')
",
{
default
=>
9200
}
],
[
"
http-only
"
=>
"
use HTTP instead HTTPS, overrides config value (command 'init')
"],
[
"
permanent-volume|P=s@
"
=>
"
path[s] to volume where Archivematica stores AIPs permanently, overrides config value (command 'init'), repeatable)
"],
#[ "logdir|l=s" => "logdir where Archivematica stores it server log files"],
);
}
...
...
This diff is collapsed.
Click to expand it.
lib/SLUB/LZA/TA/Command/init.pm
+
11
−
1
View file @
53549e20
...
...
@@ -16,15 +16,17 @@ sub description { return "Initialize $0, preparing config file using given optio
sub
opt_spec
{
my
@global_opts
=
grep
{
defined
$_
->
[
0
]
and
$_
->
[
0
]
!~
m/^(elasticsearch-(host|port))|(http-only)/
;
and
$_
->
[
0
]
!~
m/^(elasticsearch-(host|port))|(http-only)
|(permanent-volume)
/
;
}
SLUB::LZA::TA::
common_global_opt_spec
();
my
@local_opts
=
(
[
"
elasticsearch-host|e=s
"
=>
"
host adress of Archivematica's ElasticSearch (mandatory)
"
],
[
"
elasticsearch-port|E=s
"
=>
"
port of Archivematica's ElasticSearch
",
{
default
=>
9200
}
],
[
"
http-only
"
=>
"
use HTTP instead HTTPS
"
],
[
"
permanent-volume|P=s@
"
=>
"
path[s] to volume where Archivematica stores AIPs permanently (mandatory, repeatable)
"],
);
return
(
@global_opts
,
[]
,
@local_opts
);
}
sub
validate_args
{
my
(
$self
,
$opt
,
$args
)
=
@_
;
# no args allowed but options!
...
...
@@ -33,6 +35,13 @@ sub validate_args {
!
exists
(
$opt
->
{
elasticsearch_host
})
and
!
exists
(
$opt
->
{
help
})
);
$self
->
usage_error
("
Missed mandatory parameter '--permanent-volume'
")
if
(
!
exists
(
$opt
->
{
permanent_volume
})
and
!
exists
(
$opt
->
{
help
})
);
foreach
my
$vol
(
@
{
$opt
->
{
permanent_volume
}
})
{
$self
->
usage_error
("
Parameter '--permanent-volume' expects an existing dir, got '
$vol
'!
")
unless
-
d
$vol
;
}
return
1
;
}
...
...
@@ -43,6 +52,7 @@ sub execute {
$config
{
elasticsearch_port
}
=
$opt
->
{
elasticsearch_port
};
#$config{logdir} = $opt->{logdir};
$config
{
http_only
}
=
$opt
->
{
http_only
};
$config
{
permanent_volume
}
=
$opt
->
{
permanent_volume
};
my
$in_test
=
$ENV
{
TEST_ACTIVE
};
# next lines to fake interactive for testing
local
*
IO::Prompt::Tiny::
_is_interactive
=
*
IO::Prompt::Tiny::
_is_interactive
;
...
...
This diff is collapsed.
Click to expand it.
lib/Test/TA.pm
+
8
−
0
View file @
53549e20
...
...
@@ -26,6 +26,7 @@ sub is_testhost_available {
my
$config_file
;
my
$cache_dir
;
my
$cache_file
;
my
@permanent_volumes
;
sub
testapp
{
# contains common code for tests under t/
my
$perl
=
$^X
;
...
...
@@ -44,6 +45,12 @@ sub is_testhost_available {
$cache_file
=
$cache_dir
->
child
('
ta-tool.cache
');
my
$testhost
=
testhost
();
my
$testport
=
testport
();
my
$permanent_path
=
path
(
$testapp
->
workpath
)
->
child
('
permanent
');
$permanent_path
->
mkpath
();
@permanent_volumes
=
map
{
$permanent_path
->
child
(
$_
);
}
qw(foo bar)
;
foreach
$vol
(
@permanent_volumes
)
{
$vol
->
mkpath
();
}
$config_file
->
spew_utf8
(
<<
_CFG_
);
---
elasticsearch_host:
$testhost
...
...
@@ -51,6 +58,7 @@ elasticsearch_port: $testport
http_only:
1
logdir:
/
tmp
password:
839852
bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f980ad83d39008ad638bc41e2345
permanent_volumes:
user:
lza
_CFG_
return
$testapp
;
...
...
This diff is collapsed.
Click to expand it.
t/02-init.t
+
6
−
1
View file @
53549e20
...
...
@@ -14,6 +14,8 @@ my $testhost = Test::TA::testhost();
my
$cache_dir
=
path
(
$testapp
->
workpath
())
->
child
('
.cache
');
$cache_dir
->
mkpath
();
my
$cache_file
=
$cache_dir
->
child
('
ta-tool.cache
');
my
$permanent_path
=
path
(
$testapp
->
workpath
)
->
child
('
permanent
');
my
@permanent_volumes
=
map
{
$permanent_path
->
child
(
$_
);
}
qw(foo bar)
;
# tests
use_ok
("
SLUB::LZA::TA::Crypt
");
...
...
@@ -41,7 +43,7 @@ lza
199
fc76b9d086d8937976634e93413bcd005d941
199
fc76b9d086d8937976634e93413bcd005d941
_EOF_
args
=>
'
init -D -v -e
'
.
$testhost
,
args
=>
'
init -D -v -e
'
.
$testhost
.
join
("",
map
{"
-P
$_
"}
@permanent_volumes
)
,
#args => 'init -e sdvlzaamtestfotothek01.slub-dresden.de -l /tmp',
);
#say "STDOUT:",$testapp->stdout;
...
...
@@ -57,6 +59,9 @@ elasticsearch_host: $testhost
elasticsearch_port:
9200
http_only:
~
password:
839852
bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f980ad83d39008ad638bc41e2345
permanent_volume:
-
$permanent_volumes
[
0
]
-
$permanent_volumes
[
1
]
user:
lza
_EXP_
my
$cache
=
$cache_file
->
slurp_utf8
();
...
...
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