Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reference-repository
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
grid5000
reference-repository
Commits
833eee40
Commit
833eee40
authored
3 years ago
by
Alexandre MERLIN
Browse files
Options
Downloads
Patches
Plain Diff
[gen] add environments wiki generator
parent
333de0ae
No related branches found
No related tags found
No related merge requests found
Pipeline
#476801
passed
3 years ago
Stage: validate
Stage: generate
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/refrepo/gen/wiki.rb
+5
-0
5 additions, 0 deletions
lib/refrepo/gen/wiki.rb
lib/refrepo/gen/wiki/generators/environments.rb
+43
-0
43 additions, 0 deletions
lib/refrepo/gen/wiki/generators/environments.rb
with
48 additions
and
0 deletions
lib/refrepo/gen/wiki.rb
+
5
−
0
View file @
833eee40
...
...
@@ -8,6 +8,7 @@ require 'refrepo/gen/wiki/generators/site_hardware'
require
'refrepo/gen/wiki/generators/site_network'
require
'refrepo/gen/wiki/generators/status'
require
'refrepo/gen/wiki/generators/group_storage'
require
'refrepo/gen/wiki/generators/environments'
require
'refrepo/gen/wiki/generators/kwollect_metrics'
require
'refrepo/gen/wiki/generators/oarsub_simplifier_aliases'
...
...
@@ -38,6 +39,10 @@ module RefRepo::Gen::Wiki
:gen
=>
GroupStorageGenerator
,
:page
=>
'Generated/GroupStorage'
},
'environments'
=>
{
:gen
=>
EnvironmentsGenerator
,
:page
=>
'Generated/Environments'
},
'kwollect_metrics'
=>
{
:gen
=>
KwollectMetricsGenerator
,
:page
=>
'Generated/KwollectMetrics'
...
...
This diff is collapsed.
Click to expand it.
lib/refrepo/gen/wiki/generators/environments.rb
0 → 100644
+
43
−
0
View file @
833eee40
# coding: utf-8
class
EnvironmentsGenerator
<
WikiGenerator
OSVERSION_SORT_ORDER
=
[
'debian9'
,
'debian10'
,
'debian11'
,
'debiantesting'
,
'centos7'
,
'centos8'
,
'rocky8'
,
'centosstream8'
,
'ubuntu1804'
,
'ubuntu2004'
]
VARIANT_SORT_ORDER
=
[
'min'
,
'base'
,
'xen'
,
'nfs'
,
'big'
,
'std'
]
def
initialize
(
page_name
)
super
(
page_name
)
end
def
generate_content
(
_options
)
table_columns
=
[
"Name"
]
table_data
=
[]
envs
=
[]
G5K
::
SITES
.
each
do
|
site
|
envs
+=
RefRepo
::
Utils
::
get_api
(
"sites/
#{
site
}
/internal/kadeployapi/environments?username=deploy&last"
)
end
envs
.
select!
{
|
x
|
x
[
'visibility'
]
==
'public'
}
# The creation date can be a little different on each site, we remove it from hash before removing dupplicate
envs
.
each
{
|
x
|
x
.
delete
(
'created_at'
)}
envs
.
uniq!
table_columns
+=
envs
.
map
{
|
x
|
x
[
'arch'
]}.
uniq
.
sort
envs
=
envs
.
group_by
{
|
x
|
x
[
'name'
]}.
map
{
|
k
,
v
|
[
k
,
v
.
map
{
|
x
|
x
[
'arch'
]}]}
envs
.
each
do
|
env
|
tarch
=
table_columns
[
1
..
3
].
map
{
|
l
|
env
[
1
].
include?
(
l
)
?
'[[Image:Check.png]]'
:
'[[Image:Fail.png]]'
}
table_data
<<
[
env
[
0
]]
+
tarch
end
# Sort by OS version and variant
table_data
.
sort_by!
{
|
row
|
[
OSVERSION_SORT_ORDER
.
index
(
row
[
0
].
split
(
'-'
)[
0
])
||
100
,
VARIANT_SORT_ORDER
.
index
(
row
[
0
].
split
(
'-'
)[
1
])
||
100
]
}
# Table construction
table_options
=
'class="wikitable sortable" style="text-align: center;"'
@generated_content
=
MW
.
generate_table
(
table_options
,
table_columns
,
table_data
)
@generated_content
+=
MW
.
italic
(
MW
.
small
(
generated_date_string
))
@generated_content
+=
MW
::
LINE_FEED
end
end
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