prima-twig 0.50.54 → 0.50.80

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2279c9d6f9f6abe9ec3f065b979ce2ff5a7c7ab3012e10de846a9be887a3c7c0
4
- data.tar.gz: d86f653178260b80338668e40292b2cc3c5fc2169358ef40af965784638049ff
3
+ metadata.gz: 6a317427d8667b23ef578a60440e92061269248f6db0c3cc71610784c84da2d3
4
+ data.tar.gz: 6b0a03b49143df96645a30bf2ad28ee6fea7f9d88cfcea6c8f0c5221f10f0c90
5
5
  SHA512:
6
- metadata.gz: 508ad908f77db08988c1fb5df340c02ed8f999bce16b968e0cc6784f7e65899346f83fff9cb796bc232c779f275ac747c6c8cd2fcf871c80bfbaf3fcf2648947
7
- data.tar.gz: 779ac1745991c9a2919f627b07f8d5a61859e069c1c70369c2377d1a346f23ba77026b6bb64778ca87228bdd6066f081708ed8ae15cfdf5a04443ce2602d7c97
6
+ metadata.gz: d1ec12fe9b1110eafc3c9700263e001ded09bd33bd564830f60cff9e5b71e28aba17fe1c43f26149e92b3717b9c314ced9b49f9825170e6178e6783f3bdd47f4
7
+ data.tar.gz: ddc5df36197055005a13626dc398742f03806d978a56a687e94900f8b66bf53ff666d0f8625de0146a91e4099543876e952e45b6ab7fc7f735332abfb8a8c5c6
data/bin/twig-deploy CHANGED
@@ -142,23 +142,9 @@ class Review
142
142
  mail.delivery_method(:smtp, opts)
143
143
  mail.deliver
144
144
 
145
- invalidate_prismic_cache
146
-
147
145
  exec_step "terminal-notifier -message 'Deploy terminato'" if which 'terminal-notifier'
148
146
  end
149
147
 
150
- def invalidate_prismic_cache
151
- [
152
- "guarantee",
153
- "glossary",
154
- "guide",
155
- "faq"
156
- ].each do |page|
157
-
158
- exec_step "curl -X POST -H \"Content-Type: application/json\" https://www.prima.it/api/cms/update/#{page}?apikey=#{@prima.config['prima_apikey']}"
159
- end
160
- end
161
-
162
148
  def reload_parameters!
163
149
  artifact_rev = ''
164
150
  resp = @cf.describe_stacks({
data/bin/twig-feature CHANGED
@@ -57,8 +57,7 @@ class Release
57
57
  'rachele' => {},
58
58
  'leftorium' => {},
59
59
  'pyxis-npm' => {},
60
- 'starsky' => {},
61
- 'hutch' => {}
60
+ 'starsky' => {}
62
61
  }
63
62
  @base_stack_name_alb = 'ecs-alb-http-public-qa-'
64
63
  @base_stack_name_alb_ws = 'ecs-alb-ws-public-qa-'
@@ -72,7 +71,7 @@ class Release
72
71
  when 'finish'
73
72
  finish_feature!
74
73
  when 'qainit'
75
- abort('Non sei nella cartella di qainit') unless Dir.pwd.match 'qainit$' or Dir.pwd.match '/drone/src'
74
+ abort('Non sei nella cartella di qainit') unless Dir.pwd.match 'qainit$'
76
75
  if ['terminate', 'stop', 'shutdown', 'halt', 'destroy'].include? args[1]
77
76
  qainit_deploy_shutdown!
78
77
  elsif 'update' == args[1]
@@ -719,7 +718,7 @@ class Release
719
718
 
720
719
  def qainit_drone_minimal_deploy!
721
720
  # tenere solo il project da deployare (l'unico project è prima)
722
- @ami_id = "ami-00884fac276f27392"
721
+ @ami_id = get_ami_id("ecs-fleet-allinone-staging")
723
722
  project = ''
724
723
  @projects.each_key do |project_key|
725
724
  if @projects[project_key][:revision]
@@ -878,7 +877,7 @@ class Release
878
877
 
879
878
  def deploy_feature!
880
879
  `git pull && git submodule init && git submodule update`
881
- @ami_id = "ami-00884fac276f27392"
880
+ @ami_id = get_ami_id("ecs-fleet-allinone-staging")
882
881
  deploy_id = get_deploy_id
883
882
  stack_name_alb = 'ecs-alb-http-public-qa-' + deploy_id[0..5]
884
883
  stack_name_alb_ws = 'ecs-alb-ws-public-qa-' + deploy_id[0..5]
@@ -903,11 +902,8 @@ class Release
903
902
  }
