ciinabox-ecs 0.3.0.alpha.1612411765 → 0.3.1.alpha.1622695860

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 295d59492bfdba11f5529ed80248fd516c2aa25d1d3a34b5122e253b92f962d8
4
- data.tar.gz: 5bf0fc48b3a163fbebea55431a472fc14215b58f837b17834456ceeecde00ad7
3
+ metadata.gz: 1fba847852f3f33d382b88331f1e515c94d78deb4a8dbd94b11a2de6adfd128b
4
+ data.tar.gz: d6a046c17fc32c6ac67071e7046ba6bd469e73ffe6b2ae0612b80480d895d0e6
5
5
  SHA512:
6
- metadata.gz: 26bc218ceb71ad26c5489e07a60e9ca49386d45dc5506a40108dc2fc07098269d5115e2822d185359dbce004dffe9c6ffff59d2fd3450c544b0a6fd7563ae07f
7
- data.tar.gz: 3a1b9a52304547f45b9c4eee818f9513158167c92401b2d90bcf2d2b49505acd4db4930d36bed7a79bc1a50a22601ee210bf2228282e5a64de8b1db9232e380a
6
+ metadata.gz: 1e3c27b8bff9b261fba646cb43eac0047f477fb67f4b604416aa644a9ccd26ae2a882546bd0a88a95e524e2b2d9d90389fa87f73c2271140a94360b956fea939
7
+ data.tar.gz: 2ae6ce0b9cf7bf880f8bcddbedb98067ed5b2f3cfc145072ca4734c19da76f12e1aebbfde1062aed751981099a3ee5611795c9eb6d3ea38b2a9a7f6ddace8dea
@@ -190,6 +190,8 @@ CloudFormation {
190
190
  "echo ECS_ENABLE_TASK_CPU_MEM_LIMIT=false >> /etc/ecs/ecs.config\n",
191
191
  "INSTANCE_ID=$(echo `/opt/aws/bin/ec2-metadata -i | cut -f2 -d:`)\n",
192
192
  "PRIVATE_IP=`/opt/aws/bin/ec2-metadata -o | cut -f2 -d: | cut -f2 -d-`\n",
193
+ "echo 'vm.max_map_count=262144' >> /etc/sysctl.conf\n",
194
+ "sysctl -p\n",
193
195
  "hostname ciinabox-ecs-xx\n",
194
196
  "#{proxy_config_userdata}",
195
197
  "yum install -y python-pip\n",
@@ -1,6 +1,7 @@
1
1
  require 'cfndsl'
2
2
  require 'securerandom'
3
3
  require 'deep_merge'
4
+ require_relative '../../ext/helper'
4
5
 
5
6
  # default values
6
7
  shared_envs = {
@@ -1,4 +1,5 @@
1
1
  require 'cfndsl'
2
+ require_relative '../../ext/helper'
2
3
 
3
4
  if !defined? timezone
4
5
  timezone = 'GMT'
@@ -109,7 +110,7 @@ if defined? include_diind_slave and include_diind_slave
109
110
  dind_definition = {
110
111
  Name: 'jenkins-docker-dind-slave',
111
112
  Memory: slave_memory,
112
- Image: "#{ciinabox_repo}ghcr.io/base2services/ciinabox-docker-slave:#{docker_slave_version}",
113
+ Image: "#{ciinabox_repo}/ciinabox-docker-slave:#{docker_slave_version}",
113
114
  Environment: [{Name: 'RUN_DOCKER_IN_DOCKER', Value: 1}],
114
115
  Essential: false,
115
116
  Privileged: true
@@ -140,7 +141,7 @@ if defined? include_dood_slave and include_dood_slave
140
141
  dood_definition = {
141
142
  Name: 'jenkins-docker-dood-slave',
142
143
  Memory: slave_memory,
143
- Image: "#{ciinabox_repo}ghcr.io/base2services/ciinabox-docker-slave:#{docker_slave_version}",
144
+ Image: "#{ciinabox_repo}/ciinabox-docker-slave:#{docker_slave_version}",
144
145
  Environment: [{Name: 'RUN_DOCKER_IN_DOCKER', Value: 0}],
145
146
  MountPoints: [
146
147
  {
@@ -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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ciinabox-ecs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.alpha.1612411765
4
+ version: 0.3.1.alpha.1622695860
5
5
  platform: ruby
6
6
  authors:
7
7
  - Base2Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-04 00:00:00.000000000 Z
11
+ date: 2021-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -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
@@ -168,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
169
  - !ruby/object:Gem::Version
169
170
  version: 1.3.1
170
171
  requirements: []
171
- rubygems_version: 3.2.8
172
+ rubygems_version: 3.2.19
172
173
  signing_key:
173
174
  specification_version: 4
174
175
  summary: Manage ciinabox on Aws Ecs