prima-twig 0.50.89 → 0.50.101

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/twig-feature +97 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12a6f87ddc36616cc5d2563b115e6cd26af4e459b421936ac64bf1be48ba3aa0
4
- data.tar.gz: fce88294b1047ed2e77cf6ef0751e7cd799fb0b25fb7d83e402c2bea43fba965
3
+ metadata.gz: 38e223ffdfb51eb2f0dcd45fd1d562b267048a63464ad19374733c84b3059c31
4
+ data.tar.gz: 67bc807746574543e6c75ee8502f757544eafb9fba012f3cc0a96e80707fe2d3
5
5
  SHA512:
6
- metadata.gz: e8fc98a64ae62031e95f31c63b1fef69f35f0d3f8cf077d429ce120f656759b0e0722da8fd61a383fd8ad850f5edadaabe0c9692b3cc7457021ae89fd05eb4d6
7
- data.tar.gz: ee2130a9f729a15be4a5c273bcef2e8612ef8d8ef69263d9f6d128e969129961f6a0ecc1e3a2398696ea5e5505c662a8503efcc8ec49e656a2d2f416846a9667
6
+ metadata.gz: b646ff71ad149dd4416eb8f66099dbf99a580d5a6db791734259d62cb1e44bd8762d5308085550064b21f6cff26ffa120084132ebb7b88cc43cb23e3c670d834
7
+ data.tar.gz: f57b3a843271da73b5fe391971cf462777288a344d986679e6062610407ea3006182a67dd1fe2b88b9f491972818a21d00af7b43304325dc72ca9230c9fb199e
data/bin/twig-feature CHANGED
@@ -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-'
@@ -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
 
@@ -1053,7 +1055,7 @@ class Release
1053
1055
  },
1054
1056
  {
1055
1057
  parameter_key: 'StarskyElbHostname',
1056
- parameter_value: get_alb_host(stack_name_alb_ws)
1058
+ parameter_value: get_alb_host(stack_name_alb)
1057
1059
  }
1058
1060
  ]
1059
1061
 
@@ -1846,6 +1848,52 @@ class Release
1846
1848
  create_stack(stack_name_roger, stack_body, parameters, tags, @cf_role)
1847
1849
  end
1848
1850
 
1851
+ wait_for_stack_ready(stack_name_starsky) unless stack_ready?(stack_name_starsky) unless !deploy_starsky_hutch?
1852
+
1853
+ stack_name_hutch = "ecs-task-hutch-qa-#{deploy_id}"
1854
+ git_checkout_version('hutch', @projects["hutch"][:revision])
1855
+ stack_body = File.read('projects/hutch/deploy/task.yml')
1856
+ parameters = [
1857
+ {
1858
+ parameter_key: "Environment",
1859
+ parameter_value: "qa"
1860
+ },
1861
+ {
1862
+ parameter_key: "ReleaseVersion",
1863
+ parameter_value: "#{@projects["hutch"][:revision]}"
1864
+ },
1865
+ {
1866
+ parameter_key: "ALBShortName",
1867
+ parameter_value: "hutch-qa-#{deploy_id}"[0..27]
1868
+ },
1869
+ {
1870
+ parameter_key: "ECSClusterName",
1871
+ parameter_value: @ecs_cluster_name
1872
+ },
1873
+ {
1874
+ parameter_key: "EnvHash",
1875
+ parameter_value: deploy_id
1876
+ },
1877
+ {
1878
+ parameter_key: "HostnamePattern",
1879
+ parameter_value: "hutch-#{@dns_record_identifier}.qa.colaster.com"
1880
+ },
1881
+ {
1882
+ parameter_key: "HostnamePatternPriority",
1883
+ parameter_value: (hostname_pattern_priority.to_i + 254).to_s
1884
+ },
1885
+ {
1886
+ parameter_key: "StarskyUrl",
1887
+ parameter_value: get_route53_hostname('ecs-task-starsky-qa-notneeded')
1888
+ }
1889
+ ]
1890
+ if stack_exists?(stack_name_hutch)
1891
+ cur_version = get_currently_deployed_version(stack_name_hutch)
1892
+ update_stack(stack_name_hutch, stack_body, parameters, tags, @cf_role) unless cur_version.include?(@projects["hutch"][:revision])
1893
+ else
1894
+ create_stack(stack_name_hutch, stack_body, parameters, tags, @cf_role)
1895
+ end
1896
+
1849
1897
  wait_for_stack_ready(stack_name_web) unless stack_ready?(stack_name_web)
