-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: adding microsoft teams extension #36
Conversation
This is great @igorbrites, maybe you can add a little image to pull request to see how it looks when you have it ready |
9f20ad6
to
b13d4a7
Compare
I'm facing this error, though idk what it means. Can you help me with it?
Here's the full log
|
I am not sure but maybe you can change this part // "Teams Message Completed..." to "Teams Message Completed..." If I remember correctly groovy extension must return a "string" like that at the end |
I had tried that before and it didn't work either:
|
e75fda0
to
eecbcaa
Compare
Hello @igorbrites Quick comment to read an environment variable inside your script you can use the following example new SlackApp().sendMessageWithoutAttachment(
"#general",
"Hello Terrakube!",
"$SLACK_TOKEN",
terrakubeOutput); And $SLACK_TOKEN is an environment variable define at workspace level instead of reading it like this:
So in your case you could use it like this:
|
d9e37a6
to
81eefaf
Compare
That was exactly the issue I was facing, when I tried to get the environment variable it was Now I'm getting 400s from Teams, trying to understand why—but progressing nonetheless! |
f8298a4
to
a8105b8
Compare
Working! Using the following template: flow:
- type: "customScripts"
step: 100
commands:
- runtime: "GROOVY"
priority: 100
after: true
script: |
import MicrosoftTeams
import MessageCard
MessageCard message = new MessageCard('0078D7', 'Hello from Terrakube!', 'Hello Terrakube!')
message
.setActivity('My activity title', 'Activity subtitle')
.setButtons([
'Go to Terrakube site!': 'https://www.terrakube.org',
'Terrakube docs': 'https://docs.terrakube.org'
])
.setFacts([
'Fact 1': 'Value 1',
'Fact 2': 'Value 2'
])
new MicrosoftTeams("$MSTEAMS_WEBHOOK_URL").sendMessage(message);
"Teams Message Completed..." The message is shown like this: I'll add the image to the README.md and open the PR for your review. |
This is great @igorbrites, nice job!!! quick question where do you get the web hook url? I would like to test it? |
Thanks! To create a webhook:
|
@alfespa17 I've opened the PR for your review, so take a look whenever you can 😄 |
I will check it today 👍 once I finish a few things from work |
Thank you for your contribution @igorbrites |
By the way if you would like to add something about ms teams integration using this extension to https://docs.terrakube.io I could create the page. |
Absolutely! Will create a PR there and send it your way. |
This PR adds an extension to send messages from Terrakube to Microsoft teams using the Incoming Webhook connector.