904
903
  ]
905
904
  @projects.each do |key, value|
906
- case key.to_s
907
- when 'crash'
905
+ if key.to_s == 'crash'
908
906
  tags << { key: 'crash', value: @projects['crash'][:name] } if deploy_crash?
909
- when 'starsky', 'hutch'
910
- tags << { key: key.to_s, value: @projects[key.to_s][:name] } if deploy_starsky_hutch?
911
907
  else
912
908
  tags << { key: key, value: value[:name] }
913
909
  end
@@ -972,8 +968,7 @@ class Release
972
968
  create_activia_artifact(@projects["activia"][:revision]) unless artifact_exists?('prima-artifacts-encrypted', "microservices/activia/#{@projects["activia"][:revision]}-qa.tar.gz")
973
969
  create_leftorium_artifact(@projects["leftorium"][:revision]) unless artifact_exists?('prima-artifacts-encrypted', "microservices/leftorium/#{@projects["leftorium"][:revision]}-qa.tar.gz")
974
970
  create_skynet_artifact(@projects["skynet"][:revision]) unless artifact_exists?('prima-artifacts-encrypted', "microservices/skynet/#{@projects["skynet"][:revision]}-qa.tar.gz")
975
- create_starsky_artifact(@projects["starsky"][:revision]) unless !deploy_starsky_hutch? || artifact_exists?('prima-artifacts-encrypted', "microservices/starsky/#{@projects["starsky"][:revision]}-qa.tar.gz")
976
- create_hutch_artifact(@projects["hutch"][:revision]) unless !deploy_starsky_hutch? || artifact_exists?('prima-artifacts-encrypted', "microservices/hutch/#{@projects["hutch"][:revision]}-qa.tar.gz")
971
+ create_starsky_artifact(@projects["starsky"][:revision]) unless artifact_exists?('prima-artifacts-encrypted', "microservices/starsky/#{@projects["starsky"][:revision]}-qa.tar.gz")
977
972
 
978
973
  wait_for_db_import(db_task) unless stack_exists?("ecs-route53-qa-#{deploy_id}") # dovrebbe essere istantaneo
979
974
 
@@ -1052,14 +1047,6 @@ class Release
1052
1047
  {
1053
1048
  parameter_key: 'CrashElbHostname',
1054
1049
  parameter_value: get_alb_host(stack_name_alb_ws)
1055
- },
1056
- {
1057
- parameter_key: 'StarskyElbHostname',
1058
- parameter_value: get_alb_host(stack_name_alb)
1059
- },
1060
- {
1061
- parameter_key: 'HutchElbHostname',
1062
- parameter_value: get_alb_host(stack_name_alb)
1063
1050
  }
1064
1051
  ]
1065
1052
 
@@ -1612,50 +1599,40 @@ class Release
1612
1599
  end
1613
1600
  end
1614
1601
 