1850
1898
  wait_for_stack_ready(stack_name_consumer) unless stack_ready?(stack_name_consumer)
1851
1899
  wait_for_stack_ready(stack_name_ermes) unless stack_ready?(stack_name_ermes)
@@ -1855,7 +1903,7 @@ class Release
1855
1903
  wait_for_stack_ready(stack_name_borat) unless stack_ready?(stack_name_borat)
1856
1904
  wait_for_stack_ready(stack_name_activia) unless stack_ready?(stack_name_activia)
1857
1905
  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?
1906
+ wait_for_stack_ready(stack_name_hutch) unless stack_ready?(stack_name_hutch) unless !deploy_starsky_hutch?
1859
1907
 
1860
1908
  update_service_defaults(stack_name_web)
1861
1909
  update_service_defaults(stack_name_consumer)
@@ -1873,6 +1921,7 @@ class Release
1873
1921
  update_service_defaults(stack_name_leftorium)
1874
1922
  update_service_defaults(stack_name_rachele)
1875
1923
  update_service_defaults(stack_name_starsky) unless !deploy_starsky_hutch?
1924
+ update_service_defaults(stack_name_hutch) unless !deploy_starsky_hutch?
1876
1925
  update_service_defaults(stack_name_crash) unless !deploy_crash?
1877
1926
 
1878
1927
  activia_hostname = get_route53_hostname(stack_name_activia)
@@ -1891,6 +1940,7 @@ class Release
1891
1940
  rachele_hostname = get_route53_hostname(stack_name_rachele)
1892
1941
  crash_hostname = get_route53_hostname(stack_name_crash) unless !deploy_crash?
1893
1942
  starsky_hostname = get_route53_hostname(stack_name_starsky) unless !deploy_starsky_hutch?
1943
+ hutch_hostname = get_route53_hostname(stack_name_hutch) unless !deploy_starsky_hutch?
1894
1944
 
1895
1945
  # launch_marley ec2_ip_address(asg_stack_name), prima_hostname, borat_hostname
1896
1946
 
@@ -1912,7 +1962,8 @@ class Release
1912
1962
  projects_text.concat "
1913
1963
  > Crash url: https://#{crash_hostname}" if deploy_crash?
1914
1964
  projects_text.concat "
1915
- > Starsky url: http://#{starsky_hostname}" if deploy_starsky_hutch?
1965
+ > Starsky url: https://#{starsky_hostname}
1966
+ > Hutch url: https://#{hutch_hostname}" if deploy_starsky_hutch?
1916
1967
  projects_text.concat "
1917
1968
  > RabbitMQ url: http://#{ec2_ip_address(asg_stack_name)}:15672
1918
1969
  > Supervisor url: http://#{ec2_ip_address(asg_stack_name)}:9001
@@ -1958,6 +2009,8 @@ class Release
1958
2009
  host = "rachele-#{@dns_record_identifier}.qa.colaster.com"
1959
2010
  when stack_name.include?('starsky')
1960
2011
  host = "starsky-#{@dns_record_identifier}.qa.colaster.com"
2012
+ when stack_name.include?('hutch')
2013
+ host = "hutch-#{@dns_record_identifier}.qa.colaster.com"
1961
2014
  end
1962
2015
  host
1963
2016
  end
@@ -2065,6 +2118,8 @@ class Release
2065
2118
  logical_resource_id = 'ECSServiceCrashQA'
