Added anonymous tracking for installation

This commit is contained in:
Nikhil Nandagopal 2020-09-07 16:36:14 +05:30 committed by GitHub
parent f5f66229ec
commit 84d175dde1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,14 @@ is_command_present() {
is_mac() {
[[ $OSTYPE == darwin* ]]
}
curl --location --request POST 'https://api.segment.io/v1/track' \
--header 'Authorization: Basic QjJaM3hXRThXdDRwYnZOWDRORnJPNWZ3VXdnYWtFbk06' \
--header 'Content-Type: application/json' \
--data-raw '{
"anonymousId": "anonymousId",
"event": "Installation Started",
"osType": $OSTYPE
}'
# This function checks if the relevant ports required by Appsmith are available or not
# The script should error out in case they aren't available
check_ports_occupied() {
@ -520,6 +527,14 @@ wait_for_containers_start 60
echo ""
if [[ $status_code -ne 401 ]]; then
curl --location --request POST 'https://api.segment.io/v1/track' \
--header 'Authorization: Basic QjJaM3hXRThXdDRwYnZOWDRORnJPNWZ3VXdnYWtFbk06' \
--header 'Content-Type: application/json' \
--data-raw '{
"anonymousId": "anonymousId",
"event": "Installation Failed",
"osType": $OSTYPE
}'
echo "+++++++++++ ERROR ++++++++++++++++++++++"
echo "The containers didn't seem to start correctly. Please run the following command to check containers that may have errored out:"
echo ""
@ -528,6 +543,14 @@ if [[ $status_code -ne 401 ]]; then
echo "++++++++++++++++++++++++++++++++++++++++"
echo ""
else
curl --location --request POST 'https://api.segment.io/v1/track' \
--header 'Authorization: Basic QjJaM3hXRThXdDRwYnZOWDRORnJPNWZ3VXdnYWtFbk06' \
--header 'Content-Type: application/json' \
--data-raw '{
"anonymousId": "anonymousId",
"event": "Installation Success",
"osType": $OSTYPE
}'
echo "+++++++++++ SUCCESS ++++++++++++++++++++++++++++++"
echo "Your installation is complete!"
echo ""