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

fix: release notes slack tweaks #1161

Merged
merged 2 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions flank-actions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ RUN chmod +x /compile.sh

RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && /compile.sh"

COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

RUN chmod +x /sendMessage
Expand Down
6 changes: 4 additions & 2 deletions flank-actions/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

echo 'Sending message'
./sendMessage $INPUT_XOXCTOKEN $INPUT_MESSAGE $INPUT_CHANNEL $INPUT_COOKIE
echo 'Attempting to sendMessage'
cd /
./sendMessage "$INPUT_XOXCTOKEN" "$INPUT_CHANNEL" "$INPUT_MESSAGE" "$INPUT_COOKIE"

echo 'Sending message done!'
12 changes: 1 addition & 11 deletions flank-actions/slackService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,17 @@ fun sendMessage(args: Array<String>): Int{
val token = args[Common.ARGS_TOKEN]
val channel = args[Common.ARGS_CHANNEL]
val message = args[Common.ARGS_MESSAGE]
val cookie = args.copyOfRange(Common.ARGS_COOKIE, args.lastIndex).joinToString(" ")
val cookie = args[Common.ARGS_COOKIE]

return try {
val (req, rep, res) = Fuel.get(Common.URL_SLACK,
listOf("token" to token,"channel" to channel,"text" to message))
.header(Headers.COOKIE to cookie)
.responseString()

debug("Result: $res")
Common.EXIT_CODE_SUCCESS
}
catch(e: Exception) {
error("Error has occured: $e")
Common.EXIT_CODE_FAILURE
}
}

fun debug(message: String){
println("::debug::$message")
}

fun error(message: String) {
println("::error::$message")
}