diff --git a/Source/Cake.Recipe/Content/addins.cake b/Source/Cake.Recipe/Content/addins.cake index ac619808..9ffc33a9 100644 --- a/Source/Cake.Recipe/Content/addins.cake +++ b/Source/Cake.Recipe/Content/addins.cake @@ -7,7 +7,6 @@ #addin nuget:?package=Cake.Coverlet&version=2.5.4 #addin nuget:?package=Portable.BouncyCastle&version=1.8.5 #addin nuget:?package=Cake.Email&version=2.0.0&loaddependencies=true -#addin nuget:?package=Cake.Gitter&version=2.0.0 #addin nuget:?package=Cake.Incubator&version=7.0.0 #addin nuget:?package=Cake.Kudu&version=2.0.0 #addin nuget:?package=Cake.MicrosoftTeams&version=2.0.0 diff --git a/Source/Cake.Recipe/Content/build.cake b/Source/Cake.Recipe/Content/build.cake index 7e07fd3c..f4130f78 100644 --- a/Source/Cake.Recipe/Content/build.cake +++ b/Source/Cake.Recipe/Content/build.cake @@ -40,11 +40,6 @@ Teardown((context, buildVersion) => SendMessageToTwitter(string.Format(BuildParameters.TwitterMessage, messageArguments)); } - if (BuildParameters.CanPostToGitter && BuildParameters.ShouldPostToGitter) - { - SendMessageToGitterRoom(string.Format(BuildParameters.GitterMessage, messageArguments)); - } - if (BuildParameters.CanPostToMicrosoftTeams && BuildParameters.ShouldPostToMicrosoftTeams) { SendMessageToMicrosoftTeams(string.Format(BuildParameters.MicrosoftTeamsMessage, messageArguments)); diff --git a/Source/Cake.Recipe/Content/credentials.cake b/Source/Cake.Recipe/Content/credentials.cake index da6542e1..d81faec4 100644 --- a/Source/Cake.Recipe/Content/credentials.cake +++ b/Source/Cake.Recipe/Content/credentials.cake @@ -36,18 +36,6 @@ public class EmailCredentials } } -public class GitterCredentials -{ - public string Token { get; private set; } - public string RoomId { get; private set; } - - public GitterCredentials(string token, string roomId) - { - Token = token; - RoomId = roomId; - } -} - public class SlackCredentials { public string Token { get; private set; } @@ -175,13 +163,6 @@ public static MicrosoftTeamsCredentials GetMicrosoftTeamsCredentials(ICakeContex context.EnvironmentVariable(Environment.MicrosoftTeamsWebHookUrlVariable)); } -public static GitterCredentials GetGitterCredentials(ICakeContext context) -{ - return new GitterCredentials( - context.EnvironmentVariable(Environment.GitterTokenVariable), - context.EnvironmentVariable(Environment.GitterRoomIdVariable)); -} - public static SlackCredentials GetSlackCredentials(ICakeContext context) { return new SlackCredentials( diff --git a/Source/Cake.Recipe/Content/environment.cake b/Source/Cake.Recipe/Content/environment.cake index 1dc05825..e6d40d41 100644 --- a/Source/Cake.Recipe/Content/environment.cake +++ b/Source/Cake.Recipe/Content/environment.cake @@ -1,8 +1,6 @@ public static class Environment { public static string GithubTokenVariable { get; private set; } - public static string GitterTokenVariable { get; private set; } - public static string GitterRoomIdVariable { get; private set; } public static string SlackTokenVariable { get; private set; } public static string SlackChannelVariable { get; private set; } public static string TwitterConsumerKeyVariable { get; private set; } @@ -25,8 +23,6 @@ public static class Environment public static void SetVariableNames( string githubTokenVariable = null, - string gitterTokenVariable = null, - string gitterRoomIdVariable = null, string slackTokenVariable = null, string slackChannelVariable = null, string twitterConsumerKeyVariable = null, @@ -48,8 +44,6 @@ public static class Environment string wyamDeployBranchVariable = null) { GithubTokenVariable = githubTokenVariable ?? "GITHUB_PAT"; - GitterTokenVariable = gitterTokenVariable ?? "GITTER_TOKEN"; - GitterRoomIdVariable = gitterRoomIdVariable ?? "GITTER_ROOM_ID"; SlackTokenVariable = slackTokenVariable ?? "SLACK_TOKEN"; SlackChannelVariable = slackChannelVariable ?? "SLACK_CHANNEL"; TwitterConsumerKeyVariable = twitterConsumerKeyVariable ?? "TWITTER_CONSUMER_KEY"; diff --git a/Source/Cake.Recipe/Content/gitter.cake b/Source/Cake.Recipe/Content/gitter.cake deleted file mode 100644 index 95e1b9a2..00000000 --- a/Source/Cake.Recipe/Content/gitter.cake +++ /dev/null @@ -1,29 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// HELPER METHODS -/////////////////////////////////////////////////////////////////////////////// - -public void SendMessageToGitterRoom(string message) -{ - try - { - Information("Sending message to Gitter..."); - - var postMessageResult = Gitter.Chat.PostMessage( - message: message, - messageSettings: new GitterChatMessageSettings { Token = BuildParameters.Gitter.Token, RoomId = BuildParameters.Gitter.RoomId} - ); - - if (postMessageResult.Ok) - { - Information("Message {0} successfully sent", postMessageResult.TimeStamp); - } - else - { - Error("Failed to send message: {0}", postMessageResult.Error); - } - } - catch(Exception ex) - { - Error("{0}", ex); - } -} diff --git a/Source/Cake.Recipe/Content/parameters.cake b/Source/Cake.Recipe/Content/parameters.cake index f1cfc9d0..75d42f46 100644 --- a/Source/Cake.Recipe/Content/parameters.cake +++ b/Source/Cake.Recipe/Content/parameters.cake @@ -9,7 +9,6 @@ public enum BranchType public static class BuildParameters { - private static string _gitterMessage; private static string _microsoftTeamsMessage; private static string _twitterMessage; private static bool _shouldUseDeterministicBuilds; @@ -60,12 +59,6 @@ public static class BuildParameters get { return "Version {0} of the {1} Addin has just been released, this will be available here https://www.nuget.org/packages/{1}, once package indexing is complete."; } } - public static string GitterMessage - { - get { return _gitterMessage ?? "@/all " + StandardMessage; } - set { _gitterMessage = value; } - } - public static string MicrosoftTeamsMessage { get { return _microsoftTeamsMessage ?? StandardMessage; } @@ -81,7 +74,6 @@ public static class BuildParameters public static GitHubCredentials GitHub { get; private set; } public static MicrosoftTeamsCredentials MicrosoftTeams { get; private set; } public static EmailCredentials Email { get; private set; } - public static GitterCredentials Gitter { get; private set; } public static SlackCredentials Slack { get; private set; } public static TwitterCredentials Twitter { get; private set; } public static AppVeyorCredentials AppVeyor { get; private set; } @@ -108,7 +100,6 @@ public static class BuildParameters public static int TransifexPullPercentage { get; private set; } public static bool ShouldBuildNugetSourcePackage { get; private set; } - public static bool ShouldPostToGitter { get; private set; } public static bool ShouldPostToSlack { get; private set; } public static bool ShouldPostToTwitter { get; private set; } public static bool ShouldPostToMicrosoftTeams { get; private set; } @@ -180,15 +171,6 @@ public static class BuildParameters } } - public static bool CanPostToGitter - { - get - { - return !string.IsNullOrEmpty(BuildParameters.Gitter.Token) && - !string.IsNullOrEmpty(BuildParameters.Gitter.RoomId); - } - } - public static bool CanPostToSlack { get @@ -287,7 +269,6 @@ public static class BuildParameters context.Information("BranchType: {0}", BranchType); context.Information("TreatWarningsAsErrors: {0}", TreatWarningsAsErrors); context.Information("ShouldSendEmail: {0}", ShouldSendEmail); - context.Information("ShouldPostToGitter: {0}", ShouldPostToGitter); context.Information("ShouldPostToSlack: {0}", ShouldPostToSlack); context.Information("ShouldPostToTwitter: {0}", ShouldPostToTwitter); context.Information("ShouldPostToMicrosoftTeams: {0}", ShouldPostToMicrosoftTeams); @@ -353,7 +334,6 @@ public static class BuildParameters string repositoryName = null, string appVeyorAccountName = null, string appVeyorProjectSlug = null, - bool shouldPostToGitter = true, bool shouldPostToSlack = true, bool shouldPostToTwitter = true, bool shouldPostToMicrosoftTeams = false, @@ -380,7 +360,6 @@ public static class BuildParameters bool? transifexEnabled = null, TransifexMode transifexPullMode = TransifexMode.OnlyTranslated, int transifexPullPercentage = 60, - string gitterMessage = null, string microsoftTeamsMessage = null, string twitterMessage = null, DirectoryPath wyamRootDirectoryPath = null, @@ -445,7 +424,6 @@ public static class BuildParameters TransifexPullMode = transifexPullMode; TransifexPullPercentage = transifexPullPercentage; - GitterMessage = gitterMessage; MicrosoftTeamsMessage = microsoftTeamsMessage; TwitterMessage = twitterMessage; @@ -459,7 +437,6 @@ public static class BuildParameters WebLinkRoot = webLinkRoot ?? RepositoryName; WebBaseEditUrl = webBaseEditUrl ?? string.Format("https://github.com/{0}/{1}/tree/{2}/docs/input/", repositoryOwner, RepositoryName, developBranchName); - ShouldPostToGitter = shouldPostToGitter; ShouldPostToSlack = shouldPostToSlack; ShouldPostToTwitter = shouldPostToTwitter; ShouldPostToMicrosoftTeams = shouldPostToMicrosoftTeams; @@ -606,7 +583,6 @@ public static class BuildParameters GitHub = GetGitHubCredentials(context); MicrosoftTeams = GetMicrosoftTeamsCredentials(context); Email = GetEmailCredentials(context); - Gitter = GetGitterCredentials(context); Slack = GetSlackCredentials(context); Twitter = GetTwitterCredentials(context); AppVeyor = GetAppVeyorCredentials(context); diff --git a/docs/input/assets/css/override.less b/docs/input/assets/css/override.less index 8e9602d1..f7d73034 100644 --- a/docs/input/assets/css/override.less +++ b/docs/input/assets/css/override.less @@ -97,9 +97,9 @@ pre:hover .btn-copy { @font-family-sans-serif: "Roboto", Helvetica, Arial, sans-serif; -/* For Gitter and GitHub */ +/* For GitHub */ .bottom-footer { - margin-bottom: 40px !important; // Make room for Gitter and GitHub buttons + margin-bottom: 40px !important; // Make room for GitHub buttons } .github-button { diff --git a/docs/input/docs/fundamentals/environment-variables.md b/docs/input/docs/fundamentals/environment-variables.md index 7475cea7..52af7c5e 100644 --- a/docs/input/docs/fundamentals/environment-variables.md +++ b/docs/input/docs/fundamentals/environment-variables.md @@ -42,24 +42,6 @@ The Personal Access Token of the GitHub account to be used. If `GITHUB_PAT` is not set, the alternatives of `GH_TOKEN` and `GITHUB_TOKEN` are considered. ::: -## Gitter - -When a successful release build has been completed, Cake.Recipe can be configured to send out a notification (with configurable message) to a Gitter Room. There are two required environment variables that needs to be set to make this happen. Further information about find this information can be found in the Cake.Gitter [documentation](https://cake-contrib.github.io/Cake.Gitter/docs/usage/requiredinformation). - -:::{.alert .alert-info} -**NOTE:** - -In addition to these environment variables being present, and correct, the control variable [shouldPostToGitter](./set-parameters#shouldPostToGitter) also needs to be set to true. The default value for this parameter is true. -::: - -### GITTER_TOKEN - -The authentication token for the user who should post to the room. - -### GITTER_ROOM_ID - -The room ID where you want the message to be sent. - ## Slack When a release build fails, Cake.Recipe can be configured to send out a notification (with configurable message) to a Slack Channel. There are two required environment variables that s to be set to make this happen. Further information about find this information can be found in the Cake.Slack [documentation](https://github.com/cake-contrib/Cake.Slack). diff --git a/docs/input/docs/fundamentals/print-parameters.md b/docs/input/docs/fundamentals/print-parameters.md index b3057e7b..3f958160 100644 --- a/docs/input/docs/fundamentals/print-parameters.md +++ b/docs/input/docs/fundamentals/print-parameters.md @@ -26,7 +26,6 @@ IsTagged: False BranchType: Develop TreatWarningsAsErrors: True ShouldSendEmail: True -ShouldPostToGitter: True ShouldPostToSlack: True ShouldPostToTwitter: True ShouldPostToMicrosoftTeams: False diff --git a/docs/input/docs/fundamentals/set-parameters.md b/docs/input/docs/fundamentals/set-parameters.md index ae541eab..3b2c614d 100644 --- a/docs/input/docs/fundamentals/set-parameters.md +++ b/docs/input/docs/fundamentals/set-parameters.md @@ -177,14 +177,6 @@ Default Value: Title.Replace(".", "-").ToLower(); ``` -### shouldPostToGitter - -This is used as a final control variable for whether or not notification messages should be posted to Gitter when the a final release build (i.e. a tagged build) completes. - -Type: `bool` - -Default Value: - ```csharp true ``` @@ -502,18 +494,6 @@ Default Value: 60 ``` -### gitterMessage - -This is the message that is sent to Gitter at the end of a tagged build. This is formatted with the calculated version number, as well as the Title parameter. - -Type: `string` - -Default Value: - -```csharp -@/all Version {0} of the {1} Addin has just been released, this will be available here https://www.nuget.org/packages/{1}, once package indexing is complete." -``` - ### microsoftTeamsMessage This is the message that is sent to Microsoft Teams at the end of a tagged build. This is formatted with the calculated version number, as well as the Title parameter. diff --git a/docs/input/docs/fundamentals/set-variable-names.md b/docs/input/docs/fundamentals/set-variable-names.md index 2dd2cf26..661ec717 100644 --- a/docs/input/docs/fundamentals/set-variable-names.md +++ b/docs/input/docs/fundamentals/set-variable-names.md @@ -6,24 +6,24 @@ Description: Override the default names of the environment variables used by Cak Cake.Recipe is driven by [environment variables](./environment-variables). These are used to store the sensitive information that is required during the build process. For example, the username and password needed to send email, or the token required to access GitHub. -Cake.Recipe has default environment variable names for all the pieces of information that are required. The expectation is that either locally on your own machine, or on the CI/CD pipeline that you are using, you set the values for all of the ones that you intend to use. For example, if you want to send messages to Gitter when the build succeeds, you will need to set environment variables with the names required. +Cake.Recipe has default environment variable names for all the pieces of information that are required. The expectation is that either locally on your own machine, or on the CI/CD pipeline that you are using, you set the values for all of the ones that you intend to use. For example, if you want to send messages to Slack when the build succeeds, you will need to set environment variables with the names required. -However, it may be necessary to change these environment variable names. One example of when this is required is when you might be using Cake.Recipe on two completely separate projects. In this scenario, you might need to set the Gitter Environment variables for both projects, but they may require different values. +However, it may be necessary to change these environment variable names. One example of when this is required is when you might be using Cake.Recipe on two completely separate projects. In this scenario, you might need to set the Slack Environment variables for both projects, but they may require different values. -As an example, lets say that you wanted to change the name of the environment variables that stored the Gitter credential information. You could add something like the following to your [recipe.cake](./recipe-cake) file: +As an example, lets say that you wanted to change the name of the environment variables that stored the Slack credential information. You could add something like the following to your [recipe.cake](./recipe-cake) file: ```csharp -Environment.SetVariableNames(gitterTokenVariable: "PROJECTA_GITTER_TOKEN", gitterRoomIdVariable: "PROJECTA_GITTER_ROOM_ID"); +Environment.SetVariableNames(slackTokenVariable: "PROJECTA_SLACK_TOKEN", slackChannelVariable: "PROJECTA_SLACK_CHANNEL"); ``` -This would mean that when required, Cake.Recipe would check the machine which it is running on for environment variables names `PROJECTA_GITTER_TOKEN` and `PROJECTA_GITTER_ROOM_ID`, rather than the default of `GITTER_TOKEN` and `GITTER_ROOM_ID`. +This would mean that when required, Cake.Recipe would check the machine which it is running on for environment variables names `PROJECTA_SLACK_TOKEN` and `PROJECTA_SLACK_CHANNEL`, rather than the default of `SLACK_TOKEN` and `SLACK_CHANNEL`. There is another scenario where you might want to override the environment variable names when running locally on your own machine, but you might want to use the default variable names when running on a CI/CD system. To facilitate that, you can do something similar to the following: ```csharp if (BuildSystem.IsLocalBuild) { - Environment.SetVariableNames(gitterTokenVariable: "PROJECTA_GITTER_TOKEN", gitterRoomIdVariable: "PROJECTA_GITTER_ROOM_ID"); + Environment.SetVariableNames(slackTokenVariable: "PROJECTA_SLACK_TOKEN", slackChannelVariable: "PROJECTA_SLACK_CHANNEL"); } else { @@ -39,14 +39,6 @@ The `SetVariableNames` method uses the concept of optional parameters, in fact, Default value: `GITHUB_PAT` -### gitterTokenVariable - -Default value: `GITTER_ROOM_ID` - -### gitterRoomIdVariable - -Default value: `GITTER_ROOM_ID` - ### slackTokenVariable Default value: `SLACK_TOKEN` diff --git a/docs/input/docs/usage/create-pre-release.md b/docs/input/docs/usage/create-pre-release.md index b867d242..f59e1f59 100644 --- a/docs/input/docs/usage/create-pre-release.md +++ b/docs/input/docs/usage/create-pre-release.md @@ -25,4 +25,4 @@ which are documented [here](creating-release){.alert-link}. 6. Check the generated release notes and make required manual changes. 7. Publish the draft release on GitHub. -The last step will tag the release and trigger another build including the publishing. The build will automatically publish the build artifacts to the GitHub release, publish to NuGet and notify about the new release through Twitter and Gitter ((by default, but it is also possbile to add notifications to [Microsoft Teams](../fundamentals/environment-variables#microsoft-teams) and [email](../fundamentals/environment-variables#email))), based on your specific settings. +The last step will tag the release and trigger another build including the publishing. The build will automatically publish the build artifacts to the GitHub release, publish to NuGet and notify about the new release through Twitter ((by default, but it is also possible to add notifications to [Microsoft Teams](../fundamentals/environment-variables#microsoft-teams) and [email](../fundamentals/environment-variables#email))), based on your specific settings. diff --git a/docs/input/docs/usage/creating-release.md b/docs/input/docs/usage/creating-release.md index 080a3534..0c789b4e 100644 --- a/docs/input/docs/usage/creating-release.md +++ b/docs/input/docs/usage/creating-release.md @@ -23,4 +23,4 @@ Both are not requirements though and you can adopt the steps to other environmen 7. If release is ready finish release (merge back into `master` and `develop`) but don't tag the release yet. 8. Publish the draft release on GitHub. -The last step will tag the release and trigger another build including the publishing. The build will automatically publish the build artifacts to the GitHub release, publish to NuGet and notify about the new release through Twitter and Gitter (by default, but it is also possbile to add notifications to [Microsoft Teams](../fundamentals/environment-variables#microsoft-teams) and [email](../fundamentals/environment-variables#email)), based on your specific settings. +The last step will tag the release and trigger another build including the publishing. The build will automatically publish the build artifacts to the GitHub release, publish to NuGet and notify about the new release through Twitter (by default, but it is also possible to add notifications to [Microsoft Teams](../fundamentals/environment-variables#microsoft-teams) and [email](../fundamentals/environment-variables#email)), based on your specific settings. diff --git a/recipe.cake b/recipe.cake index b8b0ac01..af6e56e4 100644 --- a/recipe.cake +++ b/recipe.cake @@ -23,7 +23,6 @@ BuildParameters.SetParameters(context: Context, shouldRunCoveralls: false, shouldRunCodecov: false, shouldRunDotNetCorePack: true, - gitterMessage: "@/all " + standardNotificationMessage, twitterMessage: standardNotificationMessage); BuildParameters.PrintParameters(Context);