Skip to content

Commit

Permalink
Pass the git ssh public key to concourse terraform
Browse files Browse the repository at this point in the history
Get the generated git ssh public key and pass it as a variable to
concourse terraform, so that it can upload it to the git codecommit
user.
  • Loading branch information
keymon committed Mar 23, 2016
1 parent f2afc9c commit d9fab0f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions concourse/pipelines/create-deployer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ resources:
versioned_file: id_rsa
region_name: {{aws_region}}

- name: git-ssh-public-key
type: s3-iam
source:
bucket: {{state_bucket}}
versioned_file: git_id_rsa.pub
region_name: {{aws_region}}

- name: concourse-cert
type: s3-iam
source:
Expand Down Expand Up @@ -217,6 +224,7 @@ jobs:
passed: [vpc]
- get: concourse-terraform-state
- get: concourse-cert
- get: git-ssh-public-key

- task: vpc-terraform-outputs-to-sh
config:
Expand Down Expand Up @@ -270,6 +278,7 @@ jobs:
- name: vpc-terraform-outputs
- name: concourse-terraform-state
- name: generate-concourse-cert
- name: git-ssh-public-key
params:
VAGRANT_IP: {{vagrant_ip}}
TF_VAR_env: {{deploy_env}}
Expand All @@ -283,6 +292,7 @@ jobs:
- |
cp generate-concourse-cert/concourse.crt generate-concourse-cert/concourse.key .
. vpc-terraform-outputs/tfvars.sh
export TF_VAR_git_rsa_id_pub=$(<git-ssh-public-key/git_id_rsa.pub)
terraform_params=${VAGRANT_IP:+-var vagrant_cidr=$VAGRANT_IP/32}
terraform apply ${terraform_params} \
-var-file=paas-cf/terraform/{{aws_account}}.tfvars \
Expand Down

0 comments on commit d9fab0f

Please sign in to comment.