public async Task <CIResponse> ContactPlugin(string pluginName, CIRequest ciRequest)
        {
            if (!_plugins.ContainsKey(pluginName))
            {
                throw new PluginNotRegisteredException($"Plugin {pluginName} is not registered");
            }
            var channel      = new Channel(BBIConstants.PLUGIN_HOST_IP, _plugins[pluginName], ChannelCredentials.Insecure);
            var pluginClient = new CIPlugin.CIPluginClient(channel);

            var ciResponse = await pluginClient.GetCurrentStateAsync(ciRequest);

            await channel.ShutdownAsync();

            return(ciResponse);
        }
Esempio n. 2
0
 /// <summary>
 ///     Get current state of a GitLab CI pipeline
 /// </summary>
 /// <param name="request">Request sent by the supervisor</param>
 /// <param name="context">Request context</param>
 /// <returns></returns>
 public override async Task <CIResponse> GetCurrentState(CIRequest request, ServerCallContext context)
 {
     return(new CIResponse());
 }