prima-twig 0.53.0 → 0.53.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/twig-feature +109 -10
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e7ed94315b823c77e7906ac0d7ad9d3e7314f8b9bee2a281182a4a724ef8f06
4
- data.tar.gz: 8359144db9048c8777e38f14869038a49b50f87049450b5bccc7b6c1abf1969d
3
+ metadata.gz: 0d952682f211b41bc81b067dd1fbcabb51a06c89ac165606d85d84030b6a1efe
4
+ data.tar.gz: b8f01e03d167870dcf33f458283696cfcaadd9877a28cb6a0fa4eb32ff5e3449
5
5
  SHA512:
6
- metadata.gz: da6d94d4bb4b70445609e5bf92d33cea327ea3357533b0196e25df695d199873959d78e121215cb6c4a0453db0601aa37922ad563ccd114ef2203c6a95111026
7
- data.tar.gz: 371a6e947b3eb681eaa21f4f8802f1d9dd33e7b87a5196cc02280cc7f85e00e5ebb854e3748711d834030c57c172f2e58593c8b164e72617c0f33dc312e0913a
6
+ metadata.gz: 13ecc95e927204d19cb4bd61e9b3e21079df30556e96c15249a1a1b08e3b3ef1d14958cd82aa44190d9f029898b7355fcd3f8f125bbfb269757cd2f33e5cf519
7
+ data.tar.gz: 389928a3ef6b672a929a649f9e42f31bdc8a09206ef33a3a34c1d08e3ab200aca1d6791868cee15772f25df80c932f6ab4842c1aeb377f9b6b53ac9d039bb7f0
@@ -57,7 +57,8 @@ class Release
57
57
  'rachele' => {},
58
58
  'leftorium' => {},
59
59
  'pyxis-npm' => {},
60
- 'starsky' => {}
60
+ 'starsky' => {},
61
+ 'hutch' => {}
61
62
  }
62
63
  @base_stack_name_alb = 'ecs-alb-http-public-qa-'
63
64
  @base_stack_name_alb_ws = 'ecs-alb-ws-public-qa-'
@@ -71,7 +72,7 @@ class Release
71
72
  when 'finish'
72
73
  finish_feature!
73
74
  when 'qainit'
74
- abort('Non sei nella cartella di qainit') unless Dir.pwd.match 'qainit$'
75
+ abort('Non sei nella cartella di qainit') unless Dir.pwd.match 'qainit$' or Dir.pwd.match '/drone/src'
75
76
  if ['terminate', 'stop', 'shutdown', 'halt', 'destroy'].include? args[1]
76
77
  qainit_deploy_shutdown!
77
78
  elsif 'update' == args[1]
@@ -972,6 +973,7 @@ class Release
972
973
  create_leftorium_artifact(@projects["leftorium"][:revision]) unless artifact_exists?('prima-artifacts-encrypted', "microservices/leftorium/#{@projects["leftorium"][:revision]}-qa.tar.gz")
973
974
  create_skynet_artifact(@projects["skynet"][:revision]) unless artifact_exists?('prima-artifacts-encrypted', "microservices/skynet/#{@projects["skynet"][:revision]}-qa.tar.gz")
974
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")
975
977
 
976
978
  wait_for_db_import(db_task) unless stack_exists?("ecs-route53-qa-#{deploy_id}") # dovrebbe essere istantaneo
977
979
 
@@ -1054,6 +1056,10 @@ class Release
1054
1056
  {
1055
1057
  parameter_key: 'StarskyElbHostname',
1056
1058
  parameter_value: get_alb_host(stack_name_alb)
1059
+ },
1060
+ {
1061
+ parameter_key: 'HutchElbHostname',
1062
+ parameter_value: get_alb_host(stack_name_alb)
1057
1063
  }
1058
1064
  ]
1059
1065
 
@@ -1846,6 +1852,55 @@ class Release
1846
1852
  create_stack(stack_name_roger, stack_body, parameters, tags, @cf_role)
1847
1853
  end
1848
1854
 
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
+
1849
1904
  wait_for_stack_ready(stack_name_web) unless stack_ready?(stack_name_web)
1850
1905
  wait_for_stack_ready(stack_name_consumer) unless stack_ready?(stack_name_consumer)
1851
1906
  wait_for_stack_ready(stack_name_ermes) unless stack_ready?(stack_name_ermes)
