forked from trailheadapps/coral-cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·87 lines (75 loc) · 1.92 KB
/
install.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
#!/bin/bash
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd $SCRIPT_PATH/..
echo ""
echo "Installing Coral Cloud"
echo ""
# Get default org alias
VALUE_REGEX='"value": "([a-zA-Z0-9_\-]+)"'
ORG_INFO=$(sf config get target-org --json)
if [[ $ORG_INFO =~ $VALUE_REGEX ]]
then
ORG_ALIAS="${BASH_REMATCH[1]}"
echo "Using current default org: $ORG_ALIAS"
echo ""
else
echo "Installation failed: could not retrieve default org alias."
exit 1
fi
# Open DC Setup home
sf org open -p lightning/setup/SetupOneHome/home?setupApp=audience360
echo ""
# Wait for DC activation
echo "STOP: wait for Data Cloud deployment completion before moving forward."
echo "You can check progress in Data Cloud Setup."
read -p "Is Data Cloud is fully enabled? [yY]: " -n 1 -r
echo ""
echo ""
# Abort if not ready
if [[ $REPLY =~ ^[^Yy]$ ]]
then
echo "Installation aborted."
exit 1
fi
# Confirm feature activation
echo "STOP: ensure that you've toggled on the following features:"
echo " * Einstein"
echo " * Agents"
echo " * Einstein for Sales - Sales Emails"
read -p "Are the above features enabled? [yY]: " -n 1 -r
echo ""
echo ""
# Abort if not ready
if [[ $REPLY =~ ^[^Yy]$ ]]
then
echo "Installation aborted."
exit 1
fi
echo "Pushing source..." && \
sf project deploy start && \
echo "" && \
echo "Assigning permission sets..." && \
sf org assign permset -n Coral_Cloud && \
echo "" && \
echo "Importing sample data..." && \
sf data tree import -p data/data-plan.json && \
echo "" && \
echo "Generate additional sample data..." && \
sf apex run -f apex-scripts/setup.apex && \
echo "" && \
echo "Installing Data Kit..." && \
sf package install -p 04tHr000000ku0X -w 10 && \
echo "" && \
echo "Opening org..." && \
sf org open -p lightning/page/home && \
echo ""
EXIT_CODE="$?"
# Check exit code
echo ""
if [ "$EXIT_CODE" -eq 0 ]; then
echo "Installation completed."
echo ""
else
echo "Installation failed."
fi
exit $EXIT_CODE