From 84d175dde1c01ca4705c1e9866f1d67aef830497 Mon Sep 17 00:00:00 2001 From: Nikhil Nandagopal Date: Mon, 7 Sep 2020 16:36:14 +0530 Subject: [PATCH] Added anonymous tracking for installation --- deploy/install.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/deploy/install.sh b/deploy/install.sh index 711fcffd93..1a92f39df0 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -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 ""