Skip to content

Commit

Permalink
Merge pull request #2376 from input-output-hk/fix-terraform-secrets
Browse files Browse the repository at this point in the history
Fixing a deployment bug when pass is not available.
  • Loading branch information
krisajenkins committed Oct 20, 2020
2 parents dc59ed5 + 266cbc4 commit 6ffb258
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
22 changes: 16 additions & 6 deletions deployment/default.nix
Expand Up @@ -69,16 +69,26 @@ let
ln -s ${terraform-vars env region}/* $tmp_dir
cd $tmp_dir
echo "read secrets"
TF_VAR_marlowe_github_client_id=$(pass ${env}/marlowe/githubClientId)
TF_VAR_marlowe_github_client_secret=$(pass ${env}/marlowe/githubClientSecret)
TF_VAR_marlowe_jwt_signature=$(pass ${env}/marlowe/jwtSignature)
TF_VAR_plutus_github_client_id=$(pass ${env}/plutus/githubClientId)
TF_VAR_plutus_github_client_secret=$(pass ${env}/plutus/githubClientSecret)
TF_VAR_plutus_jwt_signature=$(pass ${env}/plutus/jwtSignature)
export TF_VAR_marlowe_github_client_id
export TF_VAR_marlowe_github_client_secret
export TF_VAR_marlowe_jwt_signature
export TF_VAR_plutus_github_client_id
export TF_VAR_plutus_github_client_secret
export TF_VAR_plutus_jwt_signature
echo "apply terraform"
export TF_VAR_marlowe_github_client_id=$(pass ${env}/marlowe/githubClientId)
export TF_VAR_marlowe_github_client_secret=$(pass ${env}/marlowe/githubClientSecret)
export TF_VAR_marlowe_jwt_signature=$(pass ${env}/marlowe/jwtSignature)
export TF_VAR_plutus_github_client_id=$(pass ${env}/plutus/githubClientId)
export TF_VAR_plutus_github_client_secret=$(pass ${env}/plutus/githubClientSecret)
export TF_VAR_plutus_jwt_signature=$(pass ${env}/plutus/jwtSignature)
${terraform}/bin/terraform init
${terraform}/bin/terraform workspace select ${env}
${terraform}/bin/terraform apply -var-file=${env}.tfvars
marlowe_api_id=$(${terraform}/bin/terraform output marlowe_rest_api_id)
plutus_api_id=$(${terraform}/bin/terraform output plutus_rest_api_id)
region=$(${terraform}/bin/terraform output region)
Expand Down
1 change: 1 addition & 0 deletions shell.nix
Expand Up @@ -53,6 +53,7 @@ in haskell.packages.shellFor {
pkgs.rPackages.plotly # for generating R plots locally
pkgs.R
]);

# we have a local passwords store that we use for deployments etc.
PASSWORD_STORE_DIR = toString ./. + "/secrets";
}

0 comments on commit 6ffb258

Please sign in to comment.