Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sample post-hook to upload-to-horreum needs to be fixed #7

Open
rafaeltuelho opened this issue Mar 24, 2023 · 0 comments
Open

sample post-hook to upload-to-horreum needs to be fixed #7

rafaeltuelho opened this issue Mar 24, 2023 · 0 comments

Comments

@rafaeltuelho
Copy link

I noticed the Operator generates a ConfigMap containing a sample post-hook that can be used to upload reports to Horreum using its API.

TOKEN=$(curl -s -X POST ` + keycloakURL + `/auth/realms/horreum/protocol/openid-connect/token ` +
` -H 'content-type: application/x-www-form-urlencoded' ` +
` -d 'username='$HORREUM_USER'&password='$HORREUM_PASSWORD'&grant_type=password&client_id=horreum-ui'` +
` | jq -r .access_token)
curl -s '` + horreumURL + `/api/run/data?owner='$HORREUM_GROUP'&access=PUBLIC&test=$.info.benchmark&start=$.info.startTime&stop=$.info.terminateTime'` +
` -X POST -H 'content-type: application/json' -d @$RUN_DIR/all.json -H 'Authorization: Bearer '$TOKEN

This sample post-hook needs some tweaks in order to work properly like the curl command used to retrieve a OIDC Token from keycloak needs to include the -k option in case of self-signed certs...
The other thing is to fix the OIDC token api URL from

/auth/realms/horreum/protocol/openid-connect/token

to

/realms/horreum/protocol/openid-connect/token

and also include the $RUN_ID to the json file path

-d @$RUN_DIR/$RUN_DIR/all.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant