prima-twig 1.0.29 → 1.0.30
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 +154 -3
- 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: 3c989aabf822c2a40565c63569bab2de10523839a0ad3d22306fd2278f80df6e
|
4
|
+
data.tar.gz: 940621a31b416d977e7b658eed26c4baacc5832042eb32c7d2e821310f650b20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9914b248b39157243e36a7a013a9f4eed25a7dc7ad75de0ba68ab10b6a8b2dfde13d06b2bffb29b8cef4e29860d919d9db179c1bc474cf294d5cf67d75420204
|
7
|
+
data.tar.gz: 021bfb3a30acb9004b6442ebb2dfe53da078ba5fa3bc03d108815034cf37844f94dcf0e8828e7c5cd1b4b76a59722d871ccaf8ffa3d1be778edc0294be83e4dd
|
data/bin/twig-build
CHANGED
@@ -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",
|
@@ -359,6 +362,14 @@ class Build
|
|
359
362
|
{
|
360
363
|
parameter_key: 'MaiaElbHostname',
|
361
364
|
parameter_value: get_alb_host(stack_name_alb)
|
365
|
+
},
|
366
|
+
{
|
367
|
+
parameter_key: 'VianelloElbHostname',
|
368
|
+
parameter_value: get_alb_host(stack_name_alb)
|
369
|
+
},
|
370
|
+
{
|
371
|
+
parameter_key: 'DomusElbHostname',
|
372
|
+
parameter_value: get_alb_host(stack_name_alb)
|
362
373
|
}
|
363
374
|
]
|
364
375
|
|
@@ -1426,6 +1437,114 @@ class Build
|
|
1426
1437
|
end
|
1427
1438
|
end
|
1428
1439
|
|
1440
|
+
def create_vianello_stack()
|
1441
|
+
if deploy_vianello_or_domus?
|
1442
|
+
wait_for_artifact('prima-artifacts-encrypted', "microservices/vianello/#{@projects["vianello"]['revision']}-qa.tar.gz")
|
1443
|
+
stack_name_vianello = "ecs-task-vianello-qa-#{get_deploy_id}"
|
1444
|
+
git_checkout_version('vianello', @projects["vianello"]['revision'])
|
1445
|
+
stack_body = File.read('projects/vianello/deploy/task.yml')
|
1446
|
+
parameters = [
|
1447
|
+
{
|
1448
|
+
parameter_key: "Environment",
|
1449
|
+
parameter_value: "qa"
|
1450
|
+
},
|
1451
|
+
{
|
1452
|
+
parameter_key: "ReleaseVersion",
|
1453
|
+
parameter_value: @projects["vianello"]['revision']
|
1454
|
+
},
|
1455
|
+
{
|
1456
|
+
parameter_key: "ECSClusterName",
|
1457
|
+
parameter_value: get_ecs_cluster_name
|
1458
|
+
},
|
1459
|
+
{
|
1460
|
+
parameter_key: "TaskDesiredCount",
|
1461
|
+
parameter_value: '1'
|
1462
|
+
},
|
1463
|
+
{
|
1464
|
+
parameter_key: "HostnamePattern",
|
1465
|
+
parameter_value: "vianello-#{get_deploy_id}.qa.colaster.com"
|
1466
|
+
},
|
1467
|
+
{
|
1468
|
+
parameter_key: "HostnamePatternPriority",
|
1469
|
+
parameter_value: (hostname_pattern_priority.to_i + 254).to_s
|
1470
|
+
},
|
1471
|
+
{
|
1472
|
+
parameter_key: "ECSClusterName",
|
1473
|
+
parameter_value: get_ecs_cluster_name
|
1474
|
+
},
|
1475
|
+
{
|
1476
|
+
parameter_key: "ALBShortName",
|
1477
|
+
parameter_value: "vianello-qa-#{get_deploy_id}"[0..27]
|
1478
|
+
},
|
1479
|
+
{
|
1480
|
+
parameter_key: "EnvHash",
|
1481
|
+
parameter_value: get_deploy_id
|
1482
|
+
}
|
1483
|
+
]
|
1484
|
+
if stack_exists?(stack_name_vianello)
|
1485
|
+
cur_version = get_currently_deployed_version(stack_name_vianello)
|
1486
|
+
update_stack(stack_name_vianello, stack_body, parameters, @tags, @cf_role) unless cur_version.include?(@projects["vianello"]['revision'])
|
1487
|
+
else
|
1488
|
+
create_stack(stack_name_vianello, stack_body, parameters, @tags, @cf_role)
|
1489
|
+
end
|
1490
|
+
else
|
1491
|
+
true
|
1492
|
+
end
|
1493
|
+
end
|
1494
|
+
|
1495
|
+
def create_domus_stack()
|
1496
|
+
if deploy_vianello_or_domus?
|
1497
|
+
wait_for_artifact('prima-artifacts-encrypted', "microservices/domus/#{@projects["domus"]['revision']}-#{get_deploy_id[0..7]}-qa.tar.gz")
|
1498
|
+
wait_for_stack_ready(get_stack_name("vianello")) unless stack_ready?(get_stack_name("vianello"))
|
1499
|
+
|
1500
|
+
stack_name_domus = get_stack_name("domus")
|
1501
|
+
git_checkout_version('domus', @projects["domus"]['revision'])
|
1502
|
+
stack_body = File.read('projects/domus/deploy/task.yml')
|
1503
|
+
parameters = [
|
1504
|
+
{
|
1505
|
+
parameter_key: "Environment",
|
1506
|
+
parameter_value: "qa"
|
1507
|
+
},
|
1508
|
+
{
|
1509
|
+
parameter_key: "ReleaseVersion",
|
1510
|
+
parameter_value: "#{@projects["domus"]['revision']}-#{get_deploy_id[0..7]}"
|
1511
|
+
},
|
1512
|
+
{
|
1513
|
+
parameter_key: "ALBShortName",
|
1514
|
+
parameter_value: "domus-qa-#{get_deploy_id}"[0..27]
|
1515
|
+
},
|
1516
|
+
{
|
1517
|
+
parameter_key: "ECSClusterName",
|
1518
|
+
parameter_value: get_ecs_cluster_name
|
1519
|
+
},
|
1520
|
+
{
|
1521
|
+
parameter_key: "EnvHash",
|
1522
|
+
parameter_value: get_deploy_id
|
1523
|
+
},
|
1524
|
+
{
|
1525
|
+
parameter_key: "HostnamePattern",
|
1526
|
+
parameter_value: "domus-#{get_deploy_id}.qa.colaster.com"
|
1527
|
+
},
|
1528
|
+
{
|
1529
|
+
parameter_key: "HostnamePatternPriority",
|
1530
|
+
parameter_value: (hostname_pattern_priority.to_i + 254).to_s
|
1531
|
+
},
|
1532
|
+
{
|
1533
|
+
parameter_key: "ApiUrl",
|
1534
|
+
parameter_value: "https://#{get_route53_hostname('vianello')}"
|
1535
|
+
}
|
1536
|
+
]
|
1537
|
+
if stack_exists?(stack_name_domus)
|
1538
|
+
cur_version = get_currently_deployed_version(stack_name_domus)
|
1539
|
+
update_stack(stack_name_domus, stack_body, parameters, @tags, @cf_role) unless cur_version.include?(@projects["domus"]['revision'])
|
1540
|
+
else
|
1541
|
+
create_stack(stack_name_domus, stack_body, parameters, @tags, @cf_role)
|
1542
|
+
end
|
1543
|
+
else
|
1544
|
+
true
|
1545
|
+
end
|
1546
|
+
end
|
1547
|
+
|
1429
1548
|
def create_rogoreport_stack()
|
1430
1549
|
true
|
1431
1550
|
end
|
@@ -1442,6 +1561,10 @@ class Build
|
|
1442
1561
|
wait_for_stack_ready(get_stack_name("maia")) unless stack_ready?(get_stack_name("maia"))
|
1443
1562
|
wait_for_stack_ready(get_stack_name("crash")) unless stack_ready?(get_stack_name("crash"))
|
1444
1563
|
wait_for_stack_ready(get_stack_name("hutch")) unless stack_ready?(get_stack_name("hutch"))
|
1564
|
+
if deploy_vianello_or_domus?
|
1565
|
+
wait_for_stack_ready(get_stack_name("vianello")) unless stack_ready?(get_stack_name("vianello"))
|
1566
|
+
wait_for_stack_ready(get_stack_name("domus")) unless stack_ready?(get_stack_name("domus"))
|
1567
|
+
end
|
1445
1568
|
|
1446
1569
|
update_service_defaults(get_stack_name("web"))
|
1447
1570
|
update_service_defaults(get_stack_name("consumer-api"))
|
@@ -1463,6 +1586,10 @@ class Build
|
|
1463
1586
|
update_service_defaults(get_stack_name("starsky"))
|
1464
1587
|
update_service_defaults(get_stack_name("hutch"))
|
1465
1588
|
update_service_defaults(get_stack_name("crash"))
|
1589
|
+
if deploy_vianello_or_domus?
|
1590
|
+
update_service_defaults(get_stack_name("vianello"))
|
1591
|
+
update_service_defaults(get_stack_name("domus"))
|
1592
|
+
end
|
1466
1593
|
|
1467
1594
|
activia_hostname = get_route53_hostname("activia")
|
1468
1595
|
assange_hostname = get_route53_hostname("assange")
|
@@ -1484,6 +1611,8 @@ class Build
|
|
1484
1611
|
starsky_hostname = get_route53_hostname("starsky")
|
1485
1612
|
hutch_hostname = get_route53_hostname("hutch")
|
1486
1613
|
legion_hostname = get_route53_hostname("legion")
|
1614
|
+
vianello_hostname = get_route53_hostname("vianello")
|
1615
|
+
domus_hostname = get_route53_hostname("domus")
|
1487
1616
|
|
1488
1617
|
#launch_mimo(get_deploy_id)
|
1489
1618
|
|
@@ -1507,7 +1636,11 @@ class Build
|
|
1507
1636
|
> Legion url: http://#{legion_hostname}:8051
|
1508
1637
|
> Crash url: https://#{crash_hostname}
|
1509
1638
|
> Starsky url: https://#{starsky_hostname}
|
1510
|
-
> Hutch url: https://#{hutch_hostname}
|
1639
|
+
> Hutch url: https://#{hutch_hostname}"
|
1640
|
+
projects_text.concat "
|
1641
|
+
> Vianello url: https://#{vianello_hostname}
|
1642
|
+
> Domus url: https://#{domus_hostname}" if deploy_vianello_or_domus?
|
1643
|
+
projects_text.concat "
|
1511
1644
|
> RabbitMQ url: http://#{get_ec2_ip_address}:15672
|
1512
1645
|
> Elasticsearch url: http://#{get_ec2_ip_address}:9200
|
1513
1646
|
> Git branch: #{@git_branch}
|
@@ -1571,6 +1704,10 @@ class Build
|
|
1571
1704
|
host = "legion-#{get_deploy_id}.qa.colaster.com"
|
1572
1705
|
when project.include?('maia-intermediari')
|
1573
1706
|
host = "api-intermediari-#{get_deploy_id}.qa.colaster.com"
|
1707
|
+
when project.include?('vianello')
|
1708
|
+
host = "vianello-#{get_deploy_id}.qa.colaster.com"
|
1709
|
+
when project.include?('domus')
|
1710
|
+
host = "domus-#{get_deploy_id}.qa.colaster.com"
|
1574
1711
|
end
|
1575
1712
|
host
|
1576
1713
|
end
|
@@ -1632,6 +1769,10 @@ class Build
|
|
1632
1769
|
logical_resource_id = 'EcsApplicationLoadBalancerPublic'
|
1633
1770
|
when stack_name.include?('legion')
|
1634
1771
|
logical_resource_id = 'EcsApplicationLoadBalancerInternal'
|
1772
|
+
when stack_name.include?('vianello')
|
1773
|
+
logical_resource_id = 'EcsApplicationLoadBalancerInternal'
|
1774
|
+
when stack_name.include?('domus')
|
1775
|
+
logical_resource_id = 'EcsApplicationLoadBalancerPublic'
|
1635
1776
|
end
|
1636
1777
|
resp = describe_stack_resource(stack_name, logical_resource_id)
|
1637
1778
|
resp = describe_load_balancers([resp.stack_resource_detail.physical_resource_id])
|
@@ -1684,6 +1825,10 @@ class Build
|
|
1684
1825
|
logical_resource_id = 'ECSServiceMaia'
|
1685
1826
|
when stack_name.include?('legion')
|
1686
1827
|
logical_resource_id = 'ECSServiceLegionQA'
|
1828
|
+
when stack_name.include?('vianello')
|
1829
|
+
logical_resource_id = 'ECSServiceVianelloQA'
|
1830
|
+
when stack_name.include?('domus')
|
1831
|
+
logical_resource_id = 'ECSServiceDomus'
|
1687
1832
|
else
|
1688
1833
|
raise "Service name non gestito per lo stack #{stack_name}"
|
1689
1834
|
end
|
@@ -1762,6 +1907,12 @@ class Build
|
|
1762
1907
|
})
|
1763
1908
|
end
|
1764
1909
|
|
1910
|
+
def deploy_vianello_or_domus?
|
1911
|
+
vianello_present = !@projects['vianello'].empty? && @projects['vianello'][:name] != 'master' && !@projects['vianello'][:default_branch]
|
1912
|
+
domus_present = !@projects['domus'].empty? && @projects['domus'][:name] != 'master' && !@projects['domus'][:default_branch]
|
1913
|
+
vianello_present || domus_present
|
1914
|
+
end
|
1915
|
+
|
1765
1916
|
def git_checkout_version(project, revision)
|
1766
1917
|
Dir.chdir "projects/#{project}"
|
1767
1918
|
exec_step "git checkout -- . && git checkout #{revision}"
|
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.30
|
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-06-
|
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
|