prima-twig 0.37.16 → 0.38.00
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/twig-feature +64 -172
- 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: 8f10b7177cda767228a175a7071fbc0208584abeec9f9cc0a1b561e2ef393b75
|
4
|
+
data.tar.gz: 489e49c285c9f411326ee8620ea10cf191f4c36076f9021e2a56d9f23c79c843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df3e46b7849d952f10c239ab0457016b95a025b2170d58710b1fba8f68a0ab1136bd0b153bbb85790092ec7483ec7d3f22e50defb1e9ce9c544d163b0145c9bd
|
7
|
+
data.tar.gz: ae9c2b5dd598cd6fe1501a9815986ace2bf4b0b25d6eb8b717eaa0e3ffc8561a9e92653d07cad0ed79661c3cb73d9f74d4db6a1e447d5a333fe8a984d41711ae
|
data/bin/twig-feature
CHANGED
@@ -45,12 +45,11 @@ class Release
|
|
45
45
|
'rogoreport' => {},
|
46
46
|
'assange' => {},
|
47
47
|
'borat' => {},
|
48
|
-
'bolla' => {},
|
49
48
|
'crash' => {},
|
50
49
|
'activia' => {}
|
51
50
|
}
|
52
|
-
@
|
53
|
-
@
|
51
|
+
@base_stack_name_alb = 'ecs-alb-http-public-qa-'
|
52
|
+
@base_stack_name_alb_ws = 'ecs-alb-ws-public-qa-'
|
54
53
|
end
|
55
54
|
|
56
55
|
def execute!(args)
|
@@ -125,9 +124,6 @@ class Release
|
|
125
124
|
|
126
125
|
output "Recupero le informazioni relative al puntamento dei record DNS..."
|
127
126
|
cloudflare = Rubyflare.connect_with(@prima.config['cloudflare_email'], @prima.config['cloudflare_apikey'])
|
128
|
-
dns_records = cloudflare.get("zones/1fb634f19c43dfb0162cc4cb91915da2/dns_records", {per_page: 100, type: 'CNAME', content: get_alb_host(@stack_name_alb)})
|
129
|
-
stop_if dns_records.body[:result].empty?, "I record DNS degli aggregatori non stanno puntando ad un QA".red
|
130
|
-
|
131
127
|
output "Recupero le informazioni sui QA attivi..."
|
132
128
|
stack_list, envs = get_stacks()
|
133
129
|
|
@@ -139,8 +135,10 @@ class Release
|
|
139
135
|
end.is_a?(Aws::CloudFormation::Types::Tag)
|
140
136
|
aggregator_enabled
|
141
137
|
end[0]
|
138
|
+
dns_records = cloudflare.get("zones/1fb634f19c43dfb0162cc4cb91915da2/dns_records", {per_page: 100, type: 'CNAME', content: get_alb_host(@base_stack_name_alb + env_hash[3..8])})
|
139
|
+
stop_if dns_records.body[:result].empty?, "I record DNS degli aggregatori non stanno puntando ad un QA".red
|
142
140
|
change_hostname_priority(env_hash, hostname_pattern_priority())
|
143
|
-
dns_to_staging()
|
141
|
+
dns_to_staging(env_hash)
|
144
142
|
else
|
145
143
|
output 'Nessun QA trovato'.red
|
146
144
|
exit
|
@@ -184,7 +182,7 @@ class Release
|
|
184
182
|
dns_records.body[:result].each do |dns|
|
185
183
|
if dns[:name] =~ /^\w+\-\w+\-staging\.prima\.it$/
|
186
184
|
output "Changing #{dns[:name]} DNS record"
|
187
|
-
cloudflare.put("zones/1fb634f19c43dfb0162cc4cb91915da2/dns_records/#{dns[:id]}", {type: 'CNAME', name: dns[:name], content: get_alb_host(@
|
185
|
+
cloudflare.put("zones/1fb634f19c43dfb0162cc4cb91915da2/dns_records/#{dns[:id]}", {type: 'CNAME', name: dns[:name], content: get_alb_host(@base_stack_name_alb + env_hash[3..8]), proxied: true, ttl: 1})
|
188
186
|
end
|
189
187
|
end
|
190
188
|
|
@@ -241,10 +239,10 @@ class Release
|
|
241
239
|
wait_for_stack_ready(stack_name_web) unless stack_ready?(stack_name_web)
|
242
240
|
end
|
243
241
|
|
244
|
-
def dns_to_staging
|
242
|
+
def dns_to_staging(env_hash)
|
245
243
|
output "Recupero le informazioni relative al puntamento dei record DNS..."
|
246
244
|
cloudflare = Rubyflare.connect_with(@prima.config['cloudflare_email'], @prima.config['cloudflare_apikey'])
|
247
|
-
dns_records = cloudflare.get("zones/1fb634f19c43dfb0162cc4cb91915da2/dns_records", {per_page: 100, type: 'CNAME', content: get_alb_host(@
|
245
|
+
dns_records = cloudflare.get("zones/1fb634f19c43dfb0162cc4cb91915da2/dns_records", {per_page: 100, type: 'CNAME', content: get_alb_host(@base_stack_name_alb + env_hash[3..8])})
|
248
246
|
dns_records.body[:result].each do |dns|
|
249
247
|
if dns[:name] =~ /^\w+\-\w+\-staging\.prima\.it$/
|
250
248
|
output "Changing #{dns[:name]} DNS record"
|
@@ -316,7 +314,7 @@ class Release
|
|
316
314
|
end.is_a?(Aws::CloudFormation::Types::Tag)
|
317
315
|
|
318
316
|
if aggregator_enabled
|
319
|
-
dns_to_staging()
|
317
|
+
dns_to_staging(env_hash)
|
320
318
|
end
|
321
319
|
|
322
320
|
# Se non ha finito di cancellare le altre non si puo' cancellare il cluster
|
@@ -331,8 +329,8 @@ class Release
|
|
331
329
|
end
|
332
330
|
|
333
331
|
delete_stack(cluster_stack_name)
|
334
|
-
delete_stack(@
|
335
|
-
delete_stack(@
|
332
|
+
delete_stack(@base_stack_name_alb + env_hash[3..8])
|
333
|
+
delete_stack(@base_stack_name_alb_ws + env_hash[3..8])
|
336
334
|
output "Finito!".green
|
337
335
|
end
|
338
336
|
|
@@ -524,7 +522,7 @@ class Release
|
|
524
522
|
output "Recupero le informazioni sui QA attivi..."
|
525
523
|
stack_list, envs = get_stacks
|
526
524
|
|
527
|
-
env_hash = calculate_deploy_id
|
525
|
+
env_hash = "qa-" + calculate_deploy_id
|
528
526
|
|
529
527
|
cluster_stack_name = nil
|
530
528
|
stacks_to_delete = []
|
@@ -540,13 +538,13 @@ class Release
|
|
540
538
|
end
|
541
539
|
end
|
542
540
|
|
543
|
-
cluster_stack_name = "ecs-cluster
|
541
|
+
cluster_stack_name = "ecs-cluster-#{env_hash}"
|
544
542
|
aggregator_enabled = get_stack_tags(cluster_stack_name).detect do |tag|
|
545
543
|
tag.key === "hostname_pattern_priority" and tag.value === "1"
|
546
544
|
end.is_a?(Aws::CloudFormation::Types::Tag)
|
547
545
|
|
548
546
|
if aggregator_enabled
|
549
|
-
dns_to_staging()
|
547
|
+
dns_to_staging(env_hash)
|
550
548
|
end
|
551
549
|
|
552
550
|
# Se non ha finito di cancellare le altre non si puo' cancellare il cluster
|
@@ -561,8 +559,8 @@ class Release
|
|
561
559
|
end
|
562
560
|
|
563
561
|
delete_stack(cluster_stack_name)
|
564
|
-
delete_stack(@
|
565
|
-
delete_stack(@
|
562
|
+
delete_stack(@base_stack_name_alb + env_hash[3..8])
|
563
|
+
delete_stack(@base_stack_name_alb_ws + env_hash[3..8])
|
566
564
|
`git checkout master && git push origin --delete ${DRONE_BRANCH}`
|
567
565
|
output "Finito!".green
|
568
566
|
|
@@ -600,12 +598,13 @@ class Release
|
|
600
598
|
|
601
599
|
def get_s3_config_files
|
602
600
|
# manteniamo la struttura per lanciarlo facilmente anche da locale
|
603
|
-
|
604
|
-
|
605
|
-
@s3.get_object({bucket:
|
606
|
-
@s3.get_object({bucket: "prima-deploy", key: 'cloudformation/stacks/
|
607
|
-
@s3.get_object({bucket: "prima-deploy", key: 'cloudformation/stacks/ecs-
|
608
|
-
@s3.get_object({bucket: "prima-deploy", key: 'cloudformation/stacks/
|
601
|
+
# TODO: cambiare di nuovo con prima-deploy
|
602
|
+
`mkdir -p cloudformation/stacks/task cloudformation/stacks/route53 cloudformation/stacks/asg cloudformation/stacks/elb`
|
603
|
+
@s3.get_object({bucket: "prima-deploy-test", key: 'cloudformation/stacks/task/db.yml', response_target: 'cloudformation/stacks/task/db.yml'})
|
604
|
+
@s3.get_object({bucket: "prima-deploy-test", key: 'cloudformation/stacks/route53/qa.yml', response_target: 'cloudformation/stacks/route53/qa.yml'})
|
605
|
+
@s3.get_object({bucket: "prima-deploy-test", key: 'cloudformation/stacks/asg/ecs-asg-allinone.yml', response_target: 'cloudformation/stacks/asg/ecs-asg-allinone.yml'})
|
606
|
+
@s3.get_object({bucket: "prima-deploy-test", key: 'cloudformation/stacks/ecs-cluster.yml', response_target: 'cloudformation/stacks/ecs-cluster.yml'})
|
607
|
+
@s3.get_object({bucket: "prima-deploy-test", key: 'cloudformation/stacks/elb/ecs-alb-public.yml', response_target: 'cloudformation/stacks/elb/alb-public-qa.yml'})
|
609
608
|
end
|
610
609
|
|
611
610
|
def calculate_deploy_id
|
@@ -622,7 +621,6 @@ class Release
|
|
622
621
|
@projects["rogoreport"][:name] +
|
623
622
|
@projects["assange"][:name] +
|
624
623
|
@projects["borat"][:name] +
|
625
|
-
@projects["bolla"][:name] +
|
626
624
|
@projects['crash'][:name] +
|
627
625
|
@projects["activia"][:name]
|
628
626
|
)
|
@@ -639,7 +637,6 @@ class Release
|
|
639
637
|
@projects["rogoreport"][:name] +
|
640
638
|
@projects["assange"][:name] +
|
641
639
|
@projects["borat"][:name] +
|
642
|
-
@projects["bolla"][:name] +
|
643
640
|
@projects["activia"][:name]
|
644
641
|
)
|
645
642
|
end
|
@@ -648,6 +645,8 @@ class Release
|
|
648
645
|
def deploy_feature!
|
649
646
|
`git pull && git submodule init && git submodule update`
|
650
647
|
deploy_id = calculate_deploy_id
|
648
|
+
stack_name_alb = 'ecs-alb-http-public-qa-' + deploy_id[0..5]
|
649
|
+
stack_name_alb_ws = 'ecs-alb-ws-public-qa-' + deploy_id[0..5]
|
651
650
|
unless @qainit
|
652
651
|
@projects.each_key do |project_key|
|
653
652
|
if @projects[project_key][:revision]
|
@@ -706,10 +705,6 @@ class Release
|
|
706
705
|
key: "borat",
|
707
706
|
value: @projects["borat"][:name]
|
708
707
|
},
|
709
|
-
{
|
710
|
-
key: "bolla",
|
711
|
-
value: @projects["bolla"][:name]
|
712
|
-
},
|
713
708
|
{
|
714
709
|
key: "activia",
|
715
710
|
value: @projects["activia"][:name]
|
@@ -729,8 +724,8 @@ class Release
|
|
729
724
|
create_cluster_stack(cluster_stack_name, tags) unless stack_exists?(cluster_stack_name)
|
730
725
|
wait_for_stack_ready(cluster_stack_name) unless stack_ready?(cluster_stack_name)
|
731
726
|
|
732
|
-
create_alb_stack(
|
733
|
-
create_alb_stack(
|
727
|
+
create_alb_stack(stack_name_alb, "http", deploy_id) unless stack_exists?(stack_name_alb)
|
728
|
+
create_alb_stack(stack_name_alb_ws, "websocket", deploy_id) unless stack_exists?(stack_name_alb_ws)
|
734
729
|
|
735
730
|
resp = @cf.describe_stack_resource({stack_name: cluster_stack_name, logical_resource_id: 'ECSCluster'})
|
736
731
|
@ecs_cluster_name = resp.stack_resource_detail.physical_resource_id
|
@@ -764,16 +759,15 @@ class Release
|
|
764
759
|
create_rogoreport_artifact(@projects["rogoreport"][:revision], deploy_id) unless artifact_exists?('prima-artifacts-encrypted', "microservices/rogoreport/rogoreport_qa-#{@projects["rogoreport"][:revision]}-#{deploy_id}-qa.tar.gz")
|
765
760
|
create_assange_artifact(@projects["assange"][:revision], deploy_id) unless artifact_exists?('prima-artifacts-encrypted', "microservices/assange/#{@projects["assange"][:revision]}-#{deploy_id}-qa.tar.gz")
|
766
761
|
create_borat_artifact(@projects["borat"][:revision], deploy_id) unless artifact_exists?('prima-artifacts-encrypted', "microservices/borat/#{@projects["borat"][:revision]}-#{deploy_id}-qa.tar.gz")
|
767
|
-
create_bolla_artifact(@projects["bolla"][:revision], deploy_id) unless artifact_exists?('prima-artifacts-encrypted', "microservices/bolla/#{@projects["bolla"][:revision]}-#{deploy_id}-qa-migrator.tar.gz")
|
768
762
|
create_activia_artifact(@projects["activia"][:revision], deploy_id) unless artifact_exists?('prima-artifacts-encrypted', "microservices/activia/#{@projects["activia"][:revision]}-#{deploy_id}-qa.tar.gz")
|
769
763
|
|
770
764
|
wait_for_stack_ready(stack_name_db) unless stack_ready?(stack_name_db)
|
771
|
-
import_dbs(ec2_ip_address(asg_stack_name)) unless stack_exists?("ecs-
|
765
|
+
import_dbs(ec2_ip_address(asg_stack_name)) unless stack_exists?("ecs-route53-qa-#{deploy_id}")
|
772
766
|
|
773
767
|
import_redis_crash(ec2_ip_address(asg_stack_name)) if deploy_crash? && !stack_exists?("ecs-task-web-qa-#{deploy_id}")
|
774
768
|
|
775
|
-
wait_for_stack_ready(
|
776
|
-
wait_for_stack_ready(
|
769
|
+
wait_for_stack_ready(stack_name_alb) unless stack_ready?(stack_name_alb)
|
770
|
+
wait_for_stack_ready(stack_name_alb_ws) unless stack_ready?(stack_name_alb_ws)
|
777
771
|
|
778
772
|
stack_name_route53 = "ecs-route53-qa-#{deploy_id}"
|
779
773
|
stack_body = IO.read('cloudformation/stacks/route53/qa.yml')
|
@@ -784,11 +778,11 @@ class Release
|
|
784
778
|
},
|
785
779
|
{
|
786
780
|
parameter_key: "PrimaElbHostname",
|
787
|
-
parameter_value: get_alb_host(
|
781
|
+
parameter_value: get_alb_host(stack_name_alb)
|
788
782
|
},
|
789
783
|
{
|
790
784
|
parameter_key: "BackofficeElbHostname",
|
791
|
-
parameter_value: get_alb_host(
|
785
|
+
parameter_value: get_alb_host(stack_name_alb)
|
792
786
|
},
|
793
787
|
{
|
794
788
|
parameter_key: "UraniaIp",
|
@@ -824,15 +818,15 @@ class Release
|
|
824
818
|
},
|
825
819
|
{
|
826
820
|
parameter_key: "AssangeElbHostname",
|
827
|
-
parameter_value: get_alb_host(
|
821
|
+
parameter_value: get_alb_host(stack_name_alb)
|
828
822
|
},
|
829
823
|
{
|
830
824
|
parameter_key: "BoratElbHostname",
|
831
|
-
parameter_value: get_alb_host(
|
825
|
+
parameter_value: get_alb_host(stack_name_alb_ws)
|
832
826
|
},
|
833
827
|
{
|
834
828
|
parameter_key: 'CrashElbHostname',
|
835
|
-
parameter_value: get_alb_host(
|
829
|
+
parameter_value: get_alb_host(stack_name_alb_ws)
|
836
830
|
}
|
837
831
|
]
|
838
832
|
|
@@ -859,10 +853,6 @@ class Release
|
|
859
853
|
parameter_key: "ECSClusterName",
|
860
854
|
parameter_value: @ecs_cluster_name
|
861
855
|
},
|
862
|
-
{
|
863
|
-
parameter_key: "ALBShortName",
|
864
|
-
parameter_value: "urania-qa-#{deploy_id}"[0..31]
|
865
|
-
},
|
866
856
|
{
|
867
857
|
parameter_key: "HostnamePattern",
|
868
858
|
parameter_value: "urania-#{@dns_record_identifier}.qa.colaster.com"
|
@@ -899,10 +889,6 @@ class Release
|
|
899
889
|
parameter_key: "ECSClusterName",
|
900
890
|
parameter_value: @ecs_cluster_name
|
901
891
|
},
|
902
|
-
{
|
903
|
-
parameter_key: "ALBShortName",
|
904
|
-
parameter_value: "ermes-qa-#{deploy_id}"[0..31]
|
905
|
-
},
|
906
892
|
{
|
907
893
|
parameter_key: "HostnamePattern",
|
908
894
|
parameter_value: "ermes-#{@dns_record_identifier}.qa.colaster.com"
|
@@ -939,10 +925,6 @@ class Release
|
|
939
925
|
parameter_key: "TaskDesiredCount",
|
940
926
|
parameter_value: "1"
|
941
927
|
},
|
942
|
-
{
|
943
|
-
parameter_key: "ALBShortName",
|
944
|
-
parameter_value: "bburago-qa-#{deploy_id}"[0..31]
|
945
|
-
},
|
946
928
|
{
|
947
929
|
parameter_key: "HostnamePattern",
|
948
930
|
parameter_value: "bburago-#{@dns_record_identifier}.qa.colaster.com"
|
@@ -979,10 +961,6 @@ class Release
|
|
979
961
|
parameter_key: "TaskDesiredCount",
|
980
962
|
parameter_value: "1"
|
981
963
|
},
|
982
|
-
{
|
983
|
-
parameter_key: "ALBShortName",
|
984
|
-
parameter_value: "hal9000-qa-#{deploy_id}"[0..31]
|
985
|
-
},
|
986
964
|
{
|
987
965
|
parameter_key: "HostnamePattern",
|
988
966
|
parameter_value: "hal9000-#{@dns_record_identifier}.qa.colaster.com"
|
@@ -1019,10 +997,6 @@ class Release
|
|
1019
997
|
parameter_key: "TaskDesiredCount",
|
1020
998
|
parameter_value: "1"
|
1021
999
|
},
|
1022
|
-
{
|
1023
|
-
parameter_key: "ALBShortName",
|
1024
|
-
parameter_value: "fidaty-qa-#{deploy_id}"[0..31]
|
1025
|
-
},
|
1026
1000
|
{
|
1027
1001
|
parameter_key: "HostnamePattern",
|
1028
1002
|
parameter_value: "fidaty-#{@dns_record_identifier}.qa.colaster.com"
|
@@ -1059,10 +1033,6 @@ class Release
|
|
1059
1033
|
parameter_key: "TaskDesiredCount",
|
1060
1034
|
parameter_value: "1"
|
1061
1035
|
},
|
1062
|
-
{
|
1063
|
-
parameter_key: "ALBShortName",
|
1064
|
-
parameter_value: "peano-qa-#{deploy_id}"[0..31]
|
1065
|
-
},
|
1066
1036
|
{
|
1067
1037
|
parameter_key: "HostnamePattern",
|
1068
1038
|
parameter_value: "peano-#{@dns_record_identifier}.qa.colaster.com"
|
@@ -1138,6 +1108,10 @@ class Release
|
|
1138
1108
|
{
|
1139
1109
|
parameter_key: "HostnamePatternPriority",
|
1140
1110
|
parameter_value: (hostname_pattern_priority.to_i + 20).to_s
|
1111
|
+
},
|
1112
|
+
{
|
1113
|
+
parameter_key: "EnvHash",
|
1114
|
+
parameter_value: deploy_id
|
1141
1115
|
}
|
1142
1116
|
]
|
1143
1117
|
if stack_exists?(stack_name_assange)
|
@@ -1178,6 +1152,10 @@ class Release
|
|
1178
1152
|
{
|
1179
1153
|
parameter_key: "HostnamePatternPriority",
|
1180
1154
|
parameter_value: (hostname_pattern_priority.to_i + 30).to_s
|
1155
|
+
},
|
1156
|
+
{
|
1157
|
+
parameter_key: "EnvHash",
|
1158
|
+
parameter_value: deploy_id
|
1181
1159
|
}
|
1182
1160
|
]
|
1183
1161
|
if stack_exists?(stack_name_borat)
|
@@ -1218,6 +1196,10 @@ class Release
|
|
1218
1196
|
{
|
1219
1197
|
parameter_key: "HostnamePatternPriority",
|
1220
1198
|
parameter_value: (hostname_pattern_priority.to_i + 10).to_s
|
1199
|
+
},
|
1200
|
+
{
|
1201
|
+
parameter_key: "EnvHash",
|
1202
|
+
parameter_value: deploy_id
|
1221
1203
|
}
|
1222
1204
|
]
|
1223
1205
|
if stack_exists?(stack_name_backoffice)
|
@@ -1259,6 +1241,10 @@ class Release
|
|
1259
1241
|
{
|
1260
1242
|
parameter_key: 'HostnamePatternPriority',
|
1261
1243
|
parameter_value: (hostname_pattern_priority.to_i + 10).to_s
|
1244
|
+
},
|
1245
|
+
{
|
1246
|
+
parameter_key: "EnvHash",
|
1247
|
+
parameter_value: deploy_id
|
1262
1248
|
}
|
1263
1249
|
]
|
1264
1250
|
if stack_exists?(stack_name_crash)
|
@@ -1289,10 +1275,6 @@ class Release
|
|
1289
1275
|
parameter_key: "TaskDesiredCount",
|
1290
1276
|
parameter_value: "1"
|
1291
1277
|
},
|
1292
|
-
{
|
1293
|
-
parameter_key: "ALBShortName",
|
1294
|
-
parameter_value: "activia-qa-#{deploy_id}"[0..31]
|
1295
|
-
},
|
1296
1278
|
{
|
1297
1279
|
parameter_key: "HostnamePattern",
|
1298
1280
|
parameter_value: "activia-#{@dns_record_identifier}.qa.colaster.com"
|
@@ -1316,46 +1298,6 @@ class Release
|
|
1316
1298
|
wait_for_stack_ready(stack_name_assange) unless stack_ready?(stack_name_assange)
|
1317
1299
|
wait_for_stack_ready(stack_name_fidaty) unless stack_ready?(stack_name_fidaty)
|
1318
1300
|
|
1319
|
-
stack_name_bolla = "ecs-task-bolla-qa-#{deploy_id}"
|
1320
|
-
git_checkout_version('bolla', @projects["bolla"][:revision])
|
1321
|
-
stack_body = File.read('projects/bolla/deploy/task.yml')
|
1322
|
-
parameters = [
|
1323
|
-
{
|
1324
|
-
parameter_key: "Environment",
|
1325
|
-
parameter_value: "qa"
|
1326
|
-
},
|
1327
|
-
{
|
1328
|
-
parameter_key: "ReleaseVersion",
|
1329
|
-
parameter_value: "#{@projects["bolla"][:revision]}-#{deploy_id}"
|
1330
|
-
},
|
1331
|
-
{
|
1332
|
-
parameter_key: "TaskDesiredCount",
|
1333
|
-
parameter_value: "1"
|
1334
|
-
},
|
1335
|
-
{
|
1336
|
-
parameter_key: "ECSClusterName",
|
1337
|
-
parameter_value: @ecs_cluster_name
|
1338
|
-
},
|
1339
|
-
{
|
1340
|
-
parameter_key: "ALBShortName",
|
1341
|
-
parameter_value: "bolla-qa-#{deploy_id}"[0..31]
|
1342
|
-
},
|
1343
|
-
{
|
1344
|
-
parameter_key: "HostnamePattern",
|
1345
|
-
parameter_value: "bolla-#{@dns_record_identifier}.qa.colaster.com"
|
1346
|
-
},
|
1347
|
-
{
|
1348
|
-
parameter_key: "HostnamePatternPriority",
|
1349
|
-
parameter_value: hostname_pattern_priority
|
1350
|
-
},
|
1351
|
-
]
|
1352
|
-
if stack_exists?(stack_name_bolla)
|
1353
|
-
cur_version = get_currently_deployed_version(stack_name_bolla)
|
1354
|
-
update_stack(stack_name_bolla, stack_body, parameters, tags) unless cur_version.include?(@projects["bolla"][:revision])
|
1355
|
-
else
|
1356
|
-
create_stack(stack_name_bolla, stack_body, parameters, tags)
|
1357
|
-
end
|
1358
|
-
|
1359
1301
|
stack_name_web = "ecs-task-web-qa-#{deploy_id}"
|
1360
1302
|
git_checkout_version('prima', @projects["prima"][:revision])
|
1361
1303
|
stack_body = IO.read('projects/prima/app/cloudformation/tasks/web.yml')
|
@@ -1395,6 +1337,10 @@ class Release
|
|
1395
1337
|
{
|
1396
1338
|
parameter_key: "HostnamePatternAggregatorPriority",
|
1397
1339
|
parameter_value: (hostname_pattern_priority.to_i + 1).to_s
|
1340
|
+
},
|
1341
|
+
{
|
1342
|
+
parameter_key: "EnvHash",
|
1343
|
+
parameter_value: deploy_id
|
1398
1344
|
}
|
1399
1345
|
]
|
1400
1346
|
if stack_exists?(stack_name_web)
|
@@ -1436,7 +1382,6 @@ class Release
|
|
1436
1382
|
wait_for_stack_ready(stack_name_peano) unless stack_ready?(stack_name_peano)
|
1437
1383
|
wait_for_stack_ready(stack_name_rogoreport) unless stack_ready?(stack_name_rogoreport)
|
1438
1384
|
wait_for_stack_ready(stack_name_borat) unless stack_ready?(stack_name_borat)
|
1439
|
-
wait_for_stack_ready(stack_name_bolla) unless stack_ready?(stack_name_bolla)
|
1440
1385
|
wait_for_stack_ready(stack_name_activia) unless stack_ready?(stack_name_activia)
|
1441
1386
|
wait_for_stack_ready(stack_name_crash) unless stack_ready?(stack_name_crash) || !deploy_crash?
|
1442
1387
|
|
@@ -1452,7 +1397,6 @@ class Release
|
|
1452
1397
|
update_service_defaults(stack_name_rogoreport)
|
1453
1398
|
update_service_defaults(stack_name_assange)
|
1454
1399
|
update_service_defaults(stack_name_borat)
|
1455
|
-
update_service_defaults(stack_name_bolla)
|
1456
1400
|
update_service_defaults(stack_name_activia)
|
1457
1401
|
update_service_defaults(stack_name_crash) unless !deploy_crash?
|
1458
1402
|
|
@@ -1466,12 +1410,13 @@ class Release
|
|
1466
1410
|
backoffice_hostname = get_route53_hostname(stack_name_backoffice)
|
1467
1411
|
assange_hostname = get_route53_hostname(stack_name_assange)
|
1468
1412
|
borat_hostname = get_route53_hostname(stack_name_borat)
|
1469
|
-
bolla_hostname = get_route53_hostname(stack_name_bolla)
|
1470
1413
|
activia_hostname = get_route53_hostname(stack_name_activia)
|
1471
1414
|
deploy_crash? && crash_hostname = get_route53_hostname(stack_name_crash)
|
1472
1415
|
|
1473
1416
|
launch_marley ec2_ip_address(asg_stack_name), prima_hostname, borat_hostname
|
1474
1417
|
|
1418
|
+
# > Bolla url: http://#{ec2_ip_address(asg_stack_name)}:10046
|
1419
|
+
|
1475
1420
|
projects_text = "
|
1476
1421
|
> Prima url: https://#{prima_hostname}
|
1477
1422
|
> Prima RI url: https://#{prima_hostname.sub("www", "wwwri")}
|
@@ -1482,7 +1427,6 @@ class Release
|
|
1482
1427
|
> Hal9000 url: http://#{hal9000_hostname}:10031
|
1483
1428
|
> Fidaty url: http://#{fidaty_hostname}:10021
|
1484
1429
|
> Peano url: http://#{peano_hostname}:10039
|
1485
|
-
> Bolla url: http://#{ec2_ip_address(asg_stack_name)}:10046
|
1486
1430
|
> Assange url: https://#{assange_hostname}
|
1487
1431
|
> Activia url: http://#{activia_hostname}:10041
|
1488
1432
|
> Backoffice (legacy) url: https://#{backoffice_hostname}"
|
@@ -1525,8 +1469,6 @@ class Release
|
|
1525
1469
|
host = "crash-#{@dns_record_identifier}.qa.colaster.com"
|
1526
1470
|
when stack_name.include?('ermes')
|
1527
1471
|
host = "ermes-#{@dns_record_identifier}.qa.colaster.com"
|
1528
|
-
when stack_name.include?('bolla')
|
1529
|
-
host = "bolla-#{@dns_record_identifier}.qa.colaster.com"
|
1530
1472
|
when stack_name.include?('activia')
|
1531
1473
|
host = "activia-#{@dns_record_identifier}.qa.colaster.com"
|
1532
1474
|
end
|
@@ -1616,8 +1558,6 @@ class Release
|
|
1616
1558
|
logical_resource_id = 'ECSServiceBorat'
|
1617
1559
|
when stack_name.include?('crash')
|
1618
1560
|
logical_resource_id = 'ECSServiceCrash'
|
1619
|
-
when stack_name.include?('bolla')
|
1620
|
-
logical_resource_id = 'ECSServiceBollaQA'
|
1621
1561
|
else
|
1622
1562
|
raise "Service name non gestito per lo stack #{stack_name}"
|
1623
1563
|
end
|
@@ -1714,10 +1654,7 @@ class Release
|
|
1714
1654
|
mix deps.get && mix compile && mix deps.compile && \
|
1715
1655
|
mix phx.digest && \
|
1716
1656
|
rm -rf _build/qa/rel/ && \
|
1717
|
-
mix release --env=qa'"
|
1718
|
-
# "if echo `docker ps` | grep crash; \
|
1719
|
-
# then echo 'cannot delete crash_default network'; \
|
1720
|
-
# else docker network rm crash_default; fi "
|
1657
|
+
mix release --env=qa'"
|
1721
1658
|
].each do |cmd|
|
1722
1659
|
execute_command cmd
|
1723
1660
|
end
|
@@ -2184,53 +2121,6 @@ class Release
|
|
2184
2121
|
Dir.chdir '../../'
|
2185
2122
|
end
|
2186
2123
|
|
2187
|
-
def create_bolla_artifact(revision, deploy_id)
|
2188
|
-
output "Preparo l'artifact bolla .zip\n".yellow
|
2189
|
-
|
2190
|
-
git_checkout_version('bolla', revision)
|
2191
|
-
|
2192
|
-
Dir.chdir 'projects/bolla'
|
2193
|
-
|
2194
|
-
decrypt_secrets()
|
2195
|
-
|
2196
|
-
if @qainit
|
2197
|
-
exec_step 'cp docker-compose.yml docker-compose-ci.yml'
|
2198
|
-
exec_step 'prepare-docker-compose --directory bolla && cp docker-compose-qainit.yml docker-compose.yml'
|
2199
|
-
[
|
2200
|
-
"docker-compose build web",
|
2201
|
-
"docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
|
2202
|
-
'-c' 'mix local.hex --force && mix hex.info && \
|
2203
|
-
mix deps.get && mix compile && mix deps.compile && \
|
2204
|
-
rm -rf _build/qa/rel/ && \
|
2205
|
-
mix release --env=qa'"
|
2206
|
-
].each do |cmd|
|
2207
|
-
execute_command cmd
|
2208
|
-
end
|
2209
|
-
|
2210
|
-
cleanup_containers
|
2211
|
-
else
|
2212
|
-
[
|
2213
|
-
"docker-compose build web",
|
2214
|
-
"docker run -v $PWD:/code -w /code -e MIX_ENV=qa --entrypoint /bin/sh bolla_web \
|
2215
|
-
'-c' 'mix local.hex --force && mix hex.info && \
|
2216
|
-
mix deps.get && mix compile && mix deps.compile && \
|
2217
|
-
rm -rf _build/qa/rel/ && \
|
2218
|
-
mix release --env=qa'"
|
2219
|
-
].each do |cmd|
|
2220
|
-
execute_command cmd
|
2221
|
-
end
|
2222
|
-
end
|
2223
|
-
|
2224
|
-
if @qainit
|
2225
|
-
artifact_path = Dir.glob("_build/qa/rel/migrator/releases/*/migrator.tar.gz").first
|
2226
|
-
else
|
2227
|
-
artifact_path = Dir.glob("_build/qa/rel/migrator/releases/*/migrator.tar.gz").first
|
2228
|
-
end
|
2229
|
-
upload_artifact(artifact_path, "microservices/bolla/#{revision}-#{deploy_id}-qa-migrator.tar.gz", "#{@s3_bucket}-encrypted")
|
2230
|
-
|
2231
|
-
Dir.chdir '../../'
|
2232
|
-
end
|
2233
|
-
|
2234
2124
|
def create_borat_artifact(revision, deploy_id)
|
2235
2125
|
output "Preparo l'artifact borat .zip\n".yellow
|
2236
2126
|
|
@@ -2450,9 +2340,8 @@ class Release
|
|
2450
2340
|
update_stack(stack_name, stack_body, [], tags)
|
2451
2341
|
end
|
2452
2342
|
|
2453
|
-
def create_alb_stack(stack_name, role)
|
2454
|
-
stack_body = IO.read('cloudformation/stacks/
|
2455
|
-
#stack_body = IO.read('cloudformation/stacks/alb/ecs-alb-public.yml')
|
2343
|
+
def create_alb_stack(stack_name, role, hash)
|
2344
|
+
stack_body = IO.read('cloudformation/stacks/elb/alb-public-qa.yml')
|
2456
2345
|
parameters = [
|
2457
2346
|
{
|
2458
2347
|
parameter_key: "Environment",
|
@@ -2461,6 +2350,10 @@ class Release
|
|
2461
2350
|
{
|
2462
2351
|
parameter_key: "Role",
|
2463
2352
|
parameter_value: role
|
2353
|
+
},
|
2354
|
+
{
|
2355
|
+
parameter_key: "EnvHash",
|
2356
|
+
parameter_value: hash
|
2464
2357
|
}
|
2465
2358
|
]
|
2466
2359
|
create_stack(stack_name, stack_body, parameters)
|
@@ -2719,7 +2612,6 @@ class Release
|
|
2719
2612
|
@projects["rogoreport"] = choose_branch_to_deploy('rogoreport')
|
2720
2613
|
@projects["assange"] = choose_branch_to_deploy('assange')
|
2721
2614
|
@projects["borat"] = choose_branch_to_deploy('borat')
|
2722
|
-
@projects["bolla"] = choose_branch_to_deploy('bolla')
|
2723
2615
|
@projects['crash'] = choose_branch_to_deploy('crash')
|
2724
2616
|
@projects['activia'] = choose_branch_to_deploy('activia')
|
2725
2617
|
else
|