Giles Bradshaw 1 year ago
parent
commit
c2291a8485
2 changed files with 6 additions and 6 deletions
  1. +4
    -6
      drone-starlark/repos/print-secrets.star
  2. +2
    -0
      drone-starlark/repos/secret-to-environment.star

+ 4
- 6
drone-starlark/repos/print-secrets.star View File

@@ -1,24 +1,22 @@
load("@this//:map.star", "map")
load("@this//:from-secret.star", "fromSecret")
load("@this//:environment.star", "environment")

def secretToEnvironment(secret):
return secret.replace("-", "_").upper()
load("@this//:secretTonvironment.star", "secretToEnvironment")

def echo(secret):
return 'echo "export {environment}=${environment}" >> ***filename*** # {secret}'.format(
secret = secret,
environment = secret.replace("-", "_").upper(),
environment = secretToEnvironment(secret), #secret.replace("-", "_").upper(),
)
def echoSecret(secret):
return 'echo "export {environment}=???" >> ***filename*** # {secret}'.format(
secret = secret,
environment = secret.replace("-", "_").upper()
environment = secretToEnvironment(secret), # .replace("-", "_").upper()
)

def export(secret):
return "export {toCaps}=${toCaps}".format(
toCaps = secret.replace("-", "_").upper(),
toCaps = secretToEnvironment(secret), #secret.replace("-", "_").upper(),
)
def printSecrets(filename, env, secretEnv):
return {


+ 2
- 0
drone-starlark/repos/secret-to-environment.star View File

@@ -0,0 +1,2 @@
def secretToEnvironment(secret):
return secret.replace("-", "_").upper()