2066
2119
  when stack_name.include?('starsky')
2067
2120
  logical_resource_id = 'ECSServiceStarskyQA'
2121
+ when stack_name.include?('hutch')
2122
+ logical_resource_id = 'ECSServiceHutch'
2068
2123
  else
2069
2124
  raise "Service name non gestito per lo stack #{stack_name}"
2070
2125
  end
@@ -2278,6 +2333,9 @@ class Release
2278
2333
  '-c' 'mix local.hex --force && mix hex.info && \
2279
2334
  mix deps.get && mix compile && mix deps.compile && \
2280
2335
  mix phx.digest && \
2336
+ MIX_ENV=dev mix compile.sms && \
2337
+ MIX_ENV=dev mix compile.html && \
2338
+ MIX_ENV=dev mix compile.heml && \
2281
2339
  rm -rf _build/qa/rel/ && \
2282
2340
  mix release --env=qa'"
2283
2341
  ].each do |cmd|
@@ -2354,6 +2412,39 @@ class Release
2354
2412
  Dir.chdir '../../'
2355
2413
  end
2356
2414
 
2415
+ def create_hutch_artifact(revision)
2416
+ output "Preparo l'artifact hutch\n".yellow
2417
+
2418
+ git_checkout_version('hutch', revision)
2419
+
2420
+ Dir.chdir 'projects/hutch'
2421
+
2422
+ version = `git rev-parse HEAD`
2423
+
2424
+ decrypt_secrets() unless File.exist?('config/secrets.yml')
2425
+
2426
+ exec_step 'cp docker-compose-ci.yml docker-compose.yml'
2427
+ exec_step 'prepare-docker-compose --directory hutch && cp docker-compose-qainit.yml docker-compose.yml'
2428
+ exec_step "sed s/qa_deploy_id/#{get_deploy_id}/ .env.dist.qa"
2429
+ exec_step "cp .env.dist.qa .env"
2430
+
2431
+ [
2432
+ "sed -i 's/USER app/USER root/g' Dockerfile",
2433
+ "docker-compose build web",
2434
+ "docker-compose run -w $PWD -u root -e ELM_APP_STARSKY_URL=https://#{get_route53_hostname("starsky")} --entrypoint /bin/sh web \
2435
+ '-c' 'yarn && yarn run build \
2436
+ && tar cfz #{revision}-qa.tar.gz build package.json scripts config node_modules public elm-stuff src .env'"
2437
+ ].each do |cmd|
2438
+ execute_command cmd
2439
+ end
2440
+
2441
+ artifact_path = "./#{revision}-qa.tar.gz"
2442
+
2443
+ upload_artifact(artifact_path, "microservices/hutch/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2444
+
2445
+ Dir.chdir '../../'
2446
+ end
2447
+
2357
2448
  def create_leftorium_artifact(revision)
2358
2449
  output "Preparo l'artifact leftorium .zip\n".yellow
2359
2450
 
@@ -2682,8 +2773,8 @@ class Release
2682
2773
  end
2683
2774
 
2684
2775
  def deploy_starsky_hutch?
2685
- starsky_present = !@projects['starsky'].empty? && @projects['starsky'][:name] != 'master' && !@projects['starsky'][:default_branch]
2686
- hutch_present = !@projects['hutch'].empty? && @projects['hutch'][:name] != 'master' && !@projects['hutch'][:default_branch]
2776
+ starsky_present = !@projects['starsky'].nil? && !@projects['starsky'].empty? && @projects['starsky'][:name] != 'master' && !@projects['starsky'][:default_branch]
2777
+ hutch_present = !@projects['hutch'].nil? &&!@projects['hutch'].empty? && @projects['hutch'][:name] != 'master' && !@projects['hutch'][:default_branch]
2687
2778
  starsky_present || hutch_present
2688
2779
  end
2689
2780
 
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.89
4
+ version: 0.50.101
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-20 00:00:00.000000000 Z
17
+ date: 2019-10-02 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: aws-sdk