Exemple #1
0
 public async Task <Component> Create(string projectId, string name, int rank)
 {
     return(new Component
     {
         Id = await _idStorage.GetNext(IdSequence.Component),
         ProjectId = projectId,
         Name = name,
         Rank = rank
     });
 }
        public async Task <DeploymentProcess> Create(int componentId, byte[] zipFileBytes)
        {
            _validateZipFile.Validate(zipFileBytes);

            return(new DeploymentProcess
            {
                Id = await _idStorage.GetNext(IdSequence.DeploymentProcess),
                ComponentId = componentId,
                File = zipFileBytes
            });
        }
Exemple #3
0
        private static async Task <List <int> > GenerateIds(IdStorage idStorage, int count, IdSequence sequence)
        {
            var ids = new List <int>();

            for (var index = 0; index < count; index++)
            {
                var nextId = await idStorage.GetNext(sequence);

                ids.Add(nextId);
            }

            return(ids);
        }
Exemple #4
0
        public async Task <Deployment> Create(string projectId, int environmentId, int packageId)
        {
            return(new Deployment
            {
                Id = await _idStorage.GetNext(IdSequence.Deployment),

                ProjectId = projectId,
                PackageId = packageId,
                EnvironmentId = environmentId,

                StartedAt = _clock.UtcNow,
                Status = DeploymentStatus.InProgress
            });
        }
        public async Task <Environment> Create(string projectId, int rank, string displayName)
        {
            var environment = new Environment
            {
                Id          = await _idStorage.GetNext(IdSequence.Environment),
                ProjectId   = projectId,
                Rank        = rank,
                DisplayName = displayName
            };

            _dbContext.Environments.Add(environment);

            return(environment);
        }
Exemple #6
0
        public async Task <Package> Create(
            string projectId,
            int deploymentProcessId,
            int componentId,
            string description,
            VariableCollection variableCollection)
        {
            return(new Package
            {
                Id = await _idStorage.GetNext(IdSequence.Package),

                ProjectId = projectId,
                DeploymentProcessId = deploymentProcessId,
                ComponentId = componentId,

                Description = description,
                Variables = variableCollection,
                CreatedAt = _clock.UtcNow
            });
        }