forked from anupam-ncsu/JenkinsECS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JenkinsMasterService.yaml
73 lines (63 loc) · 2.69 KB
/
JenkinsMasterService.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Description:
This Stack produces a service for Jenkins Master.
Parameters:
VPC:
Description: The VPC that the Service is deployed to
Type: AWS::EC2::VPC::Id
Default: vpc-e9513481
Cluster:
Description: Please provide the ECS Cluster ID that this service should run on
Type: String
Default: ANUPAM_dev_Jenkins
DesiredMasterCount:
Description: How many instances of this task should we run across our cluster?
Type: Number
Default: 1
DockerEnvironmentTag:
Description: The tag of the image which is relevant to the given environment
Type: String
Default: dev
Resources:
ServicesJenkinsMaster:
Type: AWS::ECS::Service
Properties:
Cluster: !Ref Cluster
DesiredCount: !Ref DesiredMasterCount
DeploymentConfiguration:
MaximumPercent: 100
MinimumHealthyPercent: 50
PlacementConstraints:
- Type: distinctInstance
TaskDefinition: !Ref TaskDefinition
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: jenkins-master-service
NetworkMode: host
Volumes:
- Host:
SourcePath: '/newvolume'
Name: newvolume
ContainerDefinitions:
- Name: jenkins-master
Essential: true
Image: !Sub 952408268520.dkr.ecr.ca-central-1.amazonaws.com/jenkinsdocker
Memory: 512
PortMappings:
- ContainerPort: 8080
HostPort: 8080
- ContainerPort: 50000
HostPort: 50000
MountPoints:
- SourceVolume: newvolume
ContainerPath: /var/jenkins_home
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group: !Sub anupam-jenkins-master-${DockerEnvironmentTag}
awslogs-region: !Ref AWS::Region
CloudWatchLogsGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub anupam-jenkins-master-${DockerEnvironmentTag}
RetentionInDays: 365