@@ -1855,7 +1910,7 @@ class Release
1855
1910
  wait_for_stack_ready(stack_name_borat) unless stack_ready?(stack_name_borat)
1856
1911
  wait_for_stack_ready(stack_name_activia) unless stack_ready?(stack_name_activia)
1857
1912
  wait_for_stack_ready(stack_name_crash) unless stack_ready?(stack_name_crash) unless !deploy_crash?
1858
- wait_for_stack_ready(stack_name_starsky) unless stack_ready?(stack_name_starsky) unless !deploy_starsky_hutch?
1913
+ wait_for_stack_ready(stack_name_hutch) unless stack_ready?(stack_name_hutch) unless !deploy_starsky_hutch?
1859
1914
 
1860
1915
  update_service_defaults(stack_name_web)
1861
1916
  update_service_defaults(stack_name_consumer)
@@ -1873,6 +1928,7 @@ class Release
1873
1928
  update_service_defaults(stack_name_leftorium)
1874
1929
  update_service_defaults(stack_name_rachele)
1875
1930
  update_service_defaults(stack_name_starsky) unless !deploy_starsky_hutch?
1931
+ update_service_defaults(stack_name_hutch) unless !deploy_starsky_hutch?
1876
1932
  update_service_defaults(stack_name_crash) unless !deploy_crash?
1877
1933
 
1878
1934
  activia_hostname = get_route53_hostname(stack_name_activia)
@@ -1891,6 +1947,7 @@ class Release
1891
1947
  rachele_hostname = get_route53_hostname(stack_name_rachele)
1892
1948
  crash_hostname = get_route53_hostname(stack_name_crash) unless !deploy_crash?
1893
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?
1894
1951
 
1895
1952
  # launch_marley ec2_ip_address(asg_stack_name), prima_hostname, borat_hostname
1896
1953
 
@@ -1912,7 +1969,8 @@ class Release
1912
1969
  projects_text.concat "
1913
1970
  > Crash url: https://#{crash_hostname}" if deploy_crash?
1914
1971
  projects_text.concat "
1915
- > Starsky url: https://#{starsky_hostname}" if deploy_starsky_hutch?
1972
+ > Starsky url: https://#{starsky_hostname}
1973
+ > Hutch url: https://#{hutch_hostname}" if deploy_starsky_hutch?
1916
1974
  projects_text.concat "
1917
1975
  > RabbitMQ url: http://#{ec2_ip_address(asg_stack_name)}:15672
1918
1976
  > Supervisor url: http://#{ec2_ip_address(asg_stack_name)}:9001
@@ -1958,6 +2016,8 @@ class Release
1958
2016
  host = "rachele-#{@dns_record_identifier}.qa.colaster.com"
1959
2017
  when stack_name.include?('starsky')
1960
2018
  host = "starsky-#{@dns_record_identifier}.qa.colaster.com"
2019
+ when stack_name.include?('hutch')
2020
+ host = "hutch-#{@dns_record_identifier}.qa.colaster.com"
1961
2021
  end
1962
2022
  host
1963
2023
  end
@@ -2014,6 +2074,8 @@ class Release
2014
2074
  logical_resource_id = 'EcsApplicationLoadBalancerInternal'
2015
2075
  when stack_name.include?('starsky')
2016
2076
  logical_resource_id = 'EcsApplicationLoadBalancerPublic'
2077
+ when stack_name.include?('hutch')
2078
+ logical_resource_id = 'EcsApplicationLoadBalancerPublic'
2017
2079
  end
