-
Notifications
You must be signed in to change notification settings - Fork 42
/
generate_env.sh
executable file
·68 lines (59 loc) · 1.75 KB
/
generate_env.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
#!/usr/bin/env bash
#
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2016-Present Datadog, Inc.
#
########
# This script is being moved to `melos.yaml`. Use `melos generate_env` instead.
########
set echo off
dotEnvFiles=(
"packages/datadog_flutter_plugin/example/.env"
"packages/datadog_flutter_plugin/integration_test_app/.env"
"packages/datadog_tracking_http_client/example/.env"
"packages/datadog_webview_tracking/example/.env"
"test_apps/stress_test/.env"
)
for f in ${dotEnvFiles[@]}; do
echo "Generating $f"
tee $f > /dev/null << END
# Edit this file with your Datadog client token, environment and application id
DD_CLIENT_TOKEN=$DD_CLIENT_TOKEN
DD_APPLICATION_ID=$DD_APPLICATION_ID
DD_ENV=prod
END
done
e2eDotEnvFiles=(
"packages/datadog_flutter_plugin/e2e_test_app/.env"
)
for f in ${e2eDotEnvFiles[@]}; do
tee $f > /dev/null << END
DD_CLIENT_TOKEN=$DD_E2E_CLIENT_TOKEN
DD_APPLICATION_ID=$DD_E2E_APPLICATION_ID
DD_E2E_IS_ON_CI=${IS_ON_CI:-false}
END
done
pushd examples/native-hybrid-app/android/app/src/main/res/
mkdir raw
tee ./raw/dd_config.json > /dev/null << END
{
"client_token": "$DD_CLIENT_TOKEN",
"application_id": "$DD_APPLICATION_ID"
}
END
popd
pushd examples/native-hybrid-app/ios/iOS\ Flutter\ Hybrid\ Example
tee ./ddog_config.plist > /dev/null << END
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>client_token</key>
<string>$DD_CLIENT_TOKEN</string>
<key>application_id</key>
<string>$DD_APPLICATION_ID</string>
</dict>
</plist>
END
popd