Skip to content

Commit

Permalink
Fix improper input mapping for secrets in tf-pipeline
Browse files Browse the repository at this point in the history
removed secrets-full and only uses secrets-<%=depls %>
  • Loading branch information
gberche-orange committed Nov 23, 2017
1 parent 79bca0e commit 95a1336
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions concourse/pipelines/template/tf-pipeline.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ resources:
cert: {{slack-custom-root-cert}}

# Scan the whole subdeployment from its root, not only the secret part
# Only used to trigger builds from service broker inputs
- name: secrets-<%=depls %>-trigger
- name: secrets-<%=depls %>
type: git
source:
uri: {{secrets-uri}}
Expand Down Expand Up @@ -48,12 +47,12 @@ resources:
<% unless all_ci_deployments.empty? %>
# Used to get other deployments secrets (e.g. micro/master for mattermost/git) as well as shared secrets updates
# This does not trigger automatically a new build, operators have to trigger it manually.
- name: secrets-full
type: git
source:
uri: {{secrets-uri}}
branch: {{secrets-branch}}
skip_ssl_verification: true
#- name: secrets-full
# type: git
# source:
# uri: {{secrets-uri}}
# branch: {{secrets-branch}}
# skip_ssl_verification: true

- name: paas-templates-full
type: git
Expand Down Expand Up @@ -91,13 +90,11 @@ jobs:
trigger: true
- get: paas-templates-full
params: { submodules: none}
- get: secrets-full
params: { submodules: none}
- get: secrets-<%=depls %>-trigger
- get: secrets-<%=depls %>
params: { submodules: none}
trigger: true
- task: generate-terraform-tfvars
input_mapping: {scripts-resource: cf-ops-automation, credentials-resource: secrets-<%=depls %>-trigger, additional-resource: paas-templates-full}
input_mapping: {scripts-resource: cf-ops-automation, credentials-resource: secrets-<%=depls %>, additional-resource: paas-templates-full}
output_mapping: {generated-files: terraform-tfvars}
file: cf-ops-automation/concourse/tasks/generate-manifest.yml
params:
Expand All @@ -109,15 +106,15 @@ jobs:
CUSTOM_SCRIPT_DIR: additional-resource/<%= terraform_config_path %>/template
SUFFIX: -tpl.tfvars.yml
- task: terraform-apply
input_mapping: {secret-state-resource: secrets-full,spec-resource: paas-templates-full}
input_mapping: {secret-state-resource: secrets-<%=depls %>,spec-resource: paas-templates-full}
output_mapping: {generated-files: terraform-cf}
file: cf-ops-automation/concourse/tasks/terraform_apply_cloudfoundry.yml
params:
SPEC_PATH: "<%= terraform_config_path %>/spec"
SECRET_STATE_FILE_PATH: "<%= terraform_config_path %>"
ensure:
task: update-terraform-state-file
input_mapping: {reference-resource: secrets-full, generated-resource: terraform-cf}
input_mapping: {reference-resource: secrets-<%=depls %>, generated-resource: terraform-cf}
output_mapping: {updated-git-resource: updated-terraform-state-secrets}
file: cf-ops-automation/concourse/tasks/git_update_a_file_from_generated.yml
params:
Expand All @@ -132,7 +129,7 @@ jobs:
icon_url: http://cl.ly/image/3e1h0H3H2s0P/concourse-logo.png
username: Concourse
on_success:
put: secrets-full
put: secrets-<%=depls %>
get_params: {submodules: none}
params:
repository: updated-terraform-state-secrets
Expand Down

0 comments on commit 95a1336

Please sign in to comment.