Exemplo n.º 1
0
        /// <summary>
        /// Build Environment.
        /// </summary>
        public ActionResult Queue(string project, string environment)
        {
            try
            {
                var teamProject      = _teamRepository.GetProject(project);
                var mergeEnvironment = teamProject.MergeEnvironments.FirstOrDefault(m => string.Compare(m.Name, environment, StringComparison.OrdinalIgnoreCase) == 0);
                if (mergeEnvironment == null)
                {
                    return(new JsonDotNetResult(null));
                }

                var model = new JsonEnvironment
                {
                    value = (Environment)Enum.Parse(typeof(Environment), mergeEnvironment.Name, true)
                };
                return(BuildEnvironment(model));
            }
            catch (BaseException ex)
            {
                _logger.Log(ex);
            }
            catch (Exception ex)
            {
                _logger.Log(ex);
            }

            return(View("Error"));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Build Environment.
        /// </summary>
        public ActionResult BuildEnvironment(JsonEnvironment model)
        {
            try
            {
                _buildRepository.QueueEnvironmentBuild(model.value, true);
                return(RedirectToAction("Index"));
            }
            catch (BaseException ex)
            {
                _logger.Log(ex);
            }
            catch (Exception ex)
            {
                _logger.Log(ex);
            }

            return(RedirectToAction("Index"));
        }