1615
- if deploy_starsky_hutch?
1616
- stack_name_starsky = "ecs-task-starsky-qa-#{deploy_id}"
1617
- git_checkout_version('starsky', @projects["starsky"][:revision])
1618
- stack_body = IO.read('projects/starsky/deploy/task.yml')
1619
- parameters = [
1620
- {
1621
- parameter_key: "Environment",
1622
- parameter_value: "qa"
1623
- },
1624
- {
1625
- parameter_key: "ReleaseVersion",
1626
- parameter_value: "#{@projects["starsky"][:revision]}"
1627
- },
1628
- {
1629
- parameter_key: "TaskDesiredCount",
1630
- parameter_value: "1"
1631
- },
1632
- {
1633
- parameter_key: "ECSClusterName",
1634
- parameter_value: @ecs_cluster_name
1635
- },
1636
- {
1637
- parameter_key: "ALBShortName",
1638
- parameter_value: "starsky-qa-#{deploy_id}"[0..27]
1639
- },
1640
- {
1641
- parameter_key: "EnvHash",
1642
- parameter_value: deploy_id
1643
- },
1644
- {
1645
- parameter_key: "HostnamePattern",
1646
- parameter_value: "starsky-#{@dns_record_identifier}.qa.colaster.com"
1647
- },
1648
- {
1649
- parameter_key: "HostnamePatternPriority",
1650
- parameter_value: (hostname_pattern_priority.to_i + 74).to_s
1651
- }
1652
- ]
1653
- if stack_exists?(stack_name_starsky)
1654
- cur_version = get_currently_deployed_version(stack_name_starsky)
1655
- update_stack(stack_name_starsky, stack_body, parameters, tags, @cf_role) unless cur_version.include?(@projects["starsky"][:revision])
1656
- else
1657
- create_stack(stack_name_starsky, stack_body, parameters, tags, @cf_role)
1658
- end
1602
+ stack_name_starsky = "ecs-task-starsky-qa-#{deploy_id}"
1603
+ git_checkout_version('starsky', @projects["starsky"][:revision])
1604
+ stack_body = IO.read('projects/starsky/deploy/task.yml')
1605
+ parameters = [
1606
+ {
1607
+ parameter_key: "Environment",
1608
+ parameter_value: "qa"
1609
+ },
1610
+ {
1611
+ parameter_key: "ReleaseVersion",
1612
+ parameter_value: "#{@projects["rogoreport"][:revision]}"
1613
+ },
1614
+ {
1615
+ parameter_key: "TaskDesiredCount",
1616
+ parameter_value: "1"
1617
+ },
1618
+ {
1619
+ parameter_key: "ECSClusterName",
1620
+ parameter_value: @ecs_cluster_name
1621
+ },
1622
+ {
1623
+ parameter_key: "HostnamePattern",
1624
+ parameter_value: "starsky-#{@dns_record_identifier}.qa.colaster.com"
1625
+ },
1626
+ {
1627
+ parameter_key: "HostnamePatternPriority",
1628
+ parameter_value: hostname_pattern_priority
1629
+ }
1630
+ ]
1631
+ if stack_exists?(stack_name_starsky)
1632
+ cur_version = get_currently_deployed_version(stack_name_starsky)
1633
+ update_stack(stack_name_starsky, stack_body, parameters, tags, @cf_role) unless cur_version.include?(@projects["starsky"][:revision])
1634
+ else
1635
+ create_stack(stack_name_starsky, stack_body, parameters, tags, @cf_role)
1659
1636
  end
1660
1637
 
1661
1638
  stack_name_activia = "ecs-task-activia-qa-#{deploy_id}"
@@ -1852,55 +1829,6 @@ class Release
1852
1829
  create_stack(stack_name_roger, stack_body, parameters, tags, @cf_role)
1853
1830
  end
1854
1831
 
