prima-twig 1.0.27 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/twig-build +196 -44
- data/bin/twig-feature +2 -0
- data/lib/prima_aws_client.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97f83507c77f13778f61406fc71ed10f6016908c582f49d370fa0bb8720b7ec1
|
4
|
+
data.tar.gz: ef82b61593e936c94c265deba8c09293abb449b4733b3002de46e83f1a73408f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 515f93a590f98d892c456742d4b270cdd0d6fd08fe313a29b054a910c79611111a96f807b45814e474e45d4364dbc4326daf2af70cdd2e52c25e854eca459990
|
7
|
+
data.tar.gz: d5d1bdaf8b37d872e9ddde0a2a1ca30bdd6226933e80c19bccc55943a533026ca5a6b7db2b64b3677211cdb39a48349e5f54d8695be04ec5314a24c400331cf3
|
data/bin/twig-build
CHANGED
@@ -19,7 +19,7 @@ class Build
|
|
19
19
|
@s3 = Aws::S3::Client.new
|
20
20
|
@s3_bucket = 'prima-artifacts'
|
21
21
|
@artifact_path = '/tmp/prima-artifact.zip'
|
22
|
-
@import_db_task = 'arn:aws:ecs:eu-west-1:001575623345:task-definition/ecs-task-db-restore2-TaskDefinitionDbRestore-
|
22
|
+
@import_db_task = 'arn:aws:ecs:eu-west-1:001575623345:task-definition/ecs-task-db-restore2-TaskDefinitionDbRestore-XYF2QX2UJRXZ:1'
|
23
23
|
@cf_role = 'arn:aws:iam::001575623345:role/qainit-service-role-cloudformat-CloudformationRole-18KBZQIS148R9'
|
24
24
|
@ecs_cluster_name = nil
|
25
25
|
@deploy_update = false
|
@@ -46,7 +46,10 @@ class Build
|
|
46
46
|
'starsky' => {},
|
47
47
|
'hutch' => {},
|
48
48
|
'maia' => {},
|
49
|
-
'legion' => {}
|
49
|
+
'legion' => {},
|
50
|
+
'vianello' => {},
|
51
|
+
'domus' => {}
|
52
|
+
# 'toretto' => {}
|
50
53
|
}
|
51
54
|
@base_stack_name_alb = 'ecs-alb-http-public-qa-'
|
52
55
|
@base_stack_name_alb_ws = 'ecs-alb-ws-public-qa-'
|
@@ -200,7 +203,7 @@ class Build
|
|
200
203
|
@tags = [
|
201
204
|
{
|
202
205
|
key: "qainit",
|
203
|
-
value: @git_branch
|
206
|
+
value: @git_branch.gsub(/[^a-zA-Z0-9\-]/,"-")
|
204
207
|
},
|
205
208
|
{
|
206
209
|
key: "hostname_pattern_priority",
|
@@ -208,7 +211,9 @@ class Build
|
|
208
211
|
}
|
209
212
|
]
|
210
213
|
@projects.each do |key, value|
|
211
|
-
|
214
|
+
unless value['name'].to_s.strip.empty?
|
215
|
+
@tags << { key: key, value: value['name'] }
|
216
|
+
end
|
212
217
|
end
|
213
218
|
end
|
214
219
|
|
@@ -359,6 +364,14 @@ class Build
|
|
359
364
|
{
|
360
365
|
parameter_key: 'MaiaElbHostname',
|
361
366
|
parameter_value: get_alb_host(stack_name_alb)
|
367
|
+
},
|
368
|
+
{
|
369
|
+
parameter_key: 'VianelloElbHostname',
|
370
|
+
parameter_value: get_alb_host(stack_name_alb)
|
371
|
+
},
|
372
|
+
{
|
373
|
+
parameter_key: 'DomusElbHostname',
|
374
|
+
parameter_value: get_alb_host(stack_name_alb)
|
362
375
|
}
|
363
376
|
]
|
364
377
|
|
@@ -424,43 +437,42 @@ class Build
|
|
424
437
|
end
|
425
438
|
|
426
439
|
def create_legion_stack()
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
# end
|
440
|
+
wait_for_artifact('prima-artifacts-encrypted', "microservices/legion/#{@projects["legion"]['revision']}-qa.tar.gz")
|
441
|
+
stack_name_legion = get_stack_name("legion")
|
442
|
+
git_checkout_version('legion', @projects["legion"]['revision'])
|
443
|
+
stack_body = File.read('projects/legion/deploy/task.yml')
|
444
|
+
parameters = [
|
445
|
+
{
|
446
|
+
parameter_key: "Environment",
|
447
|
+
parameter_value: "qa"
|
448
|
+
},
|
449
|
+
{
|
450
|
+
parameter_key: "ReleaseVersion",
|
451
|
+
parameter_value: @projects["legion"]['revision']
|
452
|
+
},
|
453
|
+
{
|
454
|
+
parameter_key: "TaskDesiredCount",
|
455
|
+
parameter_value: "1"
|
456
|
+
},
|
457
|
+
{
|
458
|
+
parameter_key: "ECSClusterName",
|
459
|
+
parameter_value: get_ecs_cluster_name
|
460
|
+
},
|
461
|
+
{
|
462
|
+
parameter_key: "HostnamePattern",
|
463
|
+
parameter_value: "legion-#{get_deploy_id}.qa.colaster.com"
|
464
|
+
},
|
465
|
+
{
|
466
|
+
parameter_key: "HostnamePatternPriority",
|
467
|
+
parameter_value: hostname_pattern_priority
|
468
|
+
}
|
469
|
+
]
|
470
|
+
if stack_exists?(stack_name_legion)
|
471
|
+
cur_version = get_currently_deployed_version(stack_name_legion)
|
472
|
+
update_stack(stack_name_legion, stack_body, parameters, @tags, @cf_role) unless cur_version.include?(@projects["legion"]['revision'])
|
473
|
+
else
|
474
|
+
create_stack(stack_name_legion, stack_body, parameters, @tags, @cf_role)
|
475
|
+
end
|
464
476
|
end
|
465
477
|
|
466
478
|
def create_urania_stack()
|
@@ -1427,6 +1439,114 @@ class Build
|
|
1427
1439
|
end
|
1428
1440
|
end
|
1429
1441
|
|
1442
|
+
def create_vianello_stack()
|
1443
|
+
if deploy_vianello_or_domus?
|
1444
|
+
wait_for_artifact('prima-artifacts-encrypted', "microservices/vianello/#{@projects["vianello"]['revision']}-qa.tar.gz")
|
1445
|
+
stack_name_vianello = "ecs-task-vianello-qa-#{get_deploy_id}"
|
1446
|
+
git_checkout_version('vianello', @projects["vianello"]['revision'])
|
1447
|
+
stack_body = File.read('projects/vianello/deploy/task.yml')
|
1448
|
+
parameters = [
|
1449
|
+
{
|
1450
|
+
parameter_key: "Environment",
|
1451
|
+
parameter_value: "qa"
|
1452
|
+
},
|
1453
|
+
{
|
1454
|
+
parameter_key: "ReleaseVersion",
|
1455
|
+
parameter_value: @projects["vianello"]['revision']
|
1456
|
+
},
|
1457
|
+
{
|
1458
|
+
parameter_key: "ECSClusterName",
|
1459
|
+
parameter_value: get_ecs_cluster_name
|
1460
|
+
},
|
1461
|
+
{
|
1462
|
+
parameter_key: "TaskDesiredCount",
|
1463
|
+
parameter_value: '1'
|
1464
|
+
},
|
1465
|
+
{
|
1466
|
+
parameter_key: "HostnamePattern",
|
1467
|
+
parameter_value: "vianello-#{get_deploy_id}.qa.colaster.com"
|
1468
|
+
},
|
1469
|
+
{
|
1470
|
+
parameter_key: "HostnamePatternPriority",
|
1471
|
+
parameter_value: (hostname_pattern_priority.to_i + 254).to_s
|
1472
|
+
},
|
1473
|
+
{
|
1474
|
+
parameter_key: "ECSClusterName",
|
1475
|
+
parameter_value: get_ecs_cluster_name
|
1476
|
+
},
|
1477
|
+
{
|
1478
|
+
parameter_key: "ALBShortName",
|
1479
|
+
parameter_value: "vianello-qa-#{get_deploy_id}"[0..27]
|
1480
|
+
},
|
1481
|
+
{
|
1482
|
+
parameter_key: "EnvHash",
|
1483
|
+
parameter_value: get_deploy_id
|
1484
|
+
}
|
1485
|
+
]
|
1486
|
+
if stack_exists?(stack_name_vianello)
|
1487
|
+
cur_version = get_currently_deployed_version(stack_name_vianello)
|
1488
|
+
update_stack(stack_name_vianello, stack_body, parameters, @tags, @cf_role) unless cur_version.include?(@projects["vianello"]['revision'])
|
1489
|
+
else
|
1490
|
+
create_stack(stack_name_vianello, stack_body, parameters, @tags, @cf_role)
|
1491
|
+
end
|
1492
|
+
else
|
1493
|
+
true
|
1494
|
+
end
|
1495
|
+
end
|
1496
|
+
|
1497
|
+
def create_domus_stack()
|
1498
|
+
if deploy_vianello_or_domus?
|
1499
|
+
wait_for_artifact('prima-artifacts-encrypted', "microservices/domus/#{@projects["domus"]['revision']}-#{get_deploy_id[0..7]}-qa.tar.gz")
|
1500
|
+
wait_for_stack_ready(get_stack_name("vianello")) unless stack_ready?(get_stack_name("vianello"))
|
1501
|
+
|
1502
|
+
stack_name_domus = get_stack_name("domus")
|
1503
|
+
git_checkout_version('domus', @projects["domus"]['revision'])
|
1504
|
+
stack_body = File.read('projects/domus/deploy/task.yml')
|
1505
|
+
parameters = [
|
1506
|
+
{
|
1507
|
+
parameter_key: "Environment",
|
1508
|
+
parameter_value: "qa"
|
1509
|
+
},
|
1510
|
+
{
|
1511
|
+
parameter_key: "ReleaseVersion",
|
1512
|
+
parameter_value: "#{@projects["domus"]['revision']}-#{get_deploy_id[0..7]}"
|
1513
|
+
},
|
1514
|
+
{
|
1515
|
+
parameter_key: "ALBShortName",
|
1516
|
+
parameter_value: "domus-qa-#{get_deploy_id}"[0..27]
|
1517
|
+
},
|
1518
|
+
{
|
1519
|
+
parameter_key: "ECSClusterName",
|
1520
|
+
parameter_value: get_ecs_cluster_name
|
1521
|
+
},
|
1522
|
+
{
|
1523
|
+
parameter_key: "EnvHash",
|
1524
|
+
parameter_value: get_deploy_id
|
1525
|
+
},
|
1526
|
+
{
|
1527
|
+
parameter_key: "HostnamePattern",
|
1528
|
+
parameter_value: "domus-#{get_deploy_id}.qa.colaster.com"
|
1529
|
+
},
|
1530
|
+
{
|
1531
|
+
parameter_key: "HostnamePatternPriority",
|
1532
|
+
parameter_value: (hostname_pattern_priority.to_i + 254).to_s
|
1533
|
+
},
|
1534
|
+
{
|
1535
|
+
parameter_key: "ApiUrl",
|
1536
|
+
parameter_value: "https://#{get_route53_hostname('vianello')}"
|
1537
|
+
}
|
1538
|
+
]
|
1539
|
+
if stack_exists?(stack_name_domus)
|
1540
|
+
cur_version = get_currently_deployed_version(stack_name_domus)
|
1541
|
+
update_stack(stack_name_domus, stack_body, parameters, @tags, @cf_role) unless cur_version.include?(@projects["domus"]['revision'])
|
1542
|
+
else
|
1543
|
+
create_stack(stack_name_domus, stack_body, parameters, @tags, @cf_role)
|
1544
|
+
end
|
1545
|
+
else
|
1546
|
+
true
|
1547
|
+
end
|
1548
|
+
end
|
1549
|
+
|
1430
1550
|
def create_rogoreport_stack()
|
1431
1551
|
true
|
1432
1552
|
end
|
@@ -1437,12 +1557,16 @@ class Build
|
|
1437
1557
|
wait_for_stack_ready(get_stack_name("worker-ermes")) unless stack_ready?(get_stack_name("worker-ermes"))
|
1438
1558
|
wait_for_stack_ready(get_stack_name("ermes")) unless stack_ready?(get_stack_name("ermes"))
|
1439
1559
|
wait_for_stack_ready(get_stack_name("peano")) unless stack_ready?(get_stack_name("peano"))
|
1440
|
-
|
1560
|
+
wait_for_stack_ready(get_stack_name("legion")) unless stack_ready?(get_stack_name("legion"))
|
1441
1561
|
wait_for_stack_ready(get_stack_name("borat")) unless stack_ready?(get_stack_name("borat"))
|
1442
1562
|
wait_for_stack_ready(get_stack_name("activia")) unless stack_ready?(get_stack_name("activia"))
|
1443
1563
|
wait_for_stack_ready(get_stack_name("maia")) unless stack_ready?(get_stack_name("maia"))
|
1444
1564
|
wait_for_stack_ready(get_stack_name("crash")) unless stack_ready?(get_stack_name("crash"))
|
1445
1565
|
wait_for_stack_ready(get_stack_name("hutch")) unless stack_ready?(get_stack_name("hutch"))
|
1566
|
+
if deploy_vianello_or_domus?
|
1567
|
+
wait_for_stack_ready(get_stack_name("vianello")) unless stack_ready?(get_stack_name("vianello"))
|
1568
|
+
wait_for_stack_ready(get_stack_name("domus")) unless stack_ready?(get_stack_name("domus"))
|
1569
|
+
end
|
1446
1570
|
|
1447
1571
|
update_service_defaults(get_stack_name("web"))
|
1448
1572
|
update_service_defaults(get_stack_name("consumer-api"))
|
@@ -1453,7 +1577,7 @@ class Build
|
|
1453
1577
|
update_service_defaults(get_stack_name("hal9000"))
|
1454
1578
|
update_service_defaults(get_stack_name("fidaty"))
|
1455
1579
|
update_service_defaults(get_stack_name("peano"))
|
1456
|
-
update_service_defaults(get_stack_name("legion"))
|
1580
|
+
# update_service_defaults(get_stack_name("legion")) TODO UNCOMMENT
|
1457
1581
|
update_service_defaults(get_stack_name("assange"))
|
1458
1582
|
update_service_defaults(get_stack_name("borat"))
|
1459
1583
|
update_service_defaults(get_stack_name("activia"))
|
@@ -1464,6 +1588,10 @@ class Build
|
|
1464
1588
|
update_service_defaults(get_stack_name("starsky"))
|
1465
1589
|
update_service_defaults(get_stack_name("hutch"))
|
1466
1590
|
update_service_defaults(get_stack_name("crash"))
|
1591
|
+
if deploy_vianello_or_domus?
|
1592
|
+
update_service_defaults(get_stack_name("vianello"))
|
1593
|
+
update_service_defaults(get_stack_name("domus"))
|
1594
|
+
end
|
1467
1595
|
|
1468
1596
|
activia_hostname = get_route53_hostname("activia")
|
1469
1597
|
assange_hostname = get_route53_hostname("assange")
|
@@ -1485,6 +1613,8 @@ class Build
|
|
1485
1613
|
starsky_hostname = get_route53_hostname("starsky")
|
1486
1614
|
hutch_hostname = get_route53_hostname("hutch")
|
1487
1615
|
legion_hostname = get_route53_hostname("legion")
|
1616
|
+
vianello_hostname = get_route53_hostname("vianello")
|
1617
|
+
domus_hostname = get_route53_hostname("domus")
|
1488
1618
|
|
1489
1619
|
#launch_mimo(get_deploy_id)
|
1490
1620
|
|
@@ -1508,7 +1638,11 @@ class Build
|
|
1508
1638
|
> Legion url: http://#{legion_hostname}:8051
|
1509
1639
|
> Crash url: https://#{crash_hostname}
|
1510
1640
|
> Starsky url: https://#{starsky_hostname}
|
1511
|
-
> Hutch url: https://#{hutch_hostname}
|
1641
|
+
> Hutch url: https://#{hutch_hostname}"
|
1642
|
+
projects_text.concat "
|
1643
|
+
> Vianello url: https://#{vianello_hostname}
|
1644
|
+
> Domus url: https://#{domus_hostname}" if deploy_vianello_or_domus?
|
1645
|
+
projects_text.concat "
|
1512
1646
|
> RabbitMQ url: http://#{get_ec2_ip_address}:15672
|
1513
1647
|
> Elasticsearch url: http://#{get_ec2_ip_address}:9200
|
1514
1648
|
> Git branch: #{@git_branch}
|
@@ -1572,6 +1706,10 @@ class Build
|
|
1572
1706
|
host = "legion-#{get_deploy_id}.qa.colaster.com"
|
1573
1707
|
when project.include?('maia-intermediari')
|
1574
1708
|
host = "api-intermediari-#{get_deploy_id}.qa.colaster.com"
|
1709
|
+
when project.include?('vianello')
|
1710
|
+
host = "vianello-#{get_deploy_id}.qa.colaster.com"
|
1711
|
+
when project.include?('domus')
|
1712
|
+
host = "domus-#{get_deploy_id}.qa.colaster.com"
|
1575
1713
|
end
|
1576
1714
|
host
|
1577
1715
|
end
|
@@ -1633,6 +1771,10 @@ class Build
|
|
1633
1771
|
logical_resource_id = 'EcsApplicationLoadBalancerPublic'
|
1634
1772
|
when stack_name.include?('legion')
|
1635
1773
|
logical_resource_id = 'EcsApplicationLoadBalancerInternal'
|
1774
|
+
when stack_name.include?('vianello')
|
1775
|
+
logical_resource_id = 'EcsApplicationLoadBalancerInternal'
|
1776
|
+
when stack_name.include?('domus')
|
1777
|
+
logical_resource_id = 'EcsApplicationLoadBalancerPublic'
|
1636
1778
|
end
|
1637
1779
|
resp = describe_stack_resource(stack_name, logical_resource_id)
|
1638
1780
|
resp = describe_load_balancers([resp.stack_resource_detail.physical_resource_id])
|
@@ -1685,6 +1827,10 @@ class Build
|
|
1685
1827
|
logical_resource_id = 'ECSServiceMaia'
|
1686
1828
|
when stack_name.include?('legion')
|
1687
1829
|
logical_resource_id = 'ECSServiceLegionQA'
|
1830
|
+
when stack_name.include?('vianello')
|
1831
|
+
logical_resource_id = 'ECSServiceVianelloQA'
|
1832
|
+
when stack_name.include?('domus')
|
1833
|
+
logical_resource_id = 'ECSServiceDomus'
|
1688
1834
|
else
|
1689
1835
|
raise "Service name non gestito per lo stack #{stack_name}"
|
1690
1836
|
end
|
@@ -1763,6 +1909,12 @@ class Build
|
|
1763
1909
|
})
|
1764
1910
|
end
|
1765
1911
|
|
1912
|
+
def deploy_vianello_or_domus?
|
1913
|
+
vianello_present = !@projects['vianello'].empty? && @projects['vianello'][:name] != 'master' && !@projects['vianello'][:default_branch]
|
1914
|
+
domus_present = !@projects['domus'].empty? && @projects['domus'][:name] != 'master' && !@projects['domus'][:default_branch]
|
1915
|
+
vianello_present || domus_present
|
1916
|
+
end
|
1917
|
+
|
1766
1918
|
def git_checkout_version(project, revision)
|
1767
1919
|
Dir.chdir "projects/#{project}"
|
1768
1920
|
exec_step "git checkout -- . && git checkout #{revision}"
|
data/bin/twig-feature
CHANGED
@@ -434,6 +434,8 @@ class Release
|
|
434
434
|
def qainit_deploy!(quiet = false)
|
435
435
|
`git checkout master && git pull && git submodule update --init --recursive && git remote prune origin`
|
436
436
|
|
437
|
+
`git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D`
|
438
|
+
|
437
439
|
default_name = get_default_branch_name @projects
|
438
440
|
feature_number = ''
|
439
441
|
unless quiet
|
data/lib/prima_aws_client.rb
CHANGED
@@ -340,7 +340,7 @@ module PrimaAwsClient
|
|
340
340
|
def wait_for_artifact(bucket, path)
|
341
341
|
ready = artifact_exists?(bucket, path)
|
342
342
|
sleep_seconds = 13
|
343
|
-
output "Attendo che
|
343
|
+
output "Attendo che sia pronto l'artefatto #{path}...\n".yellow
|
344
344
|
retries = 0
|
345
345
|
while !ready
|
346
346
|
ready = true if artifact_exists?(bucket, path)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prima-twig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matteo Giachino
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2020-
|
17
|
+
date: 2020-06-25 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: aws-sdk-autoscaling
|