Giter VIP home page Giter VIP logo

avivasolutionsnl / beacon Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 4.0 5.78 MB

A TeamCity or Azure DevOps monitoring tool that uses a Delcom USB LED or Shelly bulb to notify your teams

Home Page: https://chocolatey.org/packages/beacon

License: Apache License 2.0

PowerShell 4.28% C# 92.04% Batchfile 0.19% Shell 3.49%
azure-devops build-tool c-sharp chocolatey ci teamcity teamcity-monitoring

beacon's People

Contributors

dennisdoomen avatar gormac avatar hayley-jean avatar joostmeijles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

beacon's Issues

Add an option to monitor active branches only

See example request in TeamCity REST API documentation. The locator would have to be changed to something like this:

https://<server>/httpAuth/app/rest/buildTypes/id:<buildConfigId>/builds?locator=branch:(default:any,policy:active_history_and_active_vcs_branches),failedToStart:any,running:false,sinceDate:<sinceDate>

Ignore historical builds

If a historical build succeeded, but the last normal build failed, Beacon will report a success for that build configuration.

Needs license file

The Chocolatey package fails automated validation. It includes binaries, but does not include a license of the software to verify that.

See LicenseFileMissing Chocolatey article.

Add support for azure devops

Azure Devops has a REST API which Beacon could use to also support Azure Devops.

There is a nuget package available which makes it easy to use this REST service in .NET projects. Here's a simple console example that polls the status of the lastest build on the master branch:

using Microsoft.TeamFoundation.Build.WebApi;
using Microsoft.VisualStudio.Services.Common;
using Microsoft.VisualStudio.Services.WebApi;
using System;
using System.Linq;
using System.Threading.Tasks;

namespace AzureDevopsApiTest
{
    public class AzureDevopsOptions
    {
        /// <summary>
        /// The base url of the organisation or tfs instance.
        /// </summary>
        public Uri BaseUrl { get; set; }

        public string ProjectName { get; set; }

        /// <summary>
        /// The definition id of the build.
        /// </summary>
        public int DefinitionId { get; set; }

        /// <summary>
        /// For branches use refs/heads/branchname.
        /// For tags use refs/tags/tagname.
        /// </summary>
        public string BranchName { get; set; }

        /// <summary>
        /// Optional, not needed for public projects.
        /// </summary>
        public string PersonalAccessToken { get; set; }
    }

    class Program
    {
        static async Task Main(string[] args)
        {
            var options = new AzureDevopsOptions
            {
                BaseUrl = new Uri("https://dev.azure.com/yourorganisation"),
                ProjectName = "projectname",
                DefinitionId = 11,
                BranchName = "refs/heads/master",
                //PersonalAccessToken = "yourtokenhere"
            };

            var credentials = options.PersonalAccessToken == null ? new VssCredentials() : new VssBasicCredential(string.Empty, options.PersonalAccessToken);
            VssConnection connection = new VssConnection(options.BaseUrl, credentials);

            BuildHttpClient buildClient = connection.GetClient<BuildHttpClient>();

            var definitions = new[] { (await buildClient.GetDefinitionAsync(options.ProjectName, options.DefinitionId)).Id };

            while (true)
            {
                var latestBuild = (await buildClient.GetBuildsAsync(options.ProjectName, definitions, top: 1, branchName: options.BranchName)).FirstOrDefault();

                Console.WriteLine(latestBuild?.Status ?? BuildStatus.None);

                await Task.Delay(500);
            }
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.