Skip to content

Commit

Permalink
Merge pull request #568 from danskernesdigitalebibliotek/DDFBRA-328-f…
Browse files Browse the repository at this point in the history
…a-styr-pa-env-variabler-i-lagoon-inden-release-i-naeste-uge-uge-3

Ensure consumer passwords and secrets in projects
  • Loading branch information
ITViking authored Jan 9, 2025
2 parents 7b305e1 + 8d48715 commit 5d45bcd
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions infrastructure/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,40 @@ tasks:
- sh: "[ ! -z \"{{.PROJECT_NAME}}\" ]"
msg: "Missing PROJECT_NAME"

lagoon:project:ensure:consumer-secrets-n-passwords:
cmds:
- task: lagoon:ensure:environment-variable
vars:
VARIABLE_NAME: "BNF_GRAPHQL_CONSUMER_SECRET"
PROJECT_NAME: "{{.PROJECT_NAME}}"
VARIABLE_SCOPE: "RUNTIME"
# TODO: The variable values should be generated and stored in a secret manager.
VARIABLE_VALUE: "foo"
- task: lagoon:ensure:environment-variable
vars:
VARIABLE_NAME: "BNF_GRAPHQL_CONSUMER_USER_PASSWORD"
PROJECT_NAME: "{{.PROJECT_NAME}}"
VARIABLE_SCOPE: "RUNTIME"
# TODO: The variable values should be generated and stored in a secret manager.
VARIABLE_VALUE: "foo"
- task: lagoon:ensure:environment-variable
vars:
VARIABLE_NAME: "GO_GRAPHQL_CONSUMER_SECRET"
PROJECT_NAME: "{{.PROJECT_NAME}}"
VARIABLE_SCOPE: "RUNTIME"
# TODO: The variable values should be generated and stored in a secret manager.
VARIABLE_VALUE: "foo"
- task: lagoon:ensure:environment-variable
vars:
VARIABLE_NAME: "GO_GRAPHQL_CONSUMER_USER_PASSWORD"
PROJECT_NAME: "{{.PROJECT_NAME}}"
VARIABLE_SCOPE: "RUNTIME"
# TODO: The variable values should be generated and stored in a secret manager.
VARIABLE_VALUE: "foo"
preconditions:
- sh: "[ ! -z \"{{.PROJECT_NAME}}\" ]"
msg: "Missing PROJECT_NAME"

lagoon:add:cluster:
deps: [cluster:auth]
desc: Add a Kubernetes cluster (Lagoon Remote) to the Lagoon Core.
Expand Down Expand Up @@ -801,6 +835,9 @@ tasks:
- task: lagoon:project:ensure:azure-mail-connection-string
vars:
PROJECT_NAME: "{{.PROJECT_NAME}}"
- task: lagoon:project:ensure:consumer-secrets-n-passwords
vars:
PROJECT_NAME: "{{.PROJECT_NAME}}"
preconditions:
- sh: "[ ! -z {{.GIT_URL}} ]"
msg: "Env variable GIT_URL is not set or empty."
Expand Down

0 comments on commit 5d45bcd

Please sign in to comment.