Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
devportal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
hive
devportal
Commits
c4a216b2
Commit
c4a216b2
authored
4 years ago
by
inertia
Browse files
Options
Downloads
Patches
Plain Diff
#46
added new task
parent
e1059d38
No related branches found
No related tags found
2 merge requests
!104
Deploy to Production
,
!102
#46 added new task
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Rakefile
+52
-5
52 additions, 5 deletions
Rakefile
with
52 additions
and
5 deletions
Rakefile
+
52
−
5
View file @
c4a216b2
...
@@ -121,6 +121,37 @@ task :dgpo_dump do
...
@@ -121,6 +121,37 @@ task :dgpo_dump do
puts
known_undocumented_keys
.
map
{
|
k
|
"
\t
#{
k
}
"
}
puts
known_undocumented_keys
.
map
{
|
k
|
"
\t
#{
k
}
"
}
end
end
desc
'Dump all config keys.'
task
:config_dump
do
file_name
=
'_data/objects/config.yml'
yaml
=
YAML
.
load_file
(
file_name
)
api
=
Hive
::
DatabaseApi
.
new
all_keys
=
api
.
get_config
.
result
.
keys
known_keys
=
[]
removed_keys
=
[]
unknown_keys
=
[]
known_undocumented_keys
=
[]
yaml
[
0
][
'fields'
].
map
do
|
field
|
field_name
=
field
[
'name'
]
known_keys
<<
field_name
if
all_keys
.
include?
field_name
removed_keys
<<
field_name
if
!!
field
[
'removed'
]
known_undocumented_keys
<<
field_name
if
all_keys
.
include?
(
field_name
)
&&
field
[
'purpose'
].
nil?
end
unknown_keys
=
all_keys
-
known_keys
puts
"Known keys:"
puts
known_keys
.
map
{
|
k
|
"
\t
#{
k
}
"
}
puts
"Removed keys:"
puts
removed_keys
.
map
{
|
k
|
"
\t
#{
k
}
"
}
puts
"Unknown keys:"
puts
unknown_keys
.
map
{
|
k
|
"
\t
#{
k
}
"
}
puts
"Known, undocumented keys:"
puts
known_undocumented_keys
.
map
{
|
k
|
"
\t
#{
k
}
"
}
end
namespace
:test
do
namespace
:test
do
KNOWN_APIS
=
%i(
KNOWN_APIS
=
%i(
account_by_key_api account_history_api block_api condenser_api
account_by_key_api account_history_api block_api condenser_api
...
@@ -252,11 +283,27 @@ end
...
@@ -252,11 +283,27 @@ end
desc
'Sample a page.'
desc
'Sample a page.'
task
:sample
do
task
:sample
do
sitemap
=
Nokogiri
::
XML
(
File
.
open
(
'_site/sitemap.xml'
))
sitemap
=
Nokogiri
::
XML
(
File
.
open
(
'_site/sitemap.xml'
))
links
=
[]
sitemap
.
root
.
children
.
to_a
.
sample
(
10
).
each
do
|
e
|
if
10
>
rand
()
*
100
if
!!
e
.
children
file_name
=
'_data/objects/config.yml'
puts
e
.
children
yaml
=
YAML
.
load_file
(
file_name
)
exit
key
=
yaml
[
0
][
'fields'
].
sample
[
'name'
]
end
puts
"https://developers.hive.io/tutorials-recipes/understanding-configuration-values.html#
#{
key
}
"
exit
elsif
10
>
rand
()
*
100
file_name
=
'_data/objects/dgpo.yml'
yaml
=
YAML
.
load_file
(
file_name
)
key
=
yaml
[
0
][
'fields'
].
sample
[
'name'
]
puts
"https://developers.hive.io/tutorials-recipes/understanding-dynamic-global-properties.html#
#{
key
}
"
exit
end
while
links
.
empty?
links
+=
sitemap
.
root
.
children
.
to_a
.
sample
(
10
).
map
(
&
:children
).
compact
.
reject
(
&
:empty?
)
end
end
puts
links
.
sample
.
children
.
first
.
to_s
.
gsub
(
'http://localhost:4000'
,
'https://developers.hive.io'
)
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