コード例 #1
0
ファイル: ComponentFactory.cs プロジェクト: sheepit/sheepit
 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
     });
 }
コード例 #2
0
        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
            });
        }
コード例 #3
0
ファイル: SequencingTests.cs プロジェクト: sheepit/sheepit
        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);
        }
コード例 #4
0
ファイル: DeploymentFactory.cs プロジェクト: sheepit/sheepit
        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
            });
        }
コード例 #5
0
ファイル: EnvironmentFactory.cs プロジェクト: sheepit/sheepit
        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);
        }
コード例 #6
0
ファイル: PackageFactory.cs プロジェクト: sheepit/sheepit
        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
            });
        }