prima-twig 0.53.10 → 0.53.34
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 +4 -4
- data/bin/twig-feature +54 -28
- data/bin/twig-update-ami +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 698ada9cb02f767bdc8676488c7de698ca26539b46d866be88087f33724219a6
|
|
4
|
+
data.tar.gz: 1088d2c9559d908befe686d944671916110f6cea5d9251ce5e625c4722e37f7e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bac02bc639fef9e6a2451b0ba46ec4c9f3e2f5c119b7a28eb3697345083a88aac6fc4a0e6acffc55fd2b5021466d335a208421733fc28296c9f47ccccca9a71a
|
|
7
|
+
data.tar.gz: 78be5c3cbb43cb13482121447865846e85e7a3fc80f830f3b7970b6ab222921fe3051e511c4c00661b2e2d72471c0f0a3b5c463270faf9e6d80efea4fcfe7449
|
data/bin/twig-feature
CHANGED
|
@@ -31,7 +31,7 @@ class Release
|
|
|
31
31
|
@s3 = Aws::S3::Client.new
|
|
32
32
|
@s3_bucket = 'prima-artifacts'
|
|
33
33
|
@artifact_path = '/tmp/prima-artifact.zip'
|
|
34
|
-
@import_db_task = 'arn:aws:ecs:eu-west-1:001575623345:task-definition/ecs-task-db-restore2-TaskDefinitionDbRestore-
|
|
34
|
+
@import_db_task = 'arn:aws:ecs:eu-west-1:001575623345:task-definition/ecs-task-db-restore2-TaskDefinitionDbRestore-1BXH13XEVLPP0:1'
|
|
35
35
|
@cf_role = 'arn:aws:iam::001575623345:role/qainit-service-role-cloudformat-CloudformationRole-18KBZQIS148R9'
|
|
36
36
|
@dns_record_identifier = nil
|
|
37
37
|
@ecs_cluster_name = nil
|
|
@@ -497,7 +497,7 @@ class Release
|
|
|
497
497
|
end
|
|
498
498
|
end
|
|
499
499
|
|
|
500
|
-
File.open('branch_names', 'w') { |file| file.write(
|
|
500
|
+
File.open('branch_names', 'w') { |file| file.write(JSON.generate(@projects)) }
|
|
501
501
|
|
|
502
502
|
`git add projects && \
|
|
503
503
|
git add branch_names && \
|
|
@@ -559,14 +559,18 @@ class Release
|
|
|
559
559
|
# aggiornare il commit (revision a cui fa riferimento)
|
|
560
560
|
|
|
561
561
|
# leggo il file branch_names / recupero i nomi dei branch / riscrivo tutto
|
|
562
|
+
projects = ''
|
|
562
563
|
File.open('branch_names', 'r') do |file|
|
|
563
564
|
file.each_line do |line|
|
|
564
|
-
|
|
565
|
-
@projects[project[0]] = select_branch_to_deploy(project[0], project[1])
|
|
566
|
-
@projects[project[0]][:default_branch] = project[3]
|
|
565
|
+
projects = JSON.parse(line)
|
|
567
566
|
end
|
|
568
567
|
end
|
|
569
568
|
|
|
569
|
+
projects.each do |key, project|
|
|
570
|
+
@projects[key] = select_branch_to_deploy(key, project['name'])
|
|
571
|
+
@projects[key][:default_branch] = project['default_branch']
|
|
572
|
+
end
|
|
573
|
+
|
|
570
574
|
branches = ''
|
|
571
575
|
|
|
572
576
|
@projects.each_key do |project_key|
|
|
@@ -664,8 +668,8 @@ class Release
|
|
|
664
668
|
end
|
|
665
669
|
|
|
666
670
|
def qainit_write_output(file_message, output_message)
|
|
667
|
-
|
|
668
|
-
|
|
671
|
+
`mkdir -p /etc/qainit-output`
|
|
672
|
+
qa_file_name = "/etc/qainit-output/url_qa"
|
|
669
673
|
File.open(qa_file_name + '.txt', 'w') { |file| file.write(file_message) }
|
|
670
674
|
output "#{output_message} #{qa_file_name}".green
|
|
671
675
|
end
|
|
@@ -852,6 +856,10 @@ class Release
|
|
|
852
856
|
{
|
|
853
857
|
parameter_key: "WebHostname",
|
|
854
858
|
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
parameter_key: "HostnamePattern",
|
|
862
|
+
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
|
855
863
|
}
|
|
856
864
|
]
|
|
857
865
|
if stack_exists?(stack_name_web)
|
|
@@ -1766,6 +1774,10 @@ class Release
|
|
|
1766
1774
|
{
|
|
1767
1775
|
parameter_key: "WebHostname",
|
|
1768
1776
|
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
|
1777
|
+
},
|
|
1778
|
+
{
|
|
1779
|
+
parameter_key: "HostnamePattern",
|
|
1780
|
+
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
|
1769
1781
|
}
|
|
1770
1782
|
]
|
|
1771
1783
|
if stack_exists?(stack_name_web)
|
|
@@ -1806,6 +1818,10 @@ class Release
|
|
|
1806
1818
|
{
|
|
1807
1819
|
parameter_key: "WebHostname",
|
|
1808
1820
|
parameter_value: "www-#{@dns_record_identifier}.qa.colaster.com"
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
parameter_key: "HostnamePattern",
|
|
1824
|
+
parameter_value: "consumer-#{@dns_record_identifier}.qa.colaster.com"
|
|
1809
1825
|
}
|
|
1810
1826
|
]
|
|
1811
1827
|
if stack_exists?(stack_name_consumer)
|
|
@@ -2091,7 +2107,7 @@ class Release
|
|
|
2091
2107
|
when stack_name.include?('web')
|
|
2092
2108
|
logical_resource_id = 'ECSServiceWebQA'
|
|
2093
2109
|
when stack_name.include?('consumer')
|
|
2094
|
-
logical_resource_id = '
|
|
2110
|
+
logical_resource_id = 'ECSServiceConsumerQa'
|
|
2095
2111
|
when stack_name.include?('urania')
|
|
2096
2112
|
logical_resource_id = 'ECSServiceUraniaQA'
|
|
2097
2113
|
when stack_name.include?('backoffice')
|
|
@@ -2289,23 +2305,28 @@ class Release
|
|
|
2289
2305
|
|
|
2290
2306
|
`mv docker-compose-ci.yml docker-compose.yml`
|
|
2291
2307
|
exec_step 'prepare-docker-compose --directory crash && cp docker-compose-qainit.yml docker-compose.yml'
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2308
|
+
|
|
2309
|
+
if File.exists? 'deploy/build_qa_artifact'
|
|
2310
|
+
`deploy/build_qa_artifact #{deploy_id}`
|
|
2311
|
+
else # TODO remove when deploy/build_qa_artifact is merged
|
|
2312
|
+
[
|
|
2313
|
+
'docker-compose build web',
|
|
2314
|
+
"docker-compose run -w $PWD -u root -e MIX_ENV=qa -e ENV_HASH=#{deploy_id} web \
|
|
2315
|
+
'-c' 'mix local.hex --force && mix hex.info && \
|
|
2316
|
+
mix deps.get && \
|
|
2317
|
+
cd assets && \
|
|
2318
|
+
yarn --cache-folder ~/.cache/yarn && \
|
|
2319
|
+
NODE_ENV=production sysconfcpus -n 1 yarn run build && \
|
|
2320
|
+
cd ../ && \
|
|
2321
|
+
mix release.clean --implode --no-confirm && \
|
|
2322
|
+
mix phx.digest && \
|
|
2323
|
+
mix deps.clean --all && \
|
|
2324
|
+
mix deps.get && \
|
|
2325
|
+
mix compile && mix release --env=qa'",
|
|
2326
|
+
'docker-compose down'
|
|
2327
|
+
].each do |cmd|
|
|
2328
|
+
execute_command cmd
|
|
2329
|
+
end
|
|
2309
2330
|
end
|
|
2310
2331
|
|
|
2311
2332
|
cleanup_containers
|
|
@@ -2344,6 +2365,7 @@ class Release
|
|
|
2344
2365
|
MIX_ENV=dev mix compile.sms && \
|
|
2345
2366
|
MIX_ENV=dev mix compile.html && \
|
|
2346
2367
|
MIX_ENV=dev mix compile.heml && \
|
|
2368
|
+
MIX_ENV=dev mix compile.app_notification && \
|
|
2347
2369
|
rm -rf _build/qa/rel/ && \
|
|
2348
2370
|
mix release --env=qa'"
|
|
2349
2371
|
].each do |cmd|
|
|
@@ -2431,6 +2453,7 @@ class Release
|
|
|
2431
2453
|
|
|
2432
2454
|
decrypt_secrets() unless File.exist?('config/secrets.yml')
|
|
2433
2455
|
|
|
2456
|
+
exec_step 'git submodule update'
|
|
2434
2457
|
exec_step 'cp docker-compose-ci.yml docker-compose.yml'
|
|
2435
2458
|
exec_step 'prepare-docker-compose --directory hutch && cp docker-compose-qainit.yml docker-compose.yml'
|
|
2436
2459
|
exec_step "sed s/qa_deploy_id/#{get_deploy_id}/ .env.dist.qa"
|
|
@@ -2630,7 +2653,7 @@ class Release
|
|
|
2630
2653
|
mix deps.get && mix compile && mix deps.compile && \
|
|
2631
2654
|
mix phx.digest && \
|
|
2632
2655
|
rm -rf _build/qa/rel/ && \
|
|
2633
|
-
mix release --env=qa'"
|
|
2656
|
+
mix distillery.release --env=qa'"
|
|
2634
2657
|
].each do |cmd|
|
|
2635
2658
|
execute_command cmd
|
|
2636
2659
|
end
|
|
@@ -2704,13 +2727,16 @@ class Release
|
|
|
2704
2727
|
|
|
2705
2728
|
decrypt_secrets() unless File.exist?('config/secrets.yml')
|
|
2706
2729
|
|
|
2707
|
-
|
|
2730
|
+
`mv docker-compose-ci.yml docker-compose.yml`
|
|
2708
2731
|
exec_step 'prepare-docker-compose --directory starsky && cp docker-compose-qainit.yml docker-compose.yml'
|
|
2709
2732
|
exec_step "sed s/qa_deploy_id/#{get_deploy_id}/ .env.dist.qa"
|
|
2710
2733
|
exec_step "cp .env.dist.qa .env"
|
|
2711
2734
|
|
|
2712
2735
|
[
|
|
2713
2736
|
"sed -i 's/USER app/USER root/g' Dockerfile",
|
|
2737
|
+
"if echo `docker network ls` | grep peano_default; \
|
|
2738
|
+
then echo 'peano_default network already existing'; \
|
|
2739
|
+
else docker network create peano_default; fi",
|
|
2714
2740
|
"docker-compose build web",
|
|
2715
2741
|
"docker-compose run -w $PWD -e BUILD_ENV=qa -u root --entrypoint /bin/sh web \
|
|
2716
2742
|
'-c' 'cargo build --release -vv --features=qa \
|
|
@@ -2921,7 +2947,7 @@ class Release
|
|
|
2921
2947
|
end
|
|
2922
2948
|
|
|
2923
2949
|
def choose_branch_to_deploy(project_name, select_master = false)
|
|
2924
|
-
return {} if project_name == 'crash' && select_master
|
|
2950
|
+
return {name: 'master', revision: '399653d555b8864', committer: 'crash@prima.it', default_branch: true} if project_name == 'crash' && select_master
|
|
2925
2951
|
Dir.chdir "projects/#{project_name}"
|
|
2926
2952
|
output "Recupero la lista dei branch del progetto #{project_name}..."
|
|
2927
2953
|
`git remote prune origin`
|
data/bin/twig-update-ami
CHANGED
|
@@ -150,7 +150,7 @@ class TwigUpdateAmi
|
|
|
150
150
|
end
|
|
151
151
|
|
|
152
152
|
def update_packer(json_filename)
|
|
153
|
-
execute_command "packer build -var datadog_apikey=`biscuit get -f ../configs/secrets/common.yml common_production_apikey_datadog` -var github_token=`biscuit get -f ../configs/secrets/common.yml common_private_repo_github_token` -machine-readable ./#{json_filename} | tee build.log"
|
|
153
|
+
execute_command "packer build -var datadog_apikey=`biscuit get -f ../configs/secrets/common.yml common_production_apikey_datadog` -var github_token=`biscuit get -f ../configs/secrets/common.yml common_private_repo_github_token` -var drone_key=\"`biscuit get -f ../configs/secrets/common.yml drone_license_key`\" -machine-readable ./#{json_filename} | tee build.log"
|
|
154
154
|
`grep 'artifact,0,id' build.log | cut -d, -f6 | cut -d: -f2`.sub(/\n/, '')
|
|
155
155
|
end
|
|
156
156
|
|
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.
|
|
4
|
+
version: 0.53.34
|
|
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-
|
|
17
|
+
date: 2019-11-11 00:00:00.000000000 Z
|
|
18
18
|
dependencies:
|
|
19
19
|
- !ruby/object:Gem::Dependency
|
|
20
20
|
name: aws-sdk
|