-
-
Save akatakritos/11e35c2759210ab564a5 to your computer and use it in GitHub Desktop.
Rollbar.targets for Azure - pull Rollbar settings from Azure environment variables
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
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<Target Name="NotifyRollbarOfDeploy" AfterTargets="MSDeployPublish;CopyAllFilesToSingleFolderForPackage"> | |
<Exec Command="git log -1 --format=%%H" ConsoleToMSBuild="true" EchoOff="true"> | |
<Output TaskParameter="ConsoleOutput" PropertyName="GitSHA" /> | |
</Exec> | |
<Exec Command="git config user.email" ConsoleToMSBuild="true" EchoOff="true" WorkingDirectory="$(ProjectDir)\.."> | |
<Output TaskParameter="ConsoleOutput" PropertyName="GitEmail" /> | |
</Exec> | |
<Message Text="Rollbar.AccessToken: $(APPSETTING_RollbarAccessToken)" Importance="Normal" /> | |
<Message Text="Rollbar.Environment: $(APPSETTING_RollbarEnvironment)" Importance="Normal" /> | |
<Message Text="Git SHA: $(GitSHA)" Importance="Normal" /> | |
<Message Text="Rollbar: $(GitEmail) deployed @(RollbarEnvironment) revision $(GitSHA)" Importance="High" /> | |
<Exec Command="@powershell -NoProfile -ExecutionPolicy unrestricted -Command "(new-object net.webclient).UploadString('https://api.rollbar.com/api/1/deploy/', 'access_token=$(APPSETTING_RollbarAccessToken)&environment=$(APPSETTING_RollbarEnvironment)&revision=$(GitSHA)&local_username=$(GitEmail)')"" EchoOff="true" /> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment