From 671798a04a0c425b283141908a848a2c53433c69 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Fri, 4 Oct 2019 17:12:27 +0200 Subject: [PATCH] pipeline(*): load meta information from templates repository Spruce load `meta-inf.yml` if presents --- concourse/pipelines/template/bosh-pipeline.yml.erb | 4 ++++ concourse/pipelines/template/cf-apps-pipeline.yml.erb | 1 + concourse/pipelines/template/concourse-pipeline.yml.erb | 1 + concourse/pipelines/template/tf-pipeline.yml.erb | 1 + .../template_processor_for_bosh_pipeline_spec.rb | 2 +- .../template_processor_for_concourse_pipeline_spec.rb | 1 + .../fixtures/references/apps-depls-cf-apps-ref.yml | 1 + .../fixtures/references/delete-depls-bosh-ref.yml | 1 + .../generate-depls/fixtures/references/empty-depls.yml | 1 + .../fixtures/references/simple-depls-bosh-ref.yml | 3 +++ 10 files changed, 15 insertions(+), 1 deletion(-) diff --git a/concourse/pipelines/template/bosh-pipeline.yml.erb b/concourse/pipelines/template/bosh-pipeline.yml.erb index a8b99a0b9..1f120642e 100755 --- a/concourse/pipelines/template/bosh-pipeline.yml.erb +++ b/concourse/pipelines/template/bosh-pipeline.yml.erb @@ -380,6 +380,7 @@ jobs: ./credentials-resource/<%= depls %>/secrets/meta.yml ./credentials-resource/<%= depls %>/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/<%= depls %>/template IAAS_TYPE: ((iaas-type)) @@ -530,6 +531,7 @@ jobs: ./credentials-resource/<%= depls %>/<%= name %>/secrets/meta.yml ./credentials-resource/<%= depls %>/<%= name %>/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/<%= depls %>/<%= name %>/template IAAS_TYPE: ((iaas-type)) - task: execute-<%= name %>-spiff-pre-bosh-deploy @@ -947,6 +949,7 @@ jobs: ./credentials-resource/shared/secrets.yml ./credentials-resource/<%= terraform_config_path %>/secrets/meta.yml ./credentials-resource/<%= terraform_config_path %>/secrets/secrets.yml + ./additional-resource/meta-inf.yml YML_TEMPLATE_DIR: additional-resource/<%= terraform_config_path %>/template CUSTOM_SCRIPT_DIR: additional-resource/<%= terraform_config_path %>/template SUFFIX: -tpl.tfvars.yml @@ -994,6 +997,7 @@ jobs: ./credentials-resource/shared/secrets.yml ./credentials-resource/<%= terraform_config_path %>/secrets/meta.yml ./credentials-resource/<%= terraform_config_path %>/secrets/secrets.yml + ./additional-resource/meta-inf.yml YML_TEMPLATE_DIR: additional-resource/<%= terraform_config_path %>/template CUSTOM_SCRIPT_DIR: additional-resource/<%= terraform_config_path %>/template SUFFIX: -tpl.tfvars.yml diff --git a/concourse/pipelines/template/cf-apps-pipeline.yml.erb b/concourse/pipelines/template/cf-apps-pipeline.yml.erb index 64c1622fa..180d066a8 100755 --- a/concourse/pipelines/template/cf-apps-pipeline.yml.erb +++ b/concourse/pipelines/template/cf-apps-pipeline.yml.erb @@ -155,6 +155,7 @@ jobs: ./credentials-resource/<%= cf_app_info["base-dir"] %>/secrets/meta.yml ./credentials-resource/<%= cf_app_info["base-dir"] %>/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/<%= cf_app_info["base-dir"] %>/template - task: push-<%= app_name %> attempts: 2 diff --git a/concourse/pipelines/template/concourse-pipeline.yml.erb b/concourse/pipelines/template/concourse-pipeline.yml.erb index c16c1e561..353091348 100644 --- a/concourse/pipelines/template/concourse-pipeline.yml.erb +++ b/concourse/pipelines/template/concourse-pipeline.yml.erb @@ -133,6 +133,7 @@ jobs: YML_FILES: | ./credentials-resource/<%= depls %>/<%= name %>/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/<%= "#{depls}/#{name}/#{DeploymentDeployersConfig::CONCOURSE_CONFIG_DIRNAME}" %> IAAS_TYPE: ((iaas-type)) - task: execute-<%= name %>-spiff-pre-deploy diff --git a/concourse/pipelines/template/tf-pipeline.yml.erb b/concourse/pipelines/template/tf-pipeline.yml.erb index 1d8efddf2..b09f245ac 100755 --- a/concourse/pipelines/template/tf-pipeline.yml.erb +++ b/concourse/pipelines/template/tf-pipeline.yml.erb @@ -94,6 +94,7 @@ jobs: ./credentials-resource/shared/secrets.yml ./credentials-resource/<%= terraform_config_path %>/secrets/meta.yml ./credentials-resource/<%= terraform_config_path %>/secrets/secrets.yml + ./additional-resource/meta-inf.yml YML_TEMPLATE_DIR: additional-resource/<%= terraform_config_path %>/template CUSTOM_SCRIPT_DIR: additional-resource/<%= terraform_config_path %>/template SUFFIX: -tpl.tfvars.yml diff --git a/spec/lib/template_processor/template_processor_for_bosh_pipeline_spec.rb b/spec/lib/template_processor/template_processor_for_bosh_pipeline_spec.rb index 2b2714ac6..5dfaee86f 100644 --- a/spec/lib/template_processor/template_processor_for_bosh_pipeline_spec.rb +++ b/spec/lib/template_processor/template_processor_for_bosh_pipeline_spec.rb @@ -458,7 +458,7 @@ "file" => "cf-ops-automation/concourse/tasks/generate-manifest.yml", "params" => { "YML_FILES" => - "./credentials-resource/shared/secrets.yml\n./credentials-resource/my-tfstate-location/secrets/meta.yml\n./credentials-resource/my-tfstate-location/secrets/secrets.yml\n", + "./credentials-resource/shared/secrets.yml\n./credentials-resource/my-tfstate-location/secrets/meta.yml\n./credentials-resource/my-tfstate-location/secrets/secrets.yml\n./additional-resource/meta-inf.yml\n", "YML_TEMPLATE_DIR" => "additional-resource/my-tfstate-location/template", "CUSTOM_SCRIPT_DIR" => "additional-resource/my-tfstate-location/template", "SUFFIX" => "-tpl.tfvars.yml", diff --git a/spec/lib/template_processor/template_processor_for_concourse_pipeline_spec.rb b/spec/lib/template_processor/template_processor_for_concourse_pipeline_spec.rb index 7a2eaaa44..cf228711e 100644 --- a/spec/lib/template_processor/template_processor_for_concourse_pipeline_spec.rb +++ b/spec/lib/template_processor/template_processor_for_concourse_pipeline_spec.rb @@ -305,6 +305,7 @@ YML_FILES: | ./credentials-resource/#{root_deployment_name}/#{name}/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/#{root_deployment_name}/#{name}/#{DeploymentDeployersConfig::CONCOURSE_CONFIG_DIRNAME} IAAS_TYPE: ((iaas-type)) diff --git a/spec/scripts/generate-depls/fixtures/references/apps-depls-cf-apps-ref.yml b/spec/scripts/generate-depls/fixtures/references/apps-depls-cf-apps-ref.yml index bdbc0df61..8f0ad1cbf 100644 --- a/spec/scripts/generate-depls/fixtures/references/apps-depls-cf-apps-ref.yml +++ b/spec/scripts/generate-depls/fixtures/references/apps-depls-cf-apps-ref.yml @@ -140,6 +140,7 @@ jobs: ./credentials-resource/apps-depls/my_cf_app/secrets/meta.yml ./credentials-resource/apps-depls/my_cf_app/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/apps-depls/my_cf_app/template - task: push-test-app attempts: 2 diff --git a/spec/scripts/generate-depls/fixtures/references/delete-depls-bosh-ref.yml b/spec/scripts/generate-depls/fixtures/references/delete-depls-bosh-ref.yml index a791c71f0..3727b1982 100644 --- a/spec/scripts/generate-depls/fixtures/references/delete-depls-bosh-ref.yml +++ b/spec/scripts/generate-depls/fixtures/references/delete-depls-bosh-ref.yml @@ -205,6 +205,7 @@ jobs: ./credentials-resource/delete-depls/secrets/meta.yml ./credentials-resource/delete-depls/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/delete-depls/template IAAS_TYPE: ((iaas-type)) - in_parallel: diff --git a/spec/scripts/generate-depls/fixtures/references/empty-depls.yml b/spec/scripts/generate-depls/fixtures/references/empty-depls.yml index 18a7bf0cd..95d8405b3 100644 --- a/spec/scripts/generate-depls/fixtures/references/empty-depls.yml +++ b/spec/scripts/generate-depls/fixtures/references/empty-depls.yml @@ -166,6 +166,7 @@ jobs: ./credentials-resource/dummy-depls/secrets/meta.yml ./credentials-resource/dummy-depls/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/dummy-depls/template IAAS_TYPE: ((iaas-type)) diff --git a/spec/scripts/generate-depls/fixtures/references/simple-depls-bosh-ref.yml b/spec/scripts/generate-depls/fixtures/references/simple-depls-bosh-ref.yml index 17577612f..2da2f34ba 100644 --- a/spec/scripts/generate-depls/fixtures/references/simple-depls-bosh-ref.yml +++ b/spec/scripts/generate-depls/fixtures/references/simple-depls-bosh-ref.yml @@ -217,6 +217,7 @@ jobs: ./credentials-resource/simple-depls/secrets/meta.yml ./credentials-resource/simple-depls/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/simple-depls/template IAAS_TYPE: ((iaas-type)) - in_parallel: @@ -330,6 +331,7 @@ jobs: ./credentials-resource/simple-depls/ntp-with-scan/secrets/meta.yml ./credentials-resource/simple-depls/ntp-with-scan/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/simple-depls/ntp-with-scan/template IAAS_TYPE: ((iaas-type)) - task: execute-ntp-with-scan-spiff-pre-bosh-deploy @@ -531,6 +533,7 @@ jobs: ./credentials-resource/simple-depls/zookeeper-without-scan/secrets/meta.yml ./credentials-resource/simple-depls/zookeeper-without-scan/secrets/secrets.yml ./credentials-resource/shared/secrets.yml + ./additional-resource/meta-inf.yml CUSTOM_SCRIPT_DIR: additional-resource/simple-depls/zookeeper-without-scan/template IAAS_TYPE: "((iaas-type))" - task: execute-zookeeper-without-scan-spiff-pre-bosh-deploy