1855
-
1856
- if deploy_starsky_hutch?
1857
- wait_for_stack_ready(stack_name_starsky) unless stack_ready?(stack_name_starsky) unless !deploy_starsky_hutch?
1858
-
1859
- stack_name_hutch = "ecs-task-hutch-qa-#{deploy_id}"
1860
- git_checkout_version('hutch', @projects["hutch"][:revision])
1861
- stack_body = File.read('projects/hutch/deploy/task.yml')
1862
- parameters = [
1863
- {
1864
- parameter_key: "Environment",
1865
- parameter_value: "qa"
1866
- },
1867
- {
1868
- parameter_key: "ReleaseVersion",
1869
- parameter_value: "#{@projects["hutch"][:revision]}"
1870
- },
1871
- {
1872
- parameter_key: "ALBShortName",
1873
- parameter_value: "hutch-qa-#{deploy_id}"[0..27]
1874
- },
1875
- {
1876
- parameter_key: "ECSClusterName",
1877
- parameter_value: @ecs_cluster_name
1878
- },
1879
- {
1880
- parameter_key: "EnvHash",
1881
- parameter_value: deploy_id
1882
- },
1883
- {
1884
- parameter_key: "HostnamePattern",
1885
- parameter_value: "hutch-#{@dns_record_identifier}.qa.colaster.com"
1886
- },
1887
- {
1888
- parameter_key: "HostnamePatternPriority",
1889
- parameter_value: (hostname_pattern_priority.to_i + 254).to_s
1890
- },
1891
- {
1892
- parameter_key: "StarskyUrl",
1893
- parameter_value: "https://#{get_route53_hostname('ecs-task-starsky-qa-notneeded')}"
1894
- }
1895
- ]
1896
- if stack_exists?(stack_name_hutch)
1897
- cur_version = get_currently_deployed_version(stack_name_hutch)
1898
- update_stack(stack_name_hutch, stack_body, parameters, tags, @cf_role) unless cur_version.include?(@projects["hutch"][:revision])
1899
- else
1900
- create_stack(stack_name_hutch, stack_body, parameters, tags, @cf_role)
1901
- end
1902
- end
1903
-
1904
1832
  wait_for_stack_ready(stack_name_web) unless stack_ready?(stack_name_web)
1905
1833
  wait_for_stack_ready(stack_name_consumer) unless stack_ready?(stack_name_consumer)
1906
1834
  wait_for_stack_ready(stack_name_ermes) unless stack_ready?(stack_name_ermes)
@@ -1910,7 +1838,6 @@ class Release
1910
1838
  wait_for_stack_ready(stack_name_borat) unless stack_ready?(stack_name_borat)
1911
1839
  wait_for_stack_ready(stack_name_activia) unless stack_ready?(stack_name_activia)
1912
1840
  wait_for_stack_ready(stack_name_crash) unless stack_ready?(stack_name_crash) unless !deploy_crash?
1913
- wait_for_stack_ready(stack_name_hutch) unless stack_ready?(stack_name_hutch) unless !deploy_starsky_hutch?
1914
1841
 
1915
1842
  update_service_defaults(stack_name_web)
1916
1843
  update_service_defaults(stack_name_consumer)
@@ -1927,8 +1854,6 @@ class Release
1927
1854
  update_service_defaults(stack_name_skynet)
1928
1855
  update_service_defaults(stack_name_leftorium)
1929
1856
  update_service_defaults(stack_name_rachele)
1930
- update_service_defaults(stack_name_starsky) unless !deploy_starsky_hutch?
1931
- update_service_defaults(stack_name_hutch) unless !deploy_starsky_hutch?
1932
1857
  update_service_defaults(stack_name_crash) unless !deploy_crash?
1933
1858
 
1934
1859
  activia_hostname = get_route53_hostname(stack_name_activia)
@@ -1946,8 +1871,6 @@ class Release
1946
1871
  leftorium_hostname = get_route53_hostname(stack_name_leftorium)
1947
1872
  rachele_hostname = get_route53_hostname(stack_name_rachele)
1948
1873
  crash_hostname = get_route53_hostname(stack_name_crash) unless !deploy_crash?
1949
- starsky_hostname = get_route53_hostname(stack_name_starsky) unless !deploy_starsky_hutch?
1950
- hutch_hostname = get_route53_hostname(stack_name_hutch) unless !deploy_starsky_hutch?
1951
1874
 
1952
1875
  # launch_marley ec2_ip_address(asg_stack_name), prima_hostname, borat_hostname
1953
1876
 
@@ -1969,9 +1892,6 @@ class Release
1969
1892
  projects_text.concat "
1970
1893
  > Crash url: https://#{crash_hostname}" if deploy_crash?
1971
1894
  projects_text.concat "
