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

Added Requisition Hook Guidance #60

Merged
merged 3 commits into from
Dec 27, 2023

Conversation

CanYumusak
Copy link
Contributor

Background

When setting up a full requsition hook, I struggled (longer than I would like to admit) to make the hook run in the docker container. The reason for my struggle was missing tools in the docker container such as bash, cuRL and so on. I decided to fix the shebang and write up a guide to make this easier for people after me.

Example Hook for LogSnag

#!/bin/sh
reqURL=$2

wget --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <my logsnag token>' \
     --post-data "{\"project\":\"<my project>\",\"channel\":\"<my channel>\",\"event\":\"Confirm requisition URL\",\"description\":\"${reqURL}\",\"icon\":\"❤️\",\"notify\":true}" \
     'https://api.logsnag.com/v1/log'#

martinohansen
martinohansen previously approved these changes Dec 27, 2023
Copy link
Owner

@martinohansen martinohansen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@martinohansen
Copy link
Owner

@CanYumusak do you want to add the example LogSnag hook as a file before I merge this?

@CanYumusak
Copy link
Contributor Author

@CanYumusak do you want to add the example LogSnag hook as a file before I merge this?

Sure, give me a sec

@CanYumusak
Copy link
Contributor Author

@CanYumusak do you want to add the example LogSnag hook as a file before I merge this?

Done! ☑️

@martinohansen martinohansen merged commit 72a1bc8 into martinohansen:main Dec 27, 2023
1 check failed
@hpernu
Copy link
Collaborator

hpernu commented Dec 28, 2023

Background

When setting up a full requsition hook, I struggled (longer than I would like to admit) to make the hook run in the docker container. The reason for my struggle was missing tools in the docker container such as bash, cuRL and so on. I decided to fix the shebang and write up a guide to make this easier for people after me.

My point exactly why this might not work so well in docker. You got it to work for example purposes but for somebody who wants to do something else, they might face similar issues. Of course, you can do your own Docker image based on current one which is what I often end up doing.

Not to mention the permission issues related to files, if the script creates any. I actually earlier made a PR to update the README so that there would be options of running ynabber as a regular user in the example, but @martinohansen declined that. This easily becomes even more complicated and I've worked with docker a lot (in fact, daily).

Good that the option is there, though.

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

Successfully merging this pull request may close these issues.

3 participants