public async Task <IActionResult> Build(string uuid)
        {
            if (uuid == null)
            {
                return(BadRequest());
            }
            if (!Util.IsCorrectUuid(uuid))
            {
                // wrong uuid format
                return(BadRequest());
            }
            var userId = _userManager.GetUserId(HttpContext.User);
            var result = await _context.CanAccessToProjectWithProjectAsync(userId, uuid, false, true);

            if (!result.canAccess)
            {
                return(NotFound());
            }
            var buildId = result.project.BuildId + 1;

            result.project.BuildId = buildId;
            await _context.SaveChangesAsync();

            _buildService.StartBuild(result.project, userId, buildId);
            return(new NoContentResult());
        }
 public override void Check()
 {
     lock (this)
     {
         _currentBuild = null;
         var proj = Context.Project.SelectedProject;
         _currentBuild = BuildServiceFactory.Create(proj.Provider,
                                                    Context.WebFactory,
                                                    Context.WebUtility,
                                                    Context.Garbage);
         var config = Context.ConfigurationService.GetBuildParams(proj.Slug);
         var state  = _currentBuild.StartBuild(config);
         ProcessBuildState(state, proj.Title);
     }
 }
 public override void Check()
 {
     lock (this)
     {
         _currentBuild = null;
         var proj = Context.Project.SelectedProject;
         _currentBuild = BuildServiceFactory.Create(proj.Provider,
                                                    Context.WebFactory,
                                                    Context.WebUtility,
                                                    Context.Garbage);
         var config = Context.ConfigurationService.GetBuildParams(proj.Slug);
         var state = _currentBuild.StartBuild(config);
         ProcessBuildState(state, proj.Title);
     }
 }