-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1697 from fsharp/cleanup
[Fix] We need to start some processes with mono on non-windows platforms.
- Loading branch information
Showing
82 changed files
with
3,365 additions
and
2,005 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Sending Notifications to a Slack Webhook | ||
|
||
In this article you will learn how to create a [Slack](https://slack.com) webhook integration and send a notification to it. This article assumes that you already have a Slack team setup. | ||
|
||
**Note: This documentation is for FAKE 5. The old documentation can be found [here](legacy-slacknotification.html)! ** | ||
|
||
[API-Reference](apidocs/fake-api-slack.html) | ||
|
||
## Adding a Webhook Integration to a Channel | ||
|
||
Follow the [instructions](https://my.slack.com/services/new/incoming-webhook/) for setting up an incoming webhook integration. When finished, you should have a Webhook URL that looks like "https://hooks.slack.com/services/some/random/text". | ||
|
||
## Sending a Notification to the Webhook | ||
|
||
open Fake.Api | ||
|
||
// The webhook URL from the integration you set up | ||
let webhookUrl = "https://hooks.slack.com/services/some/random/text" | ||
|
||
Slack.SendNotification webhookUrl (fun p -> | ||
{p with | ||
Text = "My Slack Notification!\n<https://google.com|Click Here>!" | ||
Channel = "@SomeoneImportant" | ||
IconEmoji = ":ghost:" | ||
Attachments = [| | ||
{Slack.NotificationAttachmentDefaults with | ||
Fallback = "Attachment Plain" | ||
Text = "Attachment Rich" | ||
Pretext = "Attachment Pretext" | ||
Color = "danger" | ||
Fields = [| | ||
{Slack.NotificationAttachmentFieldDefaults with | ||
Title = "Field Title 1" | ||
Value = "Field Value 2"} | ||
{Slack.NotificationAttachmentFieldDefaults with | ||
Title = "Field Title 1" | ||
Value = "Field Value 2"}|] | ||
} | ||
{Slack.NotificationAttachmentDefaults with | ||
Fallback = "Attachment 2 Plain" | ||
Text = "Attachment 2 Rich" | ||
Pretext = "Attachment 2 Pretext" | ||
Color = "#FFCCDD" | ||
}|] | ||
}) | ||
|> printfn "Result: %s" | ||
|
||
The result should look something like this: | ||
|
||
![alt text](pics/slacknotification/slacknotification.png "Slack Notification Result") | ||
|
||
For additional information on the parameters, check out Slack's [Webhook Documentation](https://api.slack.com/incoming-webhooks) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Starting processes in "FAKE - F# Make" | ||
|
||
**Note: This documentation is for FAKE 5! ** | ||
|
||
[API-Reference](apidocs/fake-core-process.html) | ||
|
||
## Running a command and analyse results | ||
|
||
```fsharp | ||
let fakeToolPath = "known/path/to/fake.exe" | ||
let directFakeInPath command workingDir target = | ||
let result = | ||
Process.ExecProcessAndReturnMessages (fun (info:Process.ProcStartInfo) -> | ||
{ info with | ||
FileName = fakeToolPath | ||
WorkingDirectory = workingDir | ||
Arguments = command } | ||
|> Process.setEnvironmentVariable "target" target) (System.TimeSpan.FromMinutes 15.) | ||
if result.ExitCode <> 0 then | ||
let errors = String.Join(Environment.NewLine,result.Errors) | ||
printfn "%s" <| String.Join(Environment.NewLine,result.Messages) | ||
failwithf "FAKE Process exited with %d: %s" result.ExitCode errors | ||
String.Join(Environment.NewLine,result.Messages) | ||
let output = directFakeInPath "--version" "." "All" | ||
``` | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.