Repository navigation
Expand file tree
/
Copy pathgenerate_env.sh
More file actions
executable file
·66 lines (58 loc) · 2.02 KB
/
Copy pathgenerate_env.sh
File metadata and controls
executable file
·66 lines (58 loc) · 2.02 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/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.
#
########
# dd.env generation for package examples has moved to `melos.yaml` (`melos generate_env`).
# This script now only generates config for examples/native-hybrid-app and examples/simple_example
########
set -e
cd "$(dirname "$0")"
tee examples/simple_example/dd.env > /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
flagsTargetingAttributesJson=${FLAGS_TARGETING_ATTRIBUTES_JSON:-'{"attr1":"value1","companyId":"1"}'}
flagDotEnvFiles=(
"examples/simple_example/dd.env"
)
for f in "${flagDotEnvFiles[@]}"; do
tee -a "$f" > /dev/null << END
# Optional Datadog Flags example settings.
DD_SITE=${DD_SITE:-us1}
FLAGS_TARGETING_KEY=${FLAGS_TARGETING_KEY:-test_subject4}
FLAGS_TARGETING_ATTRIBUTES_JSON=$flagsTargetingAttributesJson
FLAGS_BOOLEAN_KEYS=${FLAGS_BOOLEAN_KEYS:-checkout.enabled}
FLAGS_STRING_KEYS=${FLAGS_STRING_KEYS:-checkout.copy}
FLAGS_INTEGER_KEYS=${FLAGS_INTEGER_KEYS:-checkout.limit}
FLAGS_DOUBLE_KEYS=${FLAGS_DOUBLE_KEYS:-checkout.ratio}
FLAGS_OBJECT_KEYS=${FLAGS_OBJECT_KEYS:-checkout.config}
END
done
pushd examples/native-hybrid-app/android/app/src/main/res/
mkdir -p 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/HybridSessionReplayExample
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