fourkeys icon indicating copy to clipboard operation
fourkeys copied to clipboard

Fix export WEBHOOK in SETUP

Open michalpirgl opened this issue 1 year ago • 4 comments

Hi

this is output of $ gcloud run services list --project $PROJECT_ID in my Cloud Shell web console:

✔
SERVICE: event-handler
REGION: europe-central2
URL: https://event-handler-7fv...app
LAST DEPLOYED BY: email@
LAST DEPLOYED AT: 2023-02-20T11:40:48.915826Z

✔
SERVICE: fourkeys-github-parser
REGION: europe-central2
URL: https://fourkeys-github-parser-7fv...app
LAST DEPLOYED BY: email@
LAST DEPLOYED AT: 2023-02-20T11:41:24.943423Z

✔
SERVICE: fourkeys-gitlab-parser
REGION: europe-central2
URL: https://fourkeys-gitlab-parser-7fv...app
LAST DEPLOYED BY: email@
LAST DEPLOYED AT: 2023-02-20T12:13:31.312376Z

✔
SERVICE: fourkeys-grafana-dashboard
REGION: europe-central2
URL: https://fourkeys-grafana-dashboard-7fv...app
LAST DEPLOYED BY: email@
LAST DEPLOYED AT: 2023-02-20T12:25:24.890167Z

Command gcloud run services list --project $PROJECT_ID | grep event-handler | awk '{print $4}' returns empty string.

I use following command to get WEBHOOK URL in my Cloud Shell:

export WEBHOOK=`gcloud run services list --project $PROJECT_ID | grep event-handler- | awk '{print $2}'`

(there is an extra dash and different awk variable)

michalpirgl avatar Mar 02 '23 11:03 michalpirgl

I can confirm that the command in the docs returned an empty string for me as well and the proposed change fixes that.

colinfrei avatar Mar 09 '23 06:03 colinfrei

I also confirmed that Cloud Shell returns an empty string. However, it works fine from my local MacOS. This PR change may cause some confusion. Both environments use Google Cloud SDK 426.0.0

fchimpan avatar Apr 24 '23 07:04 fchimpan

Hi @fchimpan Would you have an alternative which works for you on MacOS & also Cloud shell and is less confusing? I am on Fedora Linux Thanks, Michal

michalpirgl avatar Apr 24 '23 07:04 michalpirgl

Hi @michalpirgl Since it is a matter of where the URL appears, how about modifying it as follows.

gcloud run services list --project $PROJECT_ID | grep event-handler | grep -o 'https://\S*'

I have confirmed the correct behavior.

fchimpan avatar Apr 24 '23 09:04 fchimpan