Skip to content

Commit

Permalink
add secrets for local dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalyska committed Jul 27, 2023
1 parent 7334207 commit 27c9578
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/devcontainer.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SOPS_AGE_KEY=
TERRAFORM_TOKEN=
5 changes: 1 addition & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"build": {
"dockerfile": "Dockerfile"
},
"containerEnv": {
"LOCAL_TERRAFORM_TOKEN": "${localEnv:TERRAFORM_TOKEN}",
"LOCAL_SOPS_AGE_KEY": "${localEnv:SOPS_AGE_KEY}"
},
"secrets": {
"SOPS_AGE_KEY": {
"description": "SOPS AGE key for decrypting secrets."
Expand All @@ -21,6 +17,7 @@
"updateContentCommand": "bash .devcontainer/scripts/updateContentCommand.sh",
"remoteUser": "vscode",
"containerUser": "vscode",
"runArgs": ["--env-file",".devcontainer/devcontainer.env"],
"features": {
"ghcr.io/devcontainers/features/go:1": {}
},
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ Chart.lock
.vagrant
# Tasks
.task
# env variables
.devcontainer/devcontainer.env
2 changes: 1 addition & 1 deletion .taskfiles/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3"

env:
TF_TOKEN_app_terraform_io:
sh: if [ "$CODESPACES" = "true" ]; then echo "$TERRAFORM_TOKEN"; else echo "$LOCAL_TERRAFORM_TOKEN"; fi
sh: echo "$TERRAFORM_TOKEN"
tasks:
test:
cmd: "echo $TF_TOKEN_app_terraform_io"
Expand Down

0 comments on commit 27c9578

Please sign in to comment.