1972
- > Starsky url: https://#{starsky_hostname}
1973
- > Hutch url: https://#{hutch_hostname}" if deploy_starsky_hutch?
1974
- projects_text.concat "
1975
1895
  > RabbitMQ url: http://#{ec2_ip_address(asg_stack_name)}:15672
1976
1896
  > Supervisor url: http://#{ec2_ip_address(asg_stack_name)}:9001
1977
1897
  > Elasticsearch url: http://#{ec2_ip_address(asg_stack_name)}:9200
@@ -2014,10 +1934,6 @@ class Release
2014
1934
  host = "leftorium-#{@dns_record_identifier}.qa.colaster.com"
2015
1935
  when stack_name.include?('rachele')
2016
1936
  host = "rachele-#{@dns_record_identifier}.qa.colaster.com"
2017
- when stack_name.include?('starsky')
2018
- host = "starsky-#{@dns_record_identifier}.qa.colaster.com"
2019
- when stack_name.include?('hutch')
2020
- host = "hutch-#{@dns_record_identifier}.qa.colaster.com"
2021
1937
  end
2022
1938
  host
2023
1939
  end
@@ -2072,10 +1988,6 @@ class Release
2072
1988
  logical_resource_id = 'EcsApplicationLoadBalancerPublic'
2073
1989
  when stack_name.include?('rachele')
2074
1990
  logical_resource_id = 'EcsApplicationLoadBalancerInternal'
2075
- when stack_name.include?('starsky')
2076
- logical_resource_id = 'EcsApplicationLoadBalancerPublic'
2077
- when stack_name.include?('hutch')
2078
- logical_resource_id = 'EcsApplicationLoadBalancerPublic'
2079
1991
  end
