Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MARVIN-config
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
dbpedia-assoc
MARVIN-config
Commits
0932ec42
Commit
0932ec42
authored
5 years ago
by
Marvin Hofer
Browse files
Options
Downloads
Patches
Plain Diff
generic-release.sh refactor
parent
8078124b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generic/schedule/collectExtraction.sh
+133
-0
133 additions, 0 deletions
generic/schedule/collectExtraction.sh
with
133 additions
and
0 deletions
generic/schedule/collectExtraction.sh
0 → 100644
+
133
−
0
View file @
0932ec42
#!/bin/bash
set
-e
# directory of extracted dumps. (basedir)
BASEDIR
=
"/data/extraction/wikidumps/"
# databus-maven-plugin directory
DATABUSMVNDIR
=
"/data/extraction/databus-maven-plugin/dbpedia/generic"
# databus version. empty for all
DUMPDATE
=
# if true, just show what will happen
TRYRUN
=
false
#__Maps__
mapLang
()
{
lang
=
$(
echo
"
$1
"
|
sed
's|wiki||g'
)
case
"
$lang
"
in
"bat_smg"
)
echo
"_lang=batsmg"
;;
"zh_min_nan"
)
echo
"_lang=nan"
;;
"zh_yue"
)
echo
"_lang=yue"
;;
"wikidata"
)
echo
""
;;
*
)
echo
"_lang=
$lang
"
;;
esac
}
mapExtraction
()
{
case
"
$1
"
in
"article-templates-nested"
)
echo
"article-templates_nested"
;;
"citation-data"
)
echo
"citations_data"
;;
"citation-links"
)
echo
"citations_links"
;;
"commons-page-links"
)
echo
"commons-sameas-links"
;;
"page-ids"
)
echo
"page_ids"
;;
"page-length"
)
echo
"page_length"
;;
"page-links"
)
echo
"wikilinks"
;;
"article-categories"
)
echo
"categories_articles"
;;
"category-labels"
)
echo
"categories_labels"
;;
"skos-categories"
)
echo
"categories_skos"
;;
"revision-ids"
)
echo
"revisions_ids"
;;
"revision-uris"
)
echo
"revisions_uris"
;;
*
)
echo
"
$1
"
;;
esac
}
#__Functions__
printStart
()
{
>
&2
echo
"-----------------"
>
&2
echo
" Generic Release "
>
&2
echo
"-----------------"
}
copyToMavenPlugin
()
{
# https://www.tldp.org/LDP/abs/html/string-manipulation.html#Substring%20Removal#Substring Removal
# ${string##/*}
for
path
in
$(
find
"
$BASEDIR
"
-name
"*.ttl.bz2"
)
;
do
file
=
"
${
path
##*/
}
"
version
=
"
${
file
#*-
}
"
version
=
"
${
version
%%-*
}
"
version
=
"
${
version
:0:4
}
.
${
version
:4:2
}
.
${
version
:6:2
}
"
if
[
"
$DUMPDATE
"
=
"
$version
"
]
||
[
-z
"
$DUMPDATE
"
]
;
then
lang
=
"
${
file
%%-*
}
"
extraction
=
"
${
file
#*-*-
}
"
extraction
=
"
${
extraction
%%.*
}
"
extension
=
"
${
file
#*.
}
"
mapped
=
"
$(
mapExtraction
$extraction
)
"
artifact
=
"
${
mapped
%%_*
}
"
contVars
=
"
$(
mapLang
$lang
)
"
if
[[
"
$mapped
"
==
*
"_"
*
]]
;
then
contVars
=
"
${
contVars
}
_
${
mapped
#*_
}
"
fi
targetArVe
=
"
$artifact
/
$version
"
targetFile
=
"
$artifact$contVars
.
$extension
"
if
[
-d
"
$DATABUSMVNDIR
/
$artifact
"
]
;
then
if
[
!
-d
"
$DATABUSMVNDIR
/
$targetArVe
"
]
;
then
mkdir
-p
"
$DATABUSMVNDIR
/
$targetArVe
"
fi
if
$TRYRUN
;
then
echo
"
$path
->
$DATABUSMVNDIR
/
$targetArVe
/
$targetFile
"
else
cp
-vn
"
$path
"
"
$DATABUSMVNDIR
/
$targetArVe
/
$targetFile
"
fi
else
>
&2
echo
"unmapped/notexist artifact:
$artifact
"
fi
fi
done
}
#__Main__
main
()
{
printStart
copyToMavenPlugin
#TODO add release
}
main
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