forked from wmde/wikibase-release-pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_cache.sh
88 lines (74 loc) · 2.43 KB
/
update_cache.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
set -e
function clone_if_not_present {
REPOSITORY_CACHE_NAME=$1
GIT_URL=$2
if [ ! -d "git_cache/$1" ]; then
git config --global --add safe.directory "$PWD/git_cache/$REPOSITORY_CACHE_NAME"
git clone --mirror "$GIT_URL" "git_cache/$REPOSITORY_CACHE_NAME" -q
fi
}
function fetch_all {
REPOSITORY_CACHE_NAME=$1
git config --global --add safe.directory "$PWD/git_cache/$REPOSITORY_CACHE_NAME"
cd "git_cache/$REPOSITORY_CACHE_NAME"
git fetch --all -q
cd - > /dev/null
}
mkdir -p 'artifacts'
mkdir -p 'git_cache/skins/'
mkdir -p 'git_cache/services/'
cd "$(dirname "$0")"
skins=("Vector")
extensions=( \
"Babel" \
"CirrusSearch" \
"cldr" \
"ConfirmEdit" \
"Elastica" \
"EntitySchema"
"Nuke" \
"OAuth" \
"Scribunto" \
"SyntaxHighlight_GeSHi" \
"VisualEditor" \
"UniversalLanguageSelector"
"Wikibase" \
"WikibaseCirrusSearch" \
"WikibaseManifest" \
)
for arg in "$@"; do
if [ "$arg" = "skins" ]; then
for skin in "${skins[@]}"; do
clone_if_not_present "skins/$skin.git" "https://gerrit.wikimedia.org/r/mediawiki/skins/$skin"
fetch_all "skins/$skin.git"
done
elif [ "$arg" = "base" ]; then
clone_if_not_present "Wikibase.git" "https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase"
fetch_all "Wikibase.git"
elif [ "$arg" = "bundle" ]; then
# WikibaseLocalMedia
clone_if_not_present WikibaseLocalMedia.git https://github.com/ProfessionalWiki/WikibaseLocalMedia.git
fetch_all WikibaseLocalMedia.git
# WikibaseEdtf
clone_if_not_present WikibaseEdtf.git https://github.com/ProfessionalWiki/WikibaseEdtf.git
fetch_all WikibaseEdtf.git
for extension in "${extensions[@]}"; do
clone_if_not_present "$extension.git" "https://gerrit.wikimedia.org/r/mediawiki/extensions/$extension"
fetch_all "$extension.git"
done
elif [ "$arg" = "services" ]; then
# wdqs-frontend
clone_if_not_present "services/wikidata-query-gui.git" "https://gerrit.wikimedia.org/r/wikidata/query/gui"
fetch_all "services/wikidata-query-gui.git"
# quickstatements
clone_if_not_present "services/quickstatements.git" https://github.com/magnusmanske/quickstatements
fetch_all "services/quickstatements.git"
# magnus tools
clone_if_not_present "services/magnustools.git" https://bitbucket.org/magnusmanske/magnustools.git
fetch_all "services/magnustools.git"
elif [ "$arg" = "core" ]; then
clone_if_not_present core.git "https://gerrit.wikimedia.org/r/mediawiki/core"
fetch_all "core.git"
fi
done