forked from admin-ch/CovidCertificate-App-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loadConfigs.sh
executable file
·27 lines (22 loc) · 961 Bytes
/
loadConfigs.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
#!/bin/bash
apps=("wallet" "verifier")
environments=("prod" "abn" "dev")
timestamp=$(date +%s%N | cut -b1-13)
for app in ${apps[@]}; do
for environment in ${environments[@]}; do
if [[ $environment = "prod" ]]; then
subdomain="cc-a" # Take the prod config from the ABN environment
output="${app}/src/main/assets/faq/config.json"
elif [ $environment = "abn" ]; then
subdomain="cc-a"
output="${app}/src/${environment}/assets/faq/config.json"
elif [ $environment = "dev" ]; then
subdomain="cc-d"
output="${app}/src/${environment}/assets/faq/config.json"
fi
versionName=$(cat "${app}/build.gradle" | sed -n -e 's/^.*versionName\s*"\(.*\)"$/\1/p')
url="https://www.${subdomain}.bit.admin.ch/app/${app}/v1/config?osversion=android&appversion=android-${versionName}&buildnr=${timestamp}"
echo "Loading fallback ${environment} config for ${app} from ${url}"
curl $url | jq > $output
done
done