prima-twig 0.44.15 → 0.45.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/twig-deploy +2 -1
- data/bin/twig-feature +81 -57
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b87cd2844f4baf2eded06e0fecfb0c7c78c2485555dd1e5e4dd982345ee0abc0
|
4
|
+
data.tar.gz: e22ac8615213cbf9a236c0e688e13fbdab05aec8af09117497af25178f47567a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8b6a42ab92414c9cef84116d7959aa532b22c302a21eb5f2d8944a969dcdc5bf0c4e7da971d7d8affe25c10d3d2c295dae15d54734ec941e8f1c39eb0790cba
|
7
|
+
data.tar.gz: 6e87475618bbcb40f09f40ca194ce6b08af481d9a50d856de9ce03e6c93e7c362754cf777a4c0cd888b03173e208fef0b4cab55fc466ddfa260a6ad54fbeaf13
|
data/bin/twig-deploy
CHANGED
@@ -188,12 +188,13 @@ class Review
|
|
188
188
|
artifacts = []
|
189
189
|
resp = @s3.list_objects(bucket: @s3_bucket, prefix: 'prima')
|
190
190
|
resp.contents.each do |l|
|
191
|
+
# aggiungiamo solo gli artefatti prodotti a partire dal branch master, riconosciuti tramite i metadata
|
191
192
|
rev = l.key.match(/^prima\/(\w{15}).tar.gz$/).captures.first if l.key.match(/^prima\/(\w{15}).tar.gz$/)
|
192
193
|
if rev
|
193
194
|
object = @s3.head_object(bucket: @s3_bucket, key: l.key)
|
194
195
|
commit_msg = ''
|
195
196
|
commit_msg = Base64.decode64(object.metadata['commit_msg']).strip if object.metadata.has_key? 'commit_msg'
|
196
|
-
artifacts << {rev: rev, created_at: object.last_modified, branch: object.metadata['branch'], commit_msg: commit_msg } if object.metadata.has_key? 'branch'
|
197
|
+
artifacts << {rev: rev, created_at: object.last_modified, branch: object.metadata['branch'], commit_msg: commit_msg } if (object.metadata.has_key? 'branch') && (object.metadata['branch'] == 'master')
|
197
198
|
end
|
198
199
|
end
|
199
200
|
artifacts.sort_by { |v| v[:created_at] }.reverse
|
data/bin/twig-feature
CHANGED
@@ -764,7 +764,7 @@ class Release
|
|
764
764
|
},
|
765
765
|
{
|
766
766
|
parameter_key: "ReleaseVersion",
|
767
|
-
parameter_value: "#{@projects["prima"][:revision]}
|
767
|
+
parameter_value: "#{@projects["prima"][:revision]}"
|
768
768
|
},
|
769
769
|
{
|
770
770
|
parameter_key: "TaskDesiredCount",
|
@@ -797,6 +797,22 @@ class Release
|
|
797
797
|
{
|
798
798
|
parameter_key: "EnvHash",
|
799
799
|
parameter_value: deploy_id
|
800
|
+
},
|
801
|
+
{
|
802
|
+
parameter_key: "AssangeHostname",
|
803
|
+
parameter_value: "assange-#{@dns_record_identifier}.qa.colaster.com"
|
804
|
+
},
|
805
|
+
{
|
806
|
+
parameter_key: "BackofficeHostname",
|
807
|
+
parameter_value: "backoffice-#{@dns_record_identifier}.qa.colaster.com"
|
808
|
+
},
|
809
|
+
{
|
810
|
+
parameter_key: "WebHostname",
|
811
|
+
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
812
|
+
},
|
813
|
+
{
|
814
|
+
parameter_key: "WebRiHostname",
|
815
|
+
parameter_value: "wwwri-#{@dns_record_identifier}.qa.colaster.com"
|
800
816
|
}
|
801
817
|
]
|
802
818
|
if stack_exists?(stack_name_web)
|
@@ -983,7 +999,7 @@ class Release
|
|
983
999
|
]
|
984
1000
|
create_stack(stack_name_db, stack_body, parameters, tags, @cf_role) unless stack_exists?(stack_name_db) # creazione asincrona stack dei db (~4 min)
|
985
1001
|
|
986
|
-
create_prima_artifact(@projects["prima"][:revision], @projects["prima"][:name]
|
1002
|
+
create_prima_artifact(@projects["prima"][:revision], @projects["prima"][:name]) unless artifact_exists?('prima-artifacts-encrypted', "prima/#{@projects["prima"][:revision]}.tar.gz")
|
987
1003
|
# l'artefatto di prima viene creato sempre (puntamenti all'ambiente compilati nel js) e richiede molto più di 4 minuti
|
988
1004
|
wait_for_stack_ready(stack_name_db) unless stack_ready?(stack_name_db) # dovrebbe essere istantaneo
|
989
1005
|
db_task = ''
|
@@ -1337,11 +1353,11 @@ class Release
|
|
1337
1353
|
},
|
1338
1354
|
{
|
1339
1355
|
parameter_key: "WebHost",
|
1340
|
-
parameter_value:
|
1356
|
+
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
1341
1357
|
},
|
1342
1358
|
{
|
1343
1359
|
parameter_key: "AssangeHost",
|
1344
|
-
parameter_value:
|
1360
|
+
parameter_value: "assange-#{@dns_record_identifier}.qa.colaster.com"
|
1345
1361
|
}
|
1346
1362
|
]
|
1347
1363
|
if stack_exists?(stack_name_peano)
|
@@ -1417,11 +1433,11 @@ class Release
|
|
1417
1433
|
},
|
1418
1434
|
{
|
1419
1435
|
parameter_key: "WebHost",
|
1420
|
-
parameter_value:
|
1436
|
+
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
1421
1437
|
},
|
1422
1438
|
{
|
1423
1439
|
parameter_key: "AssangeHost",
|
1424
|
-
parameter_value:
|
1440
|
+
parameter_value: "assange-#{@dns_record_identifier}.qa.colaster.com"
|
1425
1441
|
}
|
1426
1442
|
]
|
1427
1443
|
if stack_exists?(stack_name_assange)
|
@@ -1583,7 +1599,7 @@ class Release
|
|
1583
1599
|
},
|
1584
1600
|
{
|
1585
1601
|
parameter_key: "ReleaseVersion",
|
1586
|
-
parameter_value: "#{@projects["prima"][:revision]}
|
1602
|
+
parameter_value: "#{@projects["prima"][:revision]}"
|
1587
1603
|
},
|
1588
1604
|
{
|
1589
1605
|
parameter_key: "TaskDesiredCount",
|
@@ -1616,6 +1632,22 @@ class Release
|
|
1616
1632
|
{
|
1617
1633
|
parameter_key: "EnvHash",
|
1618
1634
|
parameter_value: deploy_id
|
1635
|
+
},
|
1636
|
+
{
|
1637
|
+
parameter_key: "AssangeHostname",
|
1638
|
+
parameter_value: "assange-#{@dns_record_identifier}.qa.colaster.com"
|
1639
|
+
},
|
1640
|
+
{
|
1641
|
+
parameter_key: "BackofficeHostname",
|
1642
|
+
parameter_value: "backoffice-#{@dns_record_identifier}.qa.colaster.com"
|
1643
|
+
},
|
1644
|
+
{
|
1645
|
+
parameter_key: "WebHostname",
|
1646
|
+
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
1647
|
+
},
|
1648
|
+
{
|
1649
|
+
parameter_key: "WebRiHostname",
|
1650
|
+
parameter_value: "wwwri-#{@dns_record_identifier}.qa.colaster.com"
|
1619
1651
|
}
|
1620
1652
|
]
|
1621
1653
|
if stack_exists?(stack_name_web)
|
@@ -1635,7 +1667,7 @@ class Release
|
|
1635
1667
|
},
|
1636
1668
|
{
|
1637
1669
|
parameter_key: "ReleaseVersion",
|
1638
|
-
parameter_value: "#{@projects["prima"][:revision]}
|
1670
|
+
parameter_value: "#{@projects["prima"][:revision]}"
|
1639
1671
|
},
|
1640
1672
|
{
|
1641
1673
|
parameter_key: "ECSClusterName",
|
@@ -1644,6 +1676,22 @@ class Release
|
|
1644
1676
|
{
|
1645
1677
|
parameter_key: "NginxHttpHost",
|
1646
1678
|
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
1679
|
+
},
|
1680
|
+
{
|
1681
|
+
parameter_key: "AssangeHostname",
|
1682
|
+
parameter_value: "assange-#{@dns_record_identifier}.qa.colaster.com"
|
1683
|
+
},
|
1684
|
+
{
|
1685
|
+
parameter_key: "BackofficeHostname",
|
1686
|
+
parameter_value: "backoffice-#{@dns_record_identifier}.qa.colaster.com"
|
1687
|
+
},
|
1688
|
+
{
|
1689
|
+
parameter_key: "WebHostname",
|
1690
|
+
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
1691
|
+
},
|
1692
|
+
{
|
1693
|
+
parameter_key: "WebRiHostname",
|
1694
|
+
parameter_value: "wwwri-#{@dns_record_identifier}.qa.colaster.com"
|
1647
1695
|
}
|
1648
1696
|
]
|
1649
1697
|
if stack_exists?(stack_name_consumer)
|
@@ -1790,6 +1838,8 @@ class Release
|
|
1790
1838
|
host = "skynet-#{@dns_record_identifier}.qa.colaster.com"
|
1791
1839
|
when stack_name.include?('roger')
|
1792
1840
|
host = "roger-#{@dns_record_identifier}.qa.colaster.com"
|
1841
|
+
when stack_name.include?('webri')
|
1842
|
+
host = "wwwri-#{@dns_record_identifier}.qa.colaster.com"
|
1793
1843
|
end
|
1794
1844
|
host
|
1795
1845
|
end
|
@@ -2475,22 +2525,10 @@ class Release
|
|
2475
2525
|
|
2476
2526
|
Dir.chdir 'projects/borat'
|
2477
2527
|
|
2478
|
-
|
2479
|
-
|
2480
|
-
|
2481
|
-
|
2482
|
-
docker_container = "web"
|
2483
|
-
app_name = "borat"
|
2484
|
-
end
|
2485
|
-
|
2486
|
-
stack_name_web = "ecs-task-web-qa-notneeded"
|
2487
|
-
web_qa_host = get_route53_hostname(stack_name_web)
|
2488
|
-
stack_name_assange = "ecs-task-assange-qa-notneeded"
|
2489
|
-
assange_qa_host = get_route53_hostname(stack_name_assange)
|
2490
|
-
stack_name_peano = "ecs-task-peano-qa-notneeded"
|
2491
|
-
peano_qa_host = "#{get_route53_hostname(stack_name_peano)}:10039"
|
2492
|
-
stack_name_borat = "ecs-task-borat-qa-notneeded"
|
2493
|
-
borat_qa_host = get_route53_hostname(stack_name_borat)
|
2528
|
+
web_qa_host = "www-#{@dns_record_identifier}.qa.colaster.com"
|
2529
|
+
assange_qa_host = "assange-#{@dns_record_identifier}.qa.colaster.com"
|
2530
|
+
peano_qa_host = "peano-#{@dns_record_identifier}.qa.colaster.com"
|
2531
|
+
borat_qa_host = "backoffice-#{@dns_record_identifier}.qa.colaster.com"
|
2494
2532
|
|
2495
2533
|
ws_endpoint = "wss://#{borat_qa_host}/socket/websocket?vsn=1.0.0"
|
2496
2534
|
frontend_endpoint = "https://#{web_qa_host}/"
|
@@ -2506,8 +2544,8 @@ class Release
|
|
2506
2544
|
exec_step 'prepare-docker-compose --directory borat && cp docker-compose-qainit.yml docker-compose.yml'
|
2507
2545
|
[
|
2508
2546
|
"docker network create borat_network || true",
|
2509
|
-
"docker-compose build
|
2510
|
-
"docker-compose run -w $PWD -u root -e WS_ENDPOINT=#{ws_endpoint} -e FRONTEND=#{frontend_endpoint} -e GRAPHQL_ENDPOINT=#{graphiql_endpoint} -e AUTH_ENDPOINT=#{auth_endpoint} -e MIX_ENV=qa --entrypoint /bin/sh
|
2547
|
+
"docker-compose build web",
|
2548
|
+
"docker-compose run -w $PWD -u root -e WS_ENDPOINT=#{ws_endpoint} -e FRONTEND=#{frontend_endpoint} -e GRAPHQL_ENDPOINT=#{graphiql_endpoint} -e AUTH_ENDPOINT=#{auth_endpoint} -e MIX_ENV=qa --entrypoint /bin/sh web \
|
2511
2549
|
'-c' 'sed -i \"s/web-qa-host/#{web_qa_host}/g\" config/qa.exs && \
|
2512
2550
|
sed -i \"s/assange-qa-host/#{assange_qa_host}/g\" config/qa.exs && \
|
2513
2551
|
sed -i \"s/peano-qa-host/#{peano_qa_host}/g\" config/qa.exs && \
|
@@ -2531,8 +2569,8 @@ class Release
|
|
2531
2569
|
else
|
2532
2570
|
[
|
2533
2571
|
"docker network create borat_network || true",
|
2534
|
-
"docker-compose build
|
2535
|
-
"docker run -v $PWD:/code -w /code -e WS_ENDPOINT=#{ws_endpoint} -e FRONTEND=#{frontend_endpoint} -e GRAPHQL_ENDPOINT=#{graphiql_endpoint} -e MIX_ENV=qa --entrypoint /bin/sh
|
2572
|
+
"docker-compose build web",
|
2573
|
+
"docker run -v $PWD:/code -w /code -e WS_ENDPOINT=#{ws_endpoint} -e FRONTEND=#{frontend_endpoint} -e GRAPHQL_ENDPOINT=#{graphiql_endpoint} -e AUTH_ENDPOINT=#{auth_endpoint} -e MIX_ENV=qa --entrypoint /bin/sh web \
|
2536
2574
|
'-c' 'sed -i \"s/web-qa-host/#{web_qa_host}/g\" config/qa.exs && \
|
2537
2575
|
sed -i \"s/assange-qa-host/#{assange_qa_host}/g\" config/qa.exs && \
|
2538
2576
|
sed -i \"s/peano-qa-host/#{peano_qa_host}/g\" config/qa.exs && \
|
@@ -2553,11 +2591,7 @@ class Release
|
|
2553
2591
|
end
|
2554
2592
|
end
|
2555
2593
|
|
2556
|
-
|
2557
|
-
artifact_path = Dir.glob("_build/qa/rel/#{app_name}/releases/*/#{app_name}.tar.gz").first
|
2558
|
-
else
|
2559
|
-
artifact_path = Dir.glob("_build/qa/rel/#{app_name}/releases/*/#{app_name}.tar.gz").first
|
2560
|
-
end
|
2594
|
+
artifact_path = Dir.glob("_build/qa/rel/borat/releases/*/borat.tar.gz").first
|
2561
2595
|
upload_artifact(artifact_path, "microservices/borat/#{revision}-#{deploy_id}-qa.tar.gz", "#{@s3_bucket}-encrypted")
|
2562
2596
|
|
2563
2597
|
Dir.chdir '../../'
|
@@ -2581,7 +2615,7 @@ class Release
|
|
2581
2615
|
Dir.chdir '../../'
|
2582
2616
|
end
|
2583
2617
|
|
2584
|
-
def create_prima_artifact(revision, branch_name,
|
2618
|
+
def create_prima_artifact(revision, branch_name, minimal = false)
|
2585
2619
|
# @projects["prima"][:revision], @projects["prima"][:name], deploy_id, true
|
2586
2620
|
output "Preparo l'artifact prima .zip\n".yellow
|
2587
2621
|
|
@@ -2597,33 +2631,23 @@ class Release
|
|
2597
2631
|
end
|
2598
2632
|
end
|
2599
2633
|
|
2600
|
-
backoffice_qa_host = get_route53_hostname("ecs-task-borat-qa-notneeded")
|
2601
|
-
# backoffice-staging.prima.it
|
2602
|
-
web_qa_host = get_route53_hostname("ecs-task-web-qa-notneeded")
|
2603
|
-
# staging.prima.it
|
2604
|
-
assange_qa_host = get_route53_hostname("ecs-task-assange-qa-notneeded")
|
2605
|
-
# assange-staging.prima.it
|
2606
|
-
if minimal
|
2607
|
-
|
2608
|
-
|
2609
|
-
end
|
2634
|
+
# backoffice_qa_host = get_route53_hostname("ecs-task-borat-qa-notneeded")
|
2635
|
+
# # backoffice-staging.prima.it
|
2636
|
+
# web_qa_host = get_route53_hostname("ecs-task-web-qa-notneeded")
|
2637
|
+
# # staging.prima.it
|
2638
|
+
# assange_qa_host = get_route53_hostname("ecs-task-assange-qa-notneeded")
|
2639
|
+
# # assange-staging.prima.it
|
2640
|
+
# if minimal
|
2641
|
+
# backoffice_qa_host = 'backoffice-staging.prima.it'
|
2642
|
+
# assange_qa_host = 'assange-staging.prima.it'
|
2643
|
+
# end
|
2610
2644
|
|
2611
|
-
if
|
2612
|
-
output "Minimal prima artifact".green
|
2613
|
-
exec_step 'mv docker-compose-ci.yml docker-compose.yml'
|
2614
|
-
exec_step 'prepare-docker-compose --directory prima'
|
2615
|
-
exec_step 'sed -i "s/\\/home\\/app/\\/root/g" docker-compose.yml'
|
2616
|
-
[
|
2617
|
-
"bin/minimal_local_build_artifact.sh #{branch_name} #{web_qa_host} #{backoffice_qa_host} #{assange_qa_host} #{deploy_id} #{'update' if @deploy_update}"
|
2618
|
-
].each do |cmd|
|
2619
|
-
execute_command cmd
|
2620
|
-
end
|
2621
|
-
elsif @qainit
|
2645
|
+
if @qainit
|
2622
2646
|
exec_step 'mv docker-compose-ci.yml docker-compose.yml'
|
2623
2647
|
exec_step 'prepare-docker-compose --directory prima'
|
2624
2648
|
exec_step 'sed -i "s/\\/home\\/app/\\/root/g" docker-compose.yml'
|
2625
2649
|
[
|
2626
|
-
"bin/qa_build_artifact.sh #{branch_name} #{
|
2650
|
+
"bin/qa_build_artifact.sh #{branch_name} #{'update' if @deploy_update}"
|
2627
2651
|
].each do |cmd|
|
2628
2652
|
execute_command cmd
|
2629
2653
|
end
|
@@ -2631,7 +2655,7 @@ class Release
|
|
2631
2655
|
cleanup_containers
|
2632
2656
|
else
|
2633
2657
|
[
|
2634
|
-
"bin/local_build_artifact.sh #{branch_name} #{
|
2658
|
+
"bin/local_build_artifact.sh #{branch_name} #{'update' if @deploy_update}"
|
2635
2659
|
].each do |cmd|
|
2636
2660
|
execute_command cmd
|
2637
2661
|
end
|