2080
1992
  resp = @cf.describe_stack_resource({
2081
1993
  stack_name: stack_name,
@@ -2125,10 +2037,6 @@ class Release
2125
2037
  logical_resource_id = 'ECSServiceRacheleQA'
2126
2038
  when stack_name.include?('crash')
2127
2039
  logical_resource_id = 'ECSServiceCrashQA'
2128
- when stack_name.include?('starsky')
2129
- logical_resource_id = 'ECSServiceStarskyQA'
2130
- when stack_name.include?('hutch')
2131
- logical_resource_id = 'ECSServiceHutch'
2132
2040
  else
2133
2041
  raise "Service name non gestito per lo stack #{stack_name}"
2134
2042
  end
@@ -2342,9 +2250,6 @@ class Release
2342
2250
  '-c' 'mix local.hex --force && mix hex.info && \
2343
2251
  mix deps.get && mix compile && mix deps.compile && \
2344
2252
  mix phx.digest && \
2345
- MIX_ENV=dev mix compile.sms && \
2346
- MIX_ENV=dev mix compile.html && \
2347
- MIX_ENV=dev mix compile.heml && \
2348
2253
  rm -rf _build/qa/rel/ && \
2349
2254
  mix release --env=qa'"
2350
2255
  ].each do |cmd|
@@ -2421,40 +2326,6 @@ class Release
2421
2326
  Dir.chdir '../../'
2422
2327
  end
2423
2328
 
2424
- def create_hutch_artifact(revision)
2425
- output "Preparo l'artifact hutch\n".yellow
2426
-
2427
- git_checkout_version('hutch', revision)
2428
-
2429
- Dir.chdir 'projects/hutch'
2430
-
2431
- version = `git rev-parse HEAD`
2432
-
2433
- decrypt_secrets() unless File.exist?('config/secrets.yml')
2434
-
2435
- exec_step 'cp docker-compose-ci.yml docker-compose.yml'
2436
- exec_step 'prepare-docker-compose --directory hutch && cp docker-compose-qainit.yml docker-compose.yml'
2437
- exec_step "sed s/qa_deploy_id/#{get_deploy_id}/ .env.dist.qa"
2438
- exec_step "cp .env.dist.qa .env"
2439
- exec_step "rm -fr peano"
2440
-
2441
- [
2442
- "sed -i 's/USER app/USER root/g' Dockerfile",
2443
- "docker-compose build web",
2444
- "docker-compose run -w $PWD -u root -e ELM_APP_STARSKY_URL=https://#{get_route53_hostname("starsky")} --entrypoint /bin/sh web \
2445
- '-c' 'yarn && yarn run build \
2446
- && tar cfz #{revision}-qa.tar.gz *'"
2447
- ].each do |cmd|
2448
- execute_command cmd
2449
- end
2450
-
2451
- artifact_path = "./#{revision}-qa.tar.gz"
2452
-
2453
- upload_artifact(artifact_path, "microservices/hutch/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2454
-
2455
- Dir.chdir '../../'
2456
- end
2457
-
2458
2329
  def create_leftorium_artifact(revision)
2459
2330
  output "Preparo l'artifact leftorium .zip\n".yellow
2460
2331
 
@@ -2708,15 +2579,14 @@ class Release
2708
2579
  exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2709
2580
  exec_step 'prepare-docker-compose --directory starsky && cp docker-compose-qainit.yml docker-compose.yml'
2710
2581
  exec_step "sed s/qa_deploy_id/#{get_deploy_id}/ .env.dist.qa"
2711
- exec_step "cp .env.dist.qa .env"
2712
2582
 
2713
2583
  [
2714
2584
  "sed -i 's/USER app/USER root/g' Dockerfile",
2715
2585
  "docker-compose build web",
2716
- "docker-compose run -w $PWD -e BUILD_ENV=qa -u root --entrypoint /bin/sh web \
2717
- '-c' 'cargo build --release -vv --features=qa \
2718
- && cargo build --bin migrate --release --features=qa \
2719
- && cargo build --bin rabbit_worker --release --features=qa \
2586
+ "docker-compose run -w $PWD -u root --entrypoint /bin/sh web \
2587
+ '-c' 'cargo build --release -vv \
2588
+ && cargo build --bin migrate --release \
2589
+ && cargo build --bin rabbit_worker --release \
2720
2590
  && cp -p target/release/starsky . \
2721
2591
  && cp -p target/release/migrate . \
2722
2592
  && cp -p target/release/rabbit_worker . \
@@ -2782,12 +2652,6 @@ class Release
2782
2652
  crash_present || leftorium_present
2783
2653
  end
2784
2654
 
2785
- def deploy_starsky_hutch?
2786
- starsky_present = !@projects['starsky'].nil? && !@projects['starsky'].empty? && @projects['starsky'][:name] != 'master' && !@projects['starsky'][:default_branch]
2787
- hutch_present = !@projects['hutch'].nil? && !@projects['hutch'].empty? && @projects['hutch'][:name] != 'master' && !@projects['hutch'][:default_branch]
2788
- starsky_present || hutch_present
2789
- end
2790
-
2791
2655
  def get_pyxis_version(deploy_id)
2792
2656
  (deploy_id.delete '[a-z0]')[0..9]
2793
2657
  end
data/lib/prima_twig.rb CHANGED
@@ -13,7 +13,7 @@ class Prima
13
13
  LABEL_HOTFIX='hotfix'
14
14
  LABEL_NEXT_RELEASE='next release'
15
15
  LABEL_IN_STAGING='in staging'
16
- CONFIG_KEYS=['github', 'mandrill', 'sparkpost', 'cloudflare_email', 'cloudflare_apikey', 'aws_username', 'aws_password', 'prima_apikey']
16
+ CONFIG_KEYS=['github', 'mandrill', 'sparkpost', 'cloudflare_email', 'cloudflare_apikey', 'aws_username', 'aws_password']
17
17
  attr_reader :gh, :twig, :config, :rugged, :aws
18
18
 
19
19
  def initialize
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: 0.50.54
4
+ version: 0.50.80
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: 2019-10-14 00:00:00.000000000 Z
17
+ date: 2019-09-13 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: aws-sdk
@@ -214,8 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirements: []
217
- rubyforge_project:
218
- rubygems_version: 2.7.8
217
+ rubygems_version: 3.0.1
219
218
  signing_key:
220
219
  specification_version: 4
221
220
  summary: The Prima twig toolbelt