-
Notifications
You must be signed in to change notification settings - Fork 67k
Expand file tree
/
Copy pathfetch-repos.sh
More file actions
52 lines (42 loc) · 1.65 KB
/
fetch-repos.sh
File metadata and controls
52 lines (42 loc) · 1.65 KB
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
#!/usr/bin/env sh
#
# This script is intended to be called from the production Dockerfile
# Though it isn't working with all of the files from docs-internal (it only COPYs what is needed),
# it is useful to think of these scripts running from the root of the docs-internal repo.
#
# Fetches and resolves docs-internal, early-access, and translations repos
echo "Fetching and resolving early-access, and translations repos"
# Exit immediately if a command exits with a non-zero status
set -e
# Import the clone_or_use_cached_repo function
. ./build-scripts/clone-or-use-cached-repo.sh
# Set the GITHUB_TOKEN environment variable from the mounted --secret passed to Docker build
GITHUB_TOKEN=$(cat /run/secrets/DOCS_BOT_PAT_READPUBLICKEY)
# - - - - - - - - - -
# Early access
# - - - - - - - - - -
echo "Fetching early access..."
clone_or_use_cached_repo "docs-early-access" "docs-early-access" "main"
echo "Merging early access..."
. ./build-scripts/merge-early-access.sh
# - - - - - - - - - -
# Clone the translations repos
# - - - - - - - - - -
# Make sure to clone each translation repo into the `translations` directory inside the root of docs-internal (the Dockerfile's WORKDIR)
mkdir -p translations
cd translations
# Iterate over each language
echo "Fetching translations..."
for lang in "es-es" "ja-jp" "pt-br" "zh-cn" "ru-ru" "fr-fr" "ko-kr" "de-de"
do
translations_repo="docs-internal.$lang"
clone_or_use_cached_repo "$lang" "$translations_repo" "main"
done
echo "Done fetching translations."
# Go back to the root of the docs-internal repo
cd ..
# - - - - - - - - - -
# Cleanup
# - - - - - - - - - -
# Delete GITHUB_TOKEN from the environment
unset GITHUB_TOKEN