2018
2080
  resp = @cf.describe_stack_resource({
2019
2081
  stack_name: stack_name,
@@ -2065,6 +2127,8 @@ class Release
2065
2127
  logical_resource_id = 'ECSServiceCrashQA'
2066
2128
  when stack_name.include?('starsky')
2067
2129
  logical_resource_id = 'ECSServiceStarskyQA'
2130
+ when stack_name.include?('hutch')
2131
+ logical_resource_id = 'ECSServiceHutch'
2068
2132
  else
2069
2133
  raise "Service name non gestito per lo stack #{stack_name}"
2070
2134
  end
@@ -2281,6 +2345,7 @@ class Release
2281
2345
  MIX_ENV=dev mix compile.sms && \
2282
2346
  MIX_ENV=dev mix compile.html && \
2283
2347
  MIX_ENV=dev mix compile.heml && \
2348
+ MIX_ENV=dev mix compile.app_notification && \
2284
2349
  rm -rf _build/qa/rel/ && \
2285
2350
  mix release --env=qa'"
2286
2351
  ].each do |cmd|
@@ -2357,6 +2422,40 @@ class Release
2357
2422
  Dir.chdir '../../'
2358
2423
  end
2359
2424
 
2425
+ def create_hutch_artifact(revision)
2426
+ output "Preparo l'artifact hutch\n".yellow
2427
+
2428
+ git_checkout_version('hutch', revision)
2429
+
2430
+ Dir.chdir 'projects/hutch'
2431
+
2432
+ version = `git rev-parse HEAD`
2433
+
2434
+ decrypt_secrets() unless File.exist?('config/secrets.yml')
2435
+
2436
+ exec_step 'cp docker-compose-ci.yml docker-compose.yml'
2437
+ exec_step 'prepare-docker-compose --directory hutch && cp docker-compose-qainit.yml docker-compose.yml'
2438
+ exec_step "sed s/qa_deploy_id/#{get_deploy_id}/ .env.dist.qa"
2439
+ exec_step "cp .env.dist.qa .env"
2440
+ exec_step "rm -fr peano"
2441
+
2442
+ [
2443
+ "sed -i 's/USER app/USER root/g' Dockerfile",
2444
+ "docker-compose build web",
2445
+ "docker-compose run -w $PWD -u root -e ELM_APP_STARSKY_URL=https://#{get_route53_hostname("starsky")} --entrypoint /bin/sh web \
2446
+ '-c' 'yarn && yarn run build \
2447
+ && tar cfz #{revision}-qa.tar.gz *'"
2448
+ ].each do |cmd|
2449
+ execute_command cmd
2450
+ end
2451
+
2452
+ artifact_path = "./#{revision}-qa.tar.gz"
2453
+
2454
+ upload_artifact(artifact_path, "microservices/hutch/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2455
+
2456
+ Dir.chdir '../../'
2457
+ end
2458
+
2360
2459
  def create_leftorium_artifact(revision)
2361
2460
  output "Preparo l'artifact leftorium .zip\n".yellow
2362
2461
 
@@ -2615,10 +2714,10 @@ class Release
2615
2714
  [
2616
2715
  "sed -i 's/USER app/USER root/g' Dockerfile",
2617
2716
  "docker-compose build web",
2618
- "docker-compose run -w $PWD -u root --entrypoint /bin/sh web \
2619
- '-c' 'cargo build --release -vv \
2620
- && cargo build --bin migrate --release \
2621
- && cargo build --bin rabbit_worker --release \
2717
+ "docker-compose run -w $PWD -e BUILD_ENV=qa -u root --entrypoint /bin/sh web \
2718
+ '-c' 'cargo build --release -vv --features=qa \
2719
+ && cargo build --bin migrate --release --features=qa \
2720
+ && cargo build --bin rabbit_worker --release --features=qa \
2622
2721
  && cp -p target/release/starsky . \
2623
2722
  && cp -p target/release/migrate . \
2624
2723
  && cp -p target/release/rabbit_worker . \
@@ -2686,8 +2785,8 @@ class Release
2686
2785
 
2687
2786
  def deploy_starsky_hutch?
2688
2787
  starsky_present = !@projects['starsky'].nil? && !@projects['starsky'].empty? && @projects['starsky'][:name] != 'master' && !@projects['starsky'][:default_branch]
2689
- #hutch_present = !@projects['hutch'].empty? && @projects['hutch'][:name] != 'master' && !@projects['hutch'][:default_branch]
2690
- starsky_present #|| hutch_present TODO REMOVE
2788
+ hutch_present = !@projects['hutch'].nil? && !@projects['hutch'].empty? && @projects['hutch'][:name] != 'master' && !@projects['hutch'][:default_branch]
2789
+ starsky_present || hutch_present
2691
2790
  end
2692
2791
 
2693
2792
  def get_pyxis_version(deploy_id)
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.53.0
4
+ version: 0.53.1
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-09-26 00:00:00.000000000 Z
17
+ date: 2019-10-14 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: aws-sdk
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirements: []
217
- rubygems_version: 3.0.1
217
+ rubygems_version: 3.0.3
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: The Prima twig toolbelt