ciinabox-ecs 0.3.0.alpha.1612412532 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/templates/services/sonarqube.rb +127 -0
  3. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0c757f7bd31538bddd7834491413db7d5748ca7944e1796f6779a1806abd16c
4
- data.tar.gz: bd1b8aea5d676333fc569fa47dc6160a42878a8b479ef1311d34db106e253006
3
+ metadata.gz: 39e4849ae94669f27d72e77689b01f277c49140ded5fd4f66f2907e37f3121bc
4
+ data.tar.gz: 85aa4a8ff629efde64c7b37c30cbf78314faac16d730990a1061dea1b79e5155
5
5
  SHA512:
6
- metadata.gz: 44312cfb402dd20e0e001c10d84f479c164471fb4cc4bd9de7ffcc8592e97bb3feaae252fdd42b69f33dd132d88db54e0a3347f1e3e4e7700a7c86ed6f4d10d1
7
- data.tar.gz: 5d97aee7e73853e9825f2717e78d6beb5ad0a890b97e2ffd93e002df6074c869bcff57dc633b934442a2b7d78533fdadf672a10ee9ec0691f87ff1972f0c9ef8
6
+ metadata.gz: c77a30d35621b0bbd1e7dc57f60e1532b50bdd6247e3e7eefc976b10d0868e4dc51afa843db465f0c91a06107979a860898d6f3f84553ba4dadd715efde23307
7
+ data.tar.gz: 174d3813016c3898b5ccc8e467071b944d1e591e2bf2a10b845fbbcd07d963e69c182516b4e340d3e1f66089c23c1121c7291750d6441fa231748fd3618abd70
@@ -0,0 +1,127 @@
1
+ require 'cfndsl'
2
+ require_relative '../../ext/helper'
3
+
4
+ if !defined? timezone
5
+ timezone = 'GMT'
6
+ end
7
+
8
+ image = 'sonarqube:lts'
9
+ java_opts = ''
10
+ memory = 2048
11
+ cpu = 300
12
+ container_port = 0
13
+ service = lookup_service('sonarqube', services)
14
+ if service
15
+ java_opts = service['JAVA_OPTS'] || ''
16
+ image = service['ContainerImage'] || image
17
+ memory = service['ContainerMemory'] || 2048
18
+ cpu = service['ContainerCPU'] || 300
19
+ container_port = service['InstancePort'] || 0
20
+ end
21
+
22
+ CloudFormation {
23
+
24
+ AWSTemplateFormatVersion "2010-09-09"
25
+ Description "ciinabox - ECS Service SonarQube v#{ciinabox_version}"
26
+
27
+ Parameter("ECSCluster"){ Type 'String' }
28
+ Parameter("ECSRole"){ Type 'String' }
29
+ Parameter("ServiceELB"){ Type 'String' }
30
+
31
+ Resource('SonarQubeTask') {
32
+ Type "AWS::ECS::TaskDefinition"
33
+ Property('ContainerDefinitions', [
34
+ {
35
+ Name: 'sonarqube',
36
+ MemoryReservation: memory,
37
+ Cpu: cpu,
38
+ Image: image,
39
+ Environment: [
40
+ {
41
+ Name: 'VIRTUAL_HOST',
42
+ Value: "sonar.#{dns_domain}"
43
+ },
44
+ {
45
+ Name: 'VIRTUAL_PORT',
46
+ Value: '9000'
47
+ }
48
+ ],
49
+ Ulimits: [
50
+ {
51
+ Name: "nofile",
52
+ SoftLimit: 65536,
53
+ HardLimit: 65536
54
+ }
55
+ ],
56
+ Essential: true,
57
+ MountPoints: [
58
+ {
59
+ ContainerPath: '/etc/localtime',
60
+ SourceVolume: 'timezone',
61
+ ReadOnly: true
62
+ },
63
+ {
64
+ ContainerPath: '/opt/sonarqube/extensions',
65
+ SourceVolume: 'sonarqube_extensions',
66
+ ReadOnly: false
67
+ },
68
+ {
69
+ ContainerPath: '/opt/sonarqube/logs',
70
+ SourceVolume: 'sonarqube_logs',
71
+ ReadOnly: false
72
+ },
73
+ {
74
+ ContainerPath: '/opt/sonarqube/data',
75
+ SourceVolume: 'sonarqube_data',
76
+ ReadOnly: false
77
+ }
78
+ ]
79
+ }
80
+ ])
81
+ Property('Volumes', [
82
+ {
83
+ Name: 'timezone',
84
+ Host: {
85
+ SourcePath: '/etc/localtime'
86
+ }
87
+ },
88
+ {
89
+ Name: 'sonarqube_conf',
90
+ Host: {
91
+ SourcePath: '/data/sonarqube/conf'
92
+ }
93
+ },
94
+ {
95
+ Name: 'sonarqube_extensions',
96
+ Host: {
97
+ SourcePath: '/data/sonarqube/extensions'
98
+ }
99
+ },
100
+ {
101
+ Name: 'sonarqube_logs',
102
+ Host: {
103
+ SourcePath: '/data/sonarqube/logs'
104
+ }
105
+ },
106
+ {
107
+ Name: 'sonarqube_data',
108
+ Host: {
109
+ SourcePath: '/data/sonarqube/data'
110
+ }
111
+ }
112
+ ])
113
+ }
114
+
115
+ Resource('SonarQubeService') {
116
+ Type 'AWS::ECS::Service'
117
+ Property('Cluster', Ref('ECSCluster'))
118
+ Property('DesiredCount', 1)
119
+ Property('TaskDefinition', Ref('SonarQubeTask'))
120
+ Property('Role', Ref('ECSRole')) unless container_port == 0
121
+ Property('LoadBalancers', [
122
+ { ContainerName: 'sonarqube', ContainerPort: container_port, LoadBalancerName: Ref('ServiceELB') }
123
+ ]) unless container_port == 0
124
+
125
+ }
126
+
127
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ciinabox-ecs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.alpha.1612412532
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Base2Services
@@ -147,6 +147,7 @@ files:
147
147
  - templates/services/icinga2.rb
148
148
  - templates/services/jenkins.rb
149
149
  - templates/services/nexus.rb
150
+ - templates/services/sonarqube.rb
150
151
  - templates/vpc.rb
151
152
  - templates/vpn.rb
152
153
  homepage: https://github.com/base2Services/ciinabox-ecs
@@ -164,9 +165,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
165
  version: '0'
165
166
  required_rubygems_version: !ruby/object:Gem::Requirement
166
167
  requirements:
167
- - - ">"
168
+ - - ">="
168
169
  - !ruby/object:Gem::Version
169
- version: 1.3.1
170
+ version: '0'
170
171
  requirements: []
171
172
  rubygems_version: 3.2.8
172
